diff mbox

[2/2] drm/atomic: shutdown *current* encoder

Message ID 1416516907-29440-2-git-send-email-robdclark@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rob Clark Nov. 20, 2014, 8:55 p.m. UTC
In disable_outputs() we need to shut down the outgoing encoder, not the
incoming one (we have already swapped-state at this point).  Without
this, we end up telling the driver to crtc->dpms(OFF) without first
encoder->dpms(OFF), and that makes some hw quite unhappy.

Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Nov. 20, 2014, 9:45 p.m. UTC | #1
On Thu, Nov 20, 2014 at 03:55:07PM -0500, Rob Clark wrote:
> In disable_outputs() we need to shut down the outgoing encoder, not the
> incoming one (we have already swapped-state at this point).  Without
> this, we end up telling the driver to crtc->dpms(OFF) without first
> encoder->dpms(OFF), and that makes some hw quite unhappy.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 5ae5b25..8e4f3fc 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -502,7 +502,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
>  		if (!old_conn_state || !old_conn_state->crtc)
>  			continue;
>  
> -		encoder = connector->state->best_encoder;
> +		encoder = old_conn_state->best_encoder;
>  
>  		if (!encoder)

I wanted a if (WARN_ON(!encoder)) here for my r-b, since this really
shouldn't ever happen. And these kinds of cross-checks tend to be useful
ime.
-Daniel

>  			continue;
> -- 
> 1.9.3
>
Rob Clark Nov. 20, 2014, 9:46 p.m. UTC | #2
On Thu, Nov 20, 2014 at 3:55 PM, Rob Clark <robdclark@gmail.com> wrote:
> In disable_outputs() we need to shut down the outgoing encoder, not the
> incoming one (we have already swapped-state at this point).  Without
> this, we end up telling the driver to crtc->dpms(OFF) without first
> encoder->dpms(OFF), and that makes some hw quite unhappy.
>

bleh, missed a hunk that added a WARN_ON()..  will resend this

> Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 5ae5b25..8e4f3fc 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -502,7 +502,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
>                 if (!old_conn_state || !old_conn_state->crtc)
>                         continue;
>
> -               encoder = connector->state->best_encoder;
> +               encoder = old_conn_state->best_encoder;
>
>                 if (!encoder)
>                         continue;
> --
> 1.9.3
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5ae5b25..8e4f3fc 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -502,7 +502,7 @@  disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 		if (!old_conn_state || !old_conn_state->crtc)
 			continue;
 
-		encoder = connector->state->best_encoder;
+		encoder = old_conn_state->best_encoder;
 
 		if (!encoder)
 			continue;