[Intel-gfx] [PATCH v2 7/9] drm/atmel-hlcdc: Remove custom FB helper deferred setup

Thierry Reding thierry.reding at gmail.com
Tue Jun 7 15:26:23 UTC 2016


From: Thierry Reding <treding at nvidia.com>

The FB helper core now supports deferred setup, so the driver's custom
implementation can be removed.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 8ded7645747e..a8a855910885 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -431,15 +431,7 @@ static void atmel_hlcdc_fb_output_poll_changed(struct drm_device *dev)
 {
 	struct atmel_hlcdc_dc *dc = dev->dev_private;
 
-	if (dc->fbdev) {
-		drm_fbdev_cma_hotplug_event(dc->fbdev);
-	} else {
-		dc->fbdev = drm_fbdev_cma_init(dev, 24,
-				dev->mode_config.num_crtc,
-				dev->mode_config.num_connector);
-		if (IS_ERR(dc->fbdev))
-			dc->fbdev = NULL;
-	}
+	drm_fbdev_cma_hotplug_event(dc->fbdev);
 }
 
 struct atmel_hlcdc_dc_commit {
@@ -654,11 +646,23 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev)
 
 	drm_kms_helper_poll_init(dev);
 
-	/* force connectors detection */
-	drm_helper_hpd_irq_event(dev);
+	dc->fbdev = drm_fbdev_cma_init(dev, 24, dev->mode_config.num_crtc,
+				       dev->mode_config.num_connector);
+	if (IS_ERR(dc->fbdev)) {
+		dev_err(dev->dev, "failed to setup fbdev\n");
+		ret = PTR_ERR(dc->fbdev);
+		goto err_cleanup_poll;
+	}
 
 	return 0;
 
+err_cleanup_poll:
+	drm_kms_helper_poll_fini(dev);
+
+	pm_runtime_get_sync(dev->dev);
+	drm_irq_uninstall(dev);
+	pm_runtime_put_sync(dev->dev);
+
 err_periph_clk_disable:
 	pm_runtime_disable(dev->dev);
 	clk_disable_unprepare(dc->hlcdc->periph_clk);
-- 
2.8.3



More information about the Intel-gfx mailing list