dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Lucas Stach <l.stach@pengutronix.de>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Sean Paul <seanpaul@chromium.org>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH] drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
Date: Wed, 29 Nov 2017 15:36:37 +0100	[thread overview]
Message-ID: <4d421e1a-10e5-7eeb-1374-92368d652c16@linux.intel.com> (raw)
In-Reply-To: <20171129110431.6300-1-l.stach@pengutronix.de>

Op 29-11-17 om 12:04 schreef Lucas Stach:
> drm_atomic_helper_setup_commit expects that flipping of previous commits
> has happened when it is called to set up a new commit. This can be violated
> by commits where userspace doesn't get a flip completion event to
> synchronize against i.e. legacy modesets and property changes.
>
> The expectation is that those are done by blocking commits, which wait for
> completion. Most drivers call drm_atomic_helper_wait_for_vblanks in the
> commit_tail to ensure completion, but the wait for next vblank might not
> actually happen if the commit didn't change any planes.
>
> Make the wait more agressive by also waiting if no planes changed. This
> is the minimal regression fix for the 4.15 kernel series. Long term
> drivers should switch away from drm_atomic_helper_wait_for_vblanks and
> use drm_atomic_helper_wait_for_flip_done instead.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  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 71d712f1b56a..b16f1d69a0bb 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1225,7 +1225,7 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
>  		return;
>  
>  	for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
> -		if (!new_crtc_state->active || !new_crtc_state->planes_changed)
> +		if (!new_crtc_state->active)
>  			continue;
>  
>  		ret = drm_crtc_vblank_get(crtc);

Added a fixes tag because it likely started regressing with
commit de39bec1a0c4 ("drm/atomic: Remove waits in drm_atomic_helper_commit_cleanup_done, v2.")

Thanks for patch, pushed.

~Maarten

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2017-11-29 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 11:04 [PATCH] drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive Lucas Stach
2017-11-29 14:36 ` Maarten Lankhorst [this message]

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=4d421e1a-10e5-7eeb-1374-92368d652c16@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=patchwork-lst@pengutronix.de \
    --cc=seanpaul@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox