The current recommendation is for new drivers to call: drm_dev_register(); drm_connector_register_all(); because of a limitation in the API for old drivers using driver->load() and being unable to call drm_connector_register() multiple times. Now that drm_connector_register() is safe for multiple uses, we can combine the two steps into one (drm_dev_register()). -Chris
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 --- drivers/gpu/drm/drm_crtc.c | 6 +++--- 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); * @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 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); * * 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);
On Fri, Jun 17, 2016 at 09:25:17AM +0100, Chris Wilson wrote:
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
Applied to drm-misc. I'll let driver maintainers have a little bit more time to ack or test the patches before I vacuum them up.
Thanks, Daniel
drivers/gpu/drm/drm_crtc.c | 6 +++--- 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);
- @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
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);
- 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);
-- 2.8.1
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Alexey Brodkin abrodkin@synopsys.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/arc/arcpgu_drv.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index 381c5fcbf903..ccbdadb108dc 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -211,15 +211,8 @@ static int arcpgu_probe(struct platform_device *pdev) if (ret) goto err_unload;
- ret = drm_connector_register_all(drm); - if (ret) - goto err_unregister; - return 0;
-err_unregister: - drm_dev_unregister(drm); - err_unload: arcpgu_unload(drm);
@@ -233,7 +226,6 @@ static int arcpgu_remove(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev);
- drm_connector_unregister_all(drm); drm_dev_unregister(drm); arcpgu_unload(drm); drm_dev_unref(drm);
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Boris Brezillon boris.brezillon@free-electrons.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 9ecf16c7911d..99c4af697c8a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -815,15 +815,8 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) if (ret) goto err_unload;
- ret = drm_connector_register_all(ddev); - if (ret) - goto err_unregister; - return 0;
-err_unregister: - drm_dev_unregister(ddev); - err_unload: atmel_hlcdc_dc_unload(ddev);
On 17 June 2016 at 09:25, Chris Wilson chris@chris-wilson.co.uk wrote:
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Boris Brezillon boris.brezillon@free-electrons.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 9ecf16c7911d..99c4af697c8a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -815,15 +815,8 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) if (ret) goto err_unload;
ret = drm_connector_register_all(ddev);
if (ret)
goto err_unregister;
return 0;
-err_unregister:
drm_dev_unregister(ddev);
err_unload: atmel_hlcdc_dc_unload(ddev);
This should also kill off atmel_hlcdc_dc_connector_unplug_all() ? The later of which has calls drm_connector_unregister_all() guarded by mode_config.mutex :-\
-Emil
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Xinliang Liu z.liuxinliang@hisilicon.com Cc: Xinwei Kong kong.kongxinwei@hisilicon.com Cc: Chen Feng puck.chen@hisilicon.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 193657259ee9..ef2c32ec1616 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -221,19 +221,12 @@ static int kirin_drm_bind(struct device *dev) if (ret) goto err_kms_cleanup;
- /* connectors should be registered after drm device register */ - ret = drm_connector_register_all(drm_dev); - if (ret) - goto err_drm_dev_unregister; - DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name, driver->major, driver->minor, driver->patchlevel, driver->date, drm_dev->primary->index);
return 0;
-err_drm_dev_unregister: - drm_dev_unregister(drm_dev); err_kms_cleanup: kirin_drm_kms_cleanup(drm_dev); err_drm_dev_unref: @@ -246,7 +239,6 @@ static void kirin_drm_unbind(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev);
- drm_connector_unregister_all(drm_dev); drm_dev_unregister(drm_dev); kirin_drm_kms_cleanup(drm_dev); drm_dev_unref(drm_dev);
Hi,
On 17 June 2016 at 16:25, Chris Wilson chris@chris-wilson.co.uk wrote:
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Xinliang Liu z.liuxinliang@hisilicon.com Cc: Xinwei Kong kong.kongxinwei@hisilicon.com Cc: Chen Feng puck.chen@hisilicon.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org
This patch looks fine to me. Thank you for your patch.
Acked-by: Xinliang Liu z.liuxinliang@hisilicon.com
Thanks, -xinliang
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 193657259ee9..ef2c32ec1616 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -221,19 +221,12 @@ static int kirin_drm_bind(struct device *dev) if (ret) goto err_kms_cleanup;
/* connectors should be registered after drm device register */
ret = drm_connector_register_all(drm_dev);
if (ret)
goto err_drm_dev_unregister;
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name, driver->major, driver->minor, driver->patchlevel, driver->date, drm_dev->primary->index); return 0;
-err_drm_dev_unregister:
drm_dev_unregister(drm_dev);
err_kms_cleanup: kirin_drm_kms_cleanup(drm_dev); err_drm_dev_unref: @@ -246,7 +239,6 @@ static void kirin_drm_unbind(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev);
drm_connector_unregister_all(drm_dev); drm_dev_unregister(drm_dev); kirin_drm_kms_cleanup(drm_dev); drm_dev_unref(drm_dev);
-- 2.8.1
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Matthias Brugger matthias.bgg@gmail.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index c33bf98c5d5e..7ab91f4a200f 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -293,14 +293,8 @@ static int mtk_drm_bind(struct device *dev) if (ret < 0) goto err_deinit;
- ret = drm_connector_register_all(drm); - if (ret < 0) - goto err_unregister; - return 0;
-err_unregister: - drm_dev_unregister(drm); err_deinit: mtk_drm_kms_deinit(drm); err_free: @@ -455,7 +449,6 @@ static int mtk_drm_remove(struct platform_device *pdev) struct drm_device *drm = private->drm; int i;
- drm_connector_unregister_all(drm); drm_dev_unregister(drm); mtk_drm_kms_deinit(drm); drm_dev_unref(drm);
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Rob Clark robdclark@gmail.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org --- drivers/gpu/drm/msm/msm_drv.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 9c654092ef78..568fcc328f27 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -197,8 +197,6 @@ static int msm_drm_uninit(struct device *dev)
drm_kms_helper_poll_fini(ddev);
- drm_connector_unregister_all(ddev); - drm_dev_unregister(ddev);
#ifdef CONFIG_DRM_FBDEV_EMULATION @@ -431,12 +429,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) if (ret) goto fail;
- ret = drm_connector_register_all(ddev); - if (ret) { - dev_err(dev, "failed to register connectors\n"); - goto fail; - } - drm_mode_config_reset(ddev);
#ifdef CONFIG_DRM_FBDEV_EMULATION
On 06/17/2016 01:55 PM, Chris Wilson wrote:
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Tested-by: Archit Taneja architt@codeaurora.org
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Rob Clark robdclark@gmail.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org
drivers/gpu/drm/msm/msm_drv.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 9c654092ef78..568fcc328f27 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -197,8 +197,6 @@ static int msm_drm_uninit(struct device *dev)
drm_kms_helper_poll_fini(ddev);
drm_connector_unregister_all(ddev);
drm_dev_unregister(ddev);
#ifdef CONFIG_DRM_FBDEV_EMULATION
@@ -431,12 +429,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) if (ret) goto fail;
ret = drm_connector_register_all(ddev);
if (ret) {
dev_err(dev, "failed to register connectors\n");
goto fail;
}
drm_mode_config_reset(ddev);
#ifdef CONFIG_DRM_FBDEV_EMULATION
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 48ec4b6e8b26..36d390093c92 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -278,7 +278,6 @@ static int rcar_du_remove(struct platform_device *pdev) struct rcar_du_device *rcdu = platform_get_drvdata(pdev); struct drm_device *ddev = rcdu->ddev;
- drm_connector_unregister_all(ddev); drm_dev_unregister(ddev);
if (rcdu->fbdev) @@ -360,10 +359,6 @@ static int rcar_du_probe(struct platform_device *pdev) if (ret) goto error;
- ret = drm_connector_register_all(ddev); - if (ret < 0) - goto error; - DRM_INFO("Device %s probed\n", dev_name(&pdev->dev));
return 0;
On Fri, Jun 17, 2016 at 09:25:23AM +0100, Chris Wilson wrote:
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org
Ok, merged the driver patches now. Would be good to unexport/static drm_connector_register_all, and I think there's a few drivers (like vc4) which open-coded it. -Daniel
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 48ec4b6e8b26..36d390093c92 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -278,7 +278,6 @@ static int rcar_du_remove(struct platform_device *pdev) struct rcar_du_device *rcdu = platform_get_drvdata(pdev); struct drm_device *ddev = rcdu->ddev;
drm_connector_unregister_all(ddev); drm_dev_unregister(ddev);
if (rcdu->fbdev)
@@ -360,10 +359,6 @@ static int rcar_du_probe(struct platform_device *pdev) if (ret) goto error;
ret = drm_connector_register_all(ddev);
if (ret < 0)
goto error;
DRM_INFO("Device %s probed\n", dev_name(&pdev->dev));
return 0;
-- 2.8.1
Hi Chris,
Thank you for the patch.
On Friday 17 Jun 2016 09:25:23 Chris Wilson wrote:
Up to now, the recommendation was for drivers to call drm_dev_register() followed by drm_connector_register_all(). Now that drm_connector_register() is safe against multiple invocations, we can move drm_connector_register_all() to drm_dev_register() and not suffer from any backwards compatibility issues with drivers not following the more rigorous init ordering.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: David Airlie airlied@linux.ie Cc: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 48ec4b6e8b26..36d390093c92 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -278,7 +278,6 @@ static int rcar_du_remove(struct platform_device *pdev) struct rcar_du_device *rcdu = platform_get_drvdata(pdev); struct drm_device *ddev = rcdu->ddev;
drm_connector_unregister_all(ddev); drm_dev_unregister(ddev);
if (rcdu->fbdev)
@@ -360,10 +359,6 @@ static int rcar_du_probe(struct platform_device *pdev) if (ret) goto error;
ret = drm_connector_register_all(ddev);
if (ret < 0)
goto error;
DRM_INFO("Device %s probed\n", dev_name(&pdev->dev));
return 0;
dri-devel@lists.freedesktop.org