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