Skip to contentSkip to conversation

drm/sun4i: rgb: Enable panel after controller

PATCH Applied Jonathan Liu 3 participants 3 messages Sep 26, 2016 – Sep 28, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
Changes in v2:
- Changed the commit message to be clearer

 drivers/gpu/drm/sun4i/sun4i_rgb.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/sun4i/sun4i_rgb.c +8 -6
index c3ff10f..4e4bea6 100644
@@ -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,
Signature · 1 line
2.10.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Jonathan Liu

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.

Cool, this makes much more sense.

I still think there's a problem with the bridge ops, though.

Sean

Quoted 54 lines

---
Changes in v2:
- Changed the commit message to be clearer

 drivers/gpu/drm/sun4i/sun4i_rgb.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/sun4i/sun4i_rgb.c +8 -7
index c3ff10f..4e4bea6 100644
@@ -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,
--

2.10.0

#2 lore raw
In reply to Jonathan Liu

Hi,

Quoted 5 lines · Jonathan Liu

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.

Applied, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160928/2e997576/attachment-0001.sig>