diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-17 04:25:17 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-17 08:42:40 -0400 |
commit | e28cd4d0a223e1bcea616326e2281900e7e7e9a2 (patch) | |
tree | 036b8b165befae00673acc42a853ca4c01335422 | |
parent | acd8f414c957406c8272cbc380dd50fea945dcf1 (diff) |
drm: Automatically register/unregister all connectors
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
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 316dea9bea08..e7c862bd2f19 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1047,9 +1047,9 @@ EXPORT_SYMBOL(drm_connector_unregister); | |||
1047 | * @dev: drm device | 1047 | * @dev: drm device |
1048 | * | 1048 | * |
1049 | * This function registers all connectors in sysfs and other places so that | 1049 | * This function registers all connectors in sysfs and other places so that |
1050 | * userspace can start to access them. Drivers can call it after calling | 1050 | * userspace can start to access them. drm_connector_register_all() is called |
1051 | * drm_dev_register() to complete the device registration, if they don't call | 1051 | * automatically from drm_dev_register() to complete the device registration, |
1052 | * drm_connector_register() on each connector individually. | 1052 | * if they don't call drm_connector_register() on each connector individually. |
1053 | * | 1053 | * |
1054 | * When a device is unplugged and should be removed from userspace access, | 1054 | * When a device is unplugged and should be removed from userspace access, |
1055 | * call drm_connector_unregister_all(), which is the inverse of this | 1055 | * call drm_connector_unregister_all(), which is the inverse of this |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 40fb4352432c..2067ff089380 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -650,11 +650,7 @@ EXPORT_SYMBOL(drm_dev_unref); | |||
650 | * | 650 | * |
651 | * Register the DRM device @dev with the system, advertise device to user-space | 651 | * Register the DRM device @dev with the system, advertise device to user-space |
652 | * and start normal device operation. @dev must be allocated via drm_dev_alloc() | 652 | * and start normal device operation. @dev must be allocated via drm_dev_alloc() |
653 | * previously. Right after drm_dev_register() the driver should call | 653 | * previously. |
654 | * drm_connector_register_all() to register all connectors in sysfs. This is | ||
655 | * a separate call for backward compatibility with drivers still using | ||
656 | * the deprecated ->load() callback, where connectors are registered from within | ||
657 | * the ->load() callback. | ||
658 | * | 654 | * |
659 | * Never call this twice on any device! | 655 | * Never call this twice on any device! |
660 | * | 656 | * |
@@ -691,6 +687,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) | |||
691 | goto err_minors; | 687 | goto err_minors; |
692 | } | 688 | } |
693 | 689 | ||
690 | drm_connector_register_all(dev); | ||
691 | |||
694 | ret = 0; | 692 | ret = 0; |
695 | goto out_unlock; | 693 | goto out_unlock; |
696 | 694 | ||
@@ -721,6 +719,8 @@ void drm_dev_unregister(struct drm_device *dev) | |||
721 | 719 | ||
722 | drm_lastclose(dev); | 720 | drm_lastclose(dev); |
723 | 721 | ||
722 | drm_connector_unregister_all(dev); | ||
723 | |||
724 | if (dev->driver->unload) | 724 | if (dev->driver->unload) |
725 | dev->driver->unload(dev); | 725 | dev->driver->unload(dev); |
726 | 726 | ||