0435-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From f63b6059c6129d81d3fc85b02d9b83b85023c437 Mon Sep 17 00:00:00 2001
  2. From: Maxime Ripard <maxime.ripard@free-electrons.com>
  3. Date: Thu, 14 Jan 2016 16:24:56 +0100
  4. Subject: [PATCH] drm/fb_cma_helper: Remove implicit call to
  5. disable_unused_functions
  6. The drm_fbdev_cma_init function always calls the
  7. drm_helper_disable_unused_functions. Since it's part of the usual probe
  8. process, all the drivers using that helper will end up having their encoder
  9. and CRTC disable functions called at probe if their device has not been
  10. reported as enabled.
  11. This could be fixed by reading out from the registers the current state of
  12. the device if it is enabled, but even that will not handle the case where
  13. the device is actually disabled.
  14. Moreover, the drivers using the atomic modesetting expect that their enable
  15. and disable callback to be called when the device is already enabled or
  16. disabled (respectively).
  17. We can however fix this issue by moving the call to
  18. drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make the
  19. drivers needing it (all the drivers calling drm_fbdev_cma_init and not
  20. using the atomic modesetting) explicitly call it.
  21. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  22. Link: http://patchwork.freedesktop.org/patch/msgid/1452785109-6172-14-git-send-email-maxime.ripard@free-electrons.com
  23. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  24. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  25. (cherry picked from commit 4314e19ef4ae0ba8872bd8610f6fef5e8743e236)
  26. ---
  27. drivers/gpu/drm/drm_fb_cma_helper.c | 3 ---
  28. drivers/gpu/drm/imx/imx-drm-core.c | 1 +
  29. drivers/gpu/drm/sti/sti_drv.c | 1 +
  30. drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 +
  31. 4 files changed, 3 insertions(+), 3 deletions(-)
  32. --- a/drivers/gpu/drm/drm_fb_cma_helper.c
  33. +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
  34. @@ -348,9 +348,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init
  35. }
  36. - /* disable all the possible outputs/crtcs before entering KMS mode */
  37. - drm_helper_disable_unused_functions(dev);
  38. -
  39. ret = drm_fb_helper_initial_config(helper, preferred_bpp);
  40. if (ret < 0) {
  41. dev_err(dev->dev, "Failed to set initial hw configuration.\n");
  42. --- a/drivers/gpu/drm/imx/imx-drm-core.c
  43. +++ b/drivers/gpu/drm/imx/imx-drm-core.c
  44. @@ -313,6 +313,7 @@ static int imx_drm_driver_load(struct dr
  45. dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
  46. legacyfb_depth = 16;
  47. }
  48. + drm_helper_disable_unused_functions(drm);
  49. imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth,
  50. drm->mode_config.num_crtc, MAX_CRTC);
  51. if (IS_ERR(imxdrm->fbhelper)) {
  52. --- a/drivers/gpu/drm/sti/sti_drv.c
  53. +++ b/drivers/gpu/drm/sti/sti_drv.c
  54. @@ -160,6 +160,7 @@ static int sti_load(struct drm_device *d
  55. drm_mode_config_reset(dev);
  56. + drm_helper_disable_unused_functions(dev);
  57. drm_fbdev_cma_init(dev, 32,
  58. dev->mode_config.num_crtc,
  59. dev->mode_config.num_connector);
  60. --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
  61. +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
  62. @@ -294,6 +294,7 @@ static int tilcdc_load(struct drm_device
  63. break;
  64. }
  65. + drm_helper_disable_unused_functions(dev);
  66. priv->fbdev = drm_fbdev_cma_init(dev, bpp,
  67. dev->mode_config.num_crtc,
  68. dev->mode_config.num_connector);