All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Wake up all waiters for the vblank
Date: Thu, 17 Aug 2017 17:56:19 +0300	[thread overview]
Message-ID: <20170817145619.GD4914@intel.com> (raw)
In-Reply-To: <20170817122741.708-1-chris@chris-wilson.co.uk>

On Thu, Aug 17, 2017 at 01:27:41PM +0100, Chris Wilson wrote:
> As we have a single list for vblank waiters (not sorted by the vblank
> they are waiting for), make sure we wake up all waiters rather than just
> the first as we may have multiple consumers for this vblank event.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_vblank.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 70f2b9593edc..930e3ed5234b 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -1118,7 +1118,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
>  	if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset)
>  		drm_vblank_disable_and_save(dev, pipe);
>  
> -	wake_up(&vblank->queue);
> +	wake_up_all(&vblank->queue);

I don't think we have any exclusive waiters currently so this shouldn't
actually change anything. I guess given the unordered nature of vblank
waiters exclusive waiters wouldn't really work anyway.

I guess it might be a reasonable measure to avoid bugs if someone
accidentally adds eclusive waiters so
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	/*
>  	 * Prevent subsequent drm_vblank_get() from re-enabling
> @@ -1572,7 +1572,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
>  
>  	spin_unlock(&dev->vblank_time_lock);
>  
> -	wake_up(&vblank->queue);
> +	wake_up_all(&vblank->queue);
>  
>  	/* With instant-off, we defer disabling the interrupt until after
>  	 * we finish processing the following vblank after all events have
> -- 
> 2.14.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-08-17 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 12:27 [PATCH] drm: Wake up all waiters for the vblank Chris Wilson
2017-08-17 14:56 ` Ville Syrjälä [this message]
2017-08-17 15:30   ` Chris Wilson

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=20170817145619.GD4914@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.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.