]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/sun4i: rgb: Enable panel after controller
authorJonathan Liu <net147@gmail.com>
Mon, 26 Sep 2016 10:21:45 +0000 (20:21 +1000)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Sun, 16 Oct 2016 12:32:23 +0000 (14:32 +0200)
The panel should be enabled after the controller so that we do not have
visual glitches on the panel while the controller is setup. Similarly,
the panel should be disabled before the controller.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_rgb.c

index c3ff10f559cc4811755f764d6ebbfd999a8ee7e9..4e4bea6f395cfcb748748c0d1c5acb98780724ed 100644 (file)
@@ -152,15 +152,16 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
 
        DRM_DEBUG_DRIVER("Enabling RGB output\n");
 
-       if (!IS_ERR(tcon->panel)) {
+       if (!IS_ERR(tcon->panel))
                drm_panel_prepare(tcon->panel);
-               drm_panel_enable(tcon->panel);
-       }
 
        /* encoder->bridge can be NULL; drm_bridge_enable checks for it */
        drm_bridge_enable(encoder->bridge);
 
        sun4i_tcon_channel_enable(tcon, 0);
+
+       if (!IS_ERR(tcon->panel))
+               drm_panel_enable(tcon->panel);
 }
 
 static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
@@ -171,15 +172,16 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
 
        DRM_DEBUG_DRIVER("Disabling RGB output\n");
 
+       if (!IS_ERR(tcon->panel))
+               drm_panel_disable(tcon->panel);
+
        sun4i_tcon_channel_disable(tcon, 0);
 
        /* encoder->bridge can be NULL; drm_bridge_disable checks for it */
        drm_bridge_disable(encoder->bridge);
 
-       if (!IS_ERR(tcon->panel)) {
-               drm_panel_disable(tcon->panel);
+       if (!IS_ERR(tcon->panel))
                drm_panel_unprepare(tcon->panel);
-       }
 }
 
 static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder,