dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Liu Ying <gnuiyl@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/atomic-helper: Do not call ->mode_fixup for CRTC which will be disabled
Date: Mon, 30 May 2016 10:46:31 +0200	[thread overview]
Message-ID: <20160530084631.GB27098@phenom.ffwll.local> (raw)
In-Reply-To: <1464341754-7087-1-git-send-email-gnuiyl@gmail.com>

On Fri, May 27, 2016 at 05:35:54PM +0800, Liu Ying wrote:
> When a CRTC is going to be disabled, it's state may contain a display mode
> with zeroed content.  This could be reproduced by HDMI cable hotplug out
> operation with legacy fbdev support in dual display cases.  It would confuse
> driver's CRTC callback ->mode_fixup and make the total state be rejected.
> So, let's don't call the callback for the CRTC.
> 
> Signed-off-by: Liu Ying <gnuiyl@gmail.com>

Indeed this matches behaviour for encoder/bridge mode_fixup functions.
Patch merged to drm-misc.

A doc patch for the kernel doc of all the mode_fixup (and the encoder's
atomic_check) that this is only called when enabling a mode would be
awesome.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index ddfa0d1..939df90 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -414,6 +414,9 @@ mode_fixup(struct drm_atomic_state *state)
>  	for_each_crtc_in_state(state, crtc, crtc_state, i) {
>  		const struct drm_crtc_helper_funcs *funcs;
>  
> +		if (!crtc_state->enable)
> +			continue;
> +
>  		if (!crtc_state->mode_changed &&
>  		    !crtc_state->connectors_changed)
>  			continue;
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-30  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  9:35 [PATCH] drm/atomic-helper: Do not call ->mode_fixup for CRTC which will be disabled Liu Ying
2016-05-30  8:46 ` Daniel Vetter [this message]
2016-05-30  9:59   ` Ying Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160530084631.GB27098@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnuiyl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox