aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2016-09-26 06:21:45 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2016-10-16 08:32:23 -0400
commit5647b25c3335a25ba32d73e61850a374a708788a (patch)
treef9976bba0e40039c1532dc6bcf636866ae7496a8
parent1001354ca34179f3db924eb66672442a173147dc (diff)
drm/sun4i: rgb: Enable panel after controller
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>
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_rgb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index c3ff10f559cc..4e4bea6f395c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -152,15 +152,16 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
152 152
153 DRM_DEBUG_DRIVER("Enabling RGB output\n"); 153 DRM_DEBUG_DRIVER("Enabling RGB output\n");
154 154
155 if (!IS_ERR(tcon->panel)) { 155 if (!IS_ERR(tcon->panel))
156 drm_panel_prepare(tcon->panel); 156 drm_panel_prepare(tcon->panel);
157 drm_panel_enable(tcon->panel);
158 }
159 157
160 /* encoder->bridge can be NULL; drm_bridge_enable checks for it */ 158 /* encoder->bridge can be NULL; drm_bridge_enable checks for it */
161 drm_bridge_enable(encoder->bridge); 159 drm_bridge_enable(encoder->bridge);
162 160
163 sun4i_tcon_channel_enable(tcon, 0); 161 sun4i_tcon_channel_enable(tcon, 0);
162
163 if (!IS_ERR(tcon->panel))
164 drm_panel_enable(tcon->panel);
164} 165}
165 166
166static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder) 167static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
@@ -171,15 +172,16 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
171 172
172 DRM_DEBUG_DRIVER("Disabling RGB output\n"); 173 DRM_DEBUG_DRIVER("Disabling RGB output\n");
173 174
175 if (!IS_ERR(tcon->panel))
176 drm_panel_disable(tcon->panel);
177
174 sun4i_tcon_channel_disable(tcon, 0); 178 sun4i_tcon_channel_disable(tcon, 0);
175 179
176 /* encoder->bridge can be NULL; drm_bridge_disable checks for it */ 180 /* encoder->bridge can be NULL; drm_bridge_disable checks for it */
177 drm_bridge_disable(encoder->bridge); 181 drm_bridge_disable(encoder->bridge);
178 182
179 if (!IS_ERR(tcon->panel)) { 183 if (!IS_ERR(tcon->panel))
180 drm_panel_disable(tcon->panel);
181 drm_panel_unprepare(tcon->panel); 184 drm_panel_unprepare(tcon->panel);
182 }
183} 185}
184 186
185static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder, 187static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder,