]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drm/fsl-dcu: disable planes before disabling CRTC
authorStefan Agner <stefan@agner.ch>
Mon, 31 Oct 2016 16:51:19 +0000 (09:51 -0700)
committerStefan Agner <stefan@agner.ch>
Wed, 9 Nov 2016 01:14:08 +0000 (17:14 -0800)
After disabling and reenabling the CRTC the DCU sometimes got stuck
displaying the whole screen with a solid color. Disabling and
reenabling the CRTC did not recover from the situation. This was
often reproducable by just restarting the X-Server.

The disabling sequence is not explicitly documented. But it turns
out that disabling the planes before disabling the CRTC seems to
prevent the above situation from happening.

Use the callback ->atomic_disable instead of ->disable which allows
to use the drm_atomic_helper_disable_planes_on_crtc() helper to
disable planes before disabling the controller.

Signed-off-by: Stefan Agner <stefan@agner.ch>
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c

index 2ea9dbd9be302fe1f251ffe99b8aab5b9bedcbcb..deb57435cc89736e5531e411ef12bcbe8f4d35a1 100644 (file)
@@ -44,11 +44,15 @@ static void fsl_dcu_drm_crtc_atomic_flush(struct drm_crtc *crtc,
        }
 }
 
-static void fsl_dcu_drm_disable_crtc(struct drm_crtc *crtc)
+static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc,
+                                       struct drm_crtc_state *old_crtc_state)
 {
        struct drm_device *dev = crtc->dev;
        struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
 
+       /* always disable planes on the CRTC */
+       drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true);
+
        drm_crtc_vblank_off(crtc);
 
        regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,
@@ -127,8 +131,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 }
 
 static const struct drm_crtc_helper_funcs fsl_dcu_drm_crtc_helper_funcs = {
+       .atomic_disable = fsl_dcu_drm_crtc_atomic_disable,
        .atomic_flush = fsl_dcu_drm_crtc_atomic_flush,
-       .disable = fsl_dcu_drm_disable_crtc,
        .enable = fsl_dcu_drm_crtc_enable,
        .mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
 };