aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-01-14 10:24:56 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-01-15 05:16:15 -0500
commit4314e19ef4ae0ba8872bd8610f6fef5e8743e236 (patch)
tree0b8a4e4632dcbe267370d632215d904544f3f989
parentd122cbf1a310d962cef45c2f161b8dc3ec1475a3 (diff)
drm/fb_cma_helper: Remove implicit call to disable_unused_functions
The drm_fbdev_cma_init function always calls the drm_helper_disable_unused_functions. Since it's part of the usual probe process, all the drivers using that helper will end up having their encoder and CRTC disable functions called at probe if their device has not been reported as enabled. This could be fixed by reading out from the registers the current state of the device if it is enabled, but even that will not handle the case where the device is actually disabled. Moreover, the drivers using the atomic modesetting expect that their enable and disable callback to be called when the device is already enabled or disabled (respectively). We can however fix this issue by moving the call to drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make the drivers needing it (all the drivers calling drm_fbdev_cma_init and not using the atomic modesetting) explicitly call it. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Link: http://patchwork.freedesktop.org/patch/msgid/1452785109-6172-14-git-send-email-maxime.ripard@free-electrons.com Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_fb_cma_helper.c3
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c1
-rw-r--r--drivers/gpu/drm/sti/sti_drv.c1
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_drv.c1
4 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 5543fa806aec..c895b6fddbd8 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -348,9 +348,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
348 348
349 } 349 }
350 350
351 /* disable all the possible outputs/crtcs before entering KMS mode */
352 drm_helper_disable_unused_functions(dev);
353
354 ret = drm_fb_helper_initial_config(helper, preferred_bpp); 351 ret = drm_fb_helper_initial_config(helper, preferred_bpp);
355 if (ret < 0) { 352 if (ret < 0) {
356 dev_err(dev->dev, "Failed to set initial hw configuration.\n"); 353 dev_err(dev->dev, "Failed to set initial hw configuration.\n");
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 7be7ac808304..2f57d7967417 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -305,6 +305,7 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
305 dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n"); 305 dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
306 legacyfb_depth = 16; 306 legacyfb_depth = 16;
307 } 307 }
308 drm_helper_disable_unused_functions(drm);
308 imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, 309 imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth,
309 drm->mode_config.num_crtc, MAX_CRTC); 310 drm->mode_config.num_crtc, MAX_CRTC);
310 if (IS_ERR(imxdrm->fbhelper)) { 311 if (IS_ERR(imxdrm->fbhelper)) {
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 1469987949d8..506b5626f3ed 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -160,6 +160,7 @@ static int sti_load(struct drm_device *dev, unsigned long flags)
160 160
161 drm_mode_config_reset(dev); 161 drm_mode_config_reset(dev);
162 162
163 drm_helper_disable_unused_functions(dev);
163 drm_fbdev_cma_init(dev, 32, 164 drm_fbdev_cma_init(dev, 32,
164 dev->mode_config.num_crtc, 165 dev->mode_config.num_crtc,
165 dev->mode_config.num_connector); 166 dev->mode_config.num_connector);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 4ddb21e7f52f..d7f5b897c6c5 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -294,6 +294,7 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
294 break; 294 break;
295 } 295 }
296 296
297 drm_helper_disable_unused_functions(dev);
297 priv->fbdev = drm_fbdev_cma_init(dev, bpp, 298 priv->fbdev = drm_fbdev_cma_init(dev, bpp,
298 dev->mode_config.num_crtc, 299 dev->mode_config.num_crtc,
299 dev->mode_config.num_connector); 300 dev->mode_config.num_connector);