Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491201 > unrolled thread

[PATCH][v2] drm/sun4i: rgb: Enable panel after controller

Started byJonathan Liu <net147@gmail.com>
First post2016-09-26 12:30 +0200
Last post2016-09-28 23:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH][v2] drm/sun4i: rgb: Enable panel after controller Jonathan Liu <net147@gmail.com> - 2016-09-26 12:30 +0200
    Re: [PATCH][v2] drm/sun4i: rgb: Enable panel after controller Sean Paul <seanpaul@google.com> - 2016-09-27 18:10 +0200
    Re: [PATCH][v2] drm/sun4i: rgb: Enable panel after controller Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-09-28 23:20 +0200

#1491201 — [PATCH][v2] drm/sun4i: rgb: Enable panel after controller

FromJonathan Liu <net147@gmail.com>
Date2016-09-26 12:30 +0200
Subject[PATCH][v2] drm/sun4i: rgb: Enable panel after controller
Message-ID<slBkC-2G3-19@gated-at.bofh.it>
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>
---
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(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index c3ff10f..4e4bea6 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)
 
 	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

[toc] | [next] | [standalone]


#1492006

FromSean Paul <seanpaul@google.com>
Date2016-09-27 18:10 +0200
Message-ID<sm37c-3bm-11@gated-at.bofh.it>
In reply to#1491201
On Mon, Sep 26, 2016 at 6:21 AM, Jonathan Liu <net147@gmail.com> wrote:
> 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>

Cool, this makes much more sense.

Reviewed-by: Sean Paul <seanpaul@chromium.org>


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


Sean


> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> index c3ff10f..4e4bea6 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)
>
>         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
>

[toc] | [prev] | [next] | [standalone]


#1492956

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-09-28 23:20 +0200
Message-ID<smuqJ-3ym-1@gated-at.bofh.it>
In reply to#1491201

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Sep 26, 2016 at 08:21:45PM +1000, Jonathan Liu wrote:
> 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>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web