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@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: Decouple the stuck pageflip on modeset
Date: Mon, 9 Jun 2014 16:09:02 +0300	[thread overview]
Message-ID: <20140609130902.GQ27580@intel.com> (raw)
In-Reply-To: <1401466596-30185-2-git-send-email-chris@chris-wilson.co.uk>

On Fri, May 30, 2014 at 05:16:35PM +0100, Chris Wilson wrote:
> If we successfully confuse the hardware, and cause it to drop a queued
> pageflip, we wait for 60s and issue a warning before continuing on with
> the modeset. However, this leaves the pending pageflip still stuck
> indefinitely. Pretend to userspace that it does complete, and let us
> start afresh following the modeset.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 764b277e5937..54b69838e2de 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3329,9 +3329,21 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
>  
>  	WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
>  
> -	WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> -				   !intel_crtc_has_pending_flip(crtc),
> -				   60*HZ) == 0);
> +	if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> +				       !intel_crtc_has_pending_flip(crtc),
> +				       60*HZ) == 0)) {
> +		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +		unsigned long flags;
> +
> +		spin_lock_irqsave(&dev->event_lock, flags);
> +		if (intel_crtc->unpin_work) {
> +			WARN_ONCE(1, "Removing stuck page flip\n");
> +			drm_vblank_put(dev, intel_crtc->pipe);
> +			page_flip_completed(dev_priv, intel_crtc, intel_crtc->unpin_work);
> +			intel_crtc->unpin_work = NULL;
> +		}
> +		spin_unlock_irqrestore(&dev->event_lock, flags);
> +	}

Seems like a decent idea.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Though my comment (to the other patch) about moving drm_vblank_put()
into page_flip_completed() still seems valid.

>  
>  	mutex_lock(&dev->struct_mutex);
>  	intel_finish_fb(crtc->primary->fb);
> -- 
> 2.0.0.rc4

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-06-09 13:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-30 16:16 [PATCH 1/3] drm/i915: Check for a stalled page flip after each vblank Chris Wilson
2014-05-30 16:16 ` [PATCH 2/3] drm/i915: Decouple the stuck pageflip on modeset Chris Wilson
2014-06-09 13:09   ` Ville Syrjälä [this message]
2014-05-30 16:16 ` [PATCH 3/3] drm/i915: Boost GPU frequency if we detect outstanding pageflips Chris Wilson
2014-06-02  8:53   ` Daniel Vetter
2014-06-02 11:29     ` Chris Wilson
2014-06-09 13:06 ` [PATCH 1/3] drm/i915: Check for a stalled page flip after each vblank Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2014-06-10 10:04 Chris Wilson
2014-06-10 10:04 ` [PATCH 2/3] drm/i915: Decouple the stuck pageflip on modeset Chris Wilson
2014-06-10 11:29   ` Ville Syrjälä
2014-06-10 12:46 [PATCH 1/3] drm/i915: Check for a stalled page flip after each vblank Chris Wilson
2014-06-10 12:46 ` [PATCH 2/3] drm/i915: Decouple the stuck pageflip on modeset Chris Wilson
2014-06-17 21:33   ` Daniel Vetter

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=20140609130902.GQ27580@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@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.