All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: linux-samsung-soc@vger.kernel.org,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/atomic: only run atomic_check() if crtc is active
Date: Fri, 13 Nov 2015 16:34:45 +0200	[thread overview]
Message-ID: <20151113143445.GW4437@intel.com> (raw)
In-Reply-To: <1447422358-18891-1-git-send-email-gustavo@padovan.org>

On Fri, Nov 13, 2015 at 11:45:58AM -0200, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Fixes an regression added by 3ae2436 (drm/exynos/mixer: replace
> direct cross-driver call with drm mode) and while this regression was
> caused by a change in the exynos driver it makes sense to add the
> check on atomic core to benefit other drivers as well.
> 
> The whole atomic update fails if the exynos hdmi display is not
> present/active.  Add a test to only run atomic_check() if the CRTC is
> active.

The check must be performed even when the crtc is not active.

Especially important for the (enabled && !active) case (ie. DPMS off)
since "DPMS on" must not fail, so any state change while in DPMS off
must be checked as if the crtc was active.

But even for the !enabled case we want to do the check so that
everything gets properly recomputed when fully disabling a crtc.

I suppose we might be able to get away with not checking in the
!enabled -> !enabled case. But I doubt that's really a useful
optimization.

> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  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 0c6f621..7e3cb48 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -510,6 +510,9 @@ drm_atomic_helper_check_planes(struct drm_device *dev,
>  	for_each_crtc_in_state(state, crtc, crtc_state, i) {
>  		const struct drm_crtc_helper_funcs *funcs;
>  
> +		if (!crtc_state->active)
> +			continue;
> +
>  		funcs = crtc->helper_private;
>  
>  		if (!funcs || !funcs->atomic_check)
> -- 
> 2.1.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2015-11-13 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 13:45 [PATCH] drm/atomic: only run atomic_check() if crtc is active Gustavo Padovan
2015-11-13 14:34 ` Ville Syrjälä [this message]
2015-11-13 17:33   ` Gustavo Padovan

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=20151113143445.GW4437@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.