]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm: Automatically register/unregister all connectors
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 17 Jun 2016 08:25:17 +0000 (09:25 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 17 Jun 2016 12:42:40 +0000 (14:42 +0200)
As the drm_connector is now safe for multiple calls to
register/unregister, automatically perform a registration on all known
connectors drm drv_register (and unregister from drm_drv_unregister).
Drivers can still call drm_connector_register() and
drm_connector_unregister() individually, or defer as required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1466151923-1572-2-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_drv.c

index 316dea9bea08c3affd2a1e28e761f139d1182eb6..e7c862bd2f1972103709bf21844d3e7ba61c19ed 100644 (file)
@@ -1047,9 +1047,9 @@ EXPORT_SYMBOL(drm_connector_unregister);
  * @dev: drm device
  *
  * This function registers all connectors in sysfs and other places so that
- * userspace can start to access them. Drivers can call it after calling
- * drm_dev_register() to complete the device registration, if they don't call
- * drm_connector_register() on each connector individually.
+ * userspace can start to access them. drm_connector_register_all() is called
+ * automatically from drm_dev_register() to complete the device registration,
+ * if they don't call drm_connector_register() on each connector individually.
  *
  * When a device is unplugged and should be removed from userspace access,
  * call drm_connector_unregister_all(), which is the inverse of this
index 40fb4352432ced38876e23fbf2dfaa18535ae4cd..2067ff0893803efc6bd19a4e5595448f2c83a72e 100644 (file)
@@ -650,11 +650,7 @@ EXPORT_SYMBOL(drm_dev_unref);
  *
  * Register the DRM device @dev with the system, advertise device to user-space
  * and start normal device operation. @dev must be allocated via drm_dev_alloc()
- * previously. Right after drm_dev_register() the driver should call
- * drm_connector_register_all() to register all connectors in sysfs. This is
- * a separate call for backward compatibility with drivers still using
- * the deprecated ->load() callback, where connectors are registered from within
- * the ->load() callback.
+ * previously.
  *
  * Never call this twice on any device!
  *
@@ -691,6 +687,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
                        goto err_minors;
        }
 
+       drm_connector_register_all(dev);
+
        ret = 0;
        goto out_unlock;
 
@@ -721,6 +719,8 @@ void drm_dev_unregister(struct drm_device *dev)
 
        drm_lastclose(dev);
 
+       drm_connector_unregister_all(dev);
+
        if (dev->driver->unload)
                dev->driver->unload(dev);