drm: Remove command line guard for universal planes
[deliverable/linux.git] / drivers / gpu / drm / drm_ioctl.c
index 93a42040bedb38a2bd21c4a8409a6ad83081674f..ad66f961170e0517f386ceca3519f9da3120a7b0 100644 (file)
@@ -72,9 +72,6 @@ static void
 drm_unset_busid(struct drm_device *dev,
                struct drm_master *master)
 {
-       kfree(dev->devname);
-       dev->devname = NULL;
-
        kfree(master->unique);
        master->unique = NULL;
        master->unique_len = 0;
@@ -93,7 +90,8 @@ drm_unset_busid(struct drm_device *dev,
  * Copies the bus id from userspace into drm_device::unique, and verifies that
  * it matches the device this DRM is attached to (EINVAL otherwise).  Deprecated
  * in interface version 1.1 and will return EBUSY when setversion has requested
- * version 1.1 or greater.
+ * version 1.1 or greater. Also note that KMS is all version 1.1 and later and
+ * UMS was only ever supported on pci devices.
  */
 int drm_setunique(struct drm_device *dev, void *data,
                  struct drm_file *file_priv)
@@ -108,10 +106,13 @@ int drm_setunique(struct drm_device *dev, void *data,
        if (!u->unique_len || u->unique_len > 1024)
                return -EINVAL;
 
-       if (!dev->driver->bus->set_unique)
+       if (drm_core_check_feature(dev, DRIVER_MODESET))
+               return 0;
+
+       if (WARN_ON(!dev->pdev))
                return -EINVAL;
 
-       ret = dev->driver->bus->set_unique(dev, master, u);
+       ret = drm_pci_set_unique(dev, master, u);
        if (ret)
                goto err;
 
@@ -130,13 +131,25 @@ static int drm_set_busid(struct drm_device *dev, struct drm_file *file_priv)
        if (master->unique != NULL)
                drm_unset_busid(dev, master);
 
-       ret = dev->driver->bus->set_busid(dev, master);
-       if (ret)
-               goto err;
+       if (dev->driver->bus && dev->driver->bus->set_busid) {
+               ret = dev->driver->bus->set_busid(dev, master);
+               if (ret) {
+                       drm_unset_busid(dev, master);
+                       return ret;
+               }
+       } else {
+               if (WARN(dev->unique == NULL,
+                        "No drm_bus.set_busid() implementation provided by "
+                        "%ps. Use drm_dev_set_unique() to set the unique "
+                        "name explicitly.", dev->driver))
+                       return -EINVAL;
+
+               master->unique = kstrdup(dev->unique, GFP_KERNEL);
+               if (master->unique)
+                       master->unique_len = strlen(dev->unique);
+       }
+
        return 0;
-err:
-       drm_unset_busid(dev, master);
-       return ret;
 }
 
 /**
@@ -329,8 +342,6 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
                file_priv->stereo_allowed = req->value;
                break;
        case DRM_CLIENT_CAP_UNIVERSAL_PLANES:
-               if (!drm_universal_planes)
-                       return -EINVAL;
                if (req->value > 1)
                        return -EINVAL;
                file_priv->universal_planes = req->value;
This page took 0.060262 seconds and 5 git commands to generate.