public inbox for intel-gfx@lists.freedesktop.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 02/10] drm/i915: Decouple the stuck pageflip on modeset
Date: Thu, 4 Sep 2014 20:15:32 +0300	[thread overview]
Message-ID: <20140904171532.GO4193@intel.com> (raw)
In-Reply-To: <1409666265-19286-2-git-send-email-chris@chris-wilson.co.uk>

On Tue, Sep 02, 2014 at 02:57:37PM +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.
> 
> v2: Rebase after refactor
> 
> 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>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Yeah, seems better than having the flip stuck forever.

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

> ---
>  drivers/gpu/drm/i915/intel_display.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 18c431e4f099..bbc3d509bcd7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3434,9 +3434,19 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
>  	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");
> +			page_flip_completed(intel_crtc);
> +		}
> +		spin_unlock_irqrestore(&dev->event_lock, flags);
> +	}
>  
>  	if (crtc->primary->fb) {
>  		mutex_lock(&dev->struct_mutex);
> -- 
> 2.1.0

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-09-04 17:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 13:57 [PATCH 01/10] drm/i915: Check for a stalled page flip after each vblank Chris Wilson
2014-09-02 13:57 ` [PATCH 02/10] drm/i915: Decouple the stuck pageflip on modeset Chris Wilson
2014-09-04 17:15   ` Ville Syrjälä [this message]
2014-09-05  7:27     ` Daniel Vetter
2014-09-05  7:31       ` Chris Wilson
2014-09-05  8:51         ` Daniel Vetter
2014-09-02 13:57 ` [PATCH 03/10] drm/i915: Boost GPU frequency if we detect outstanding pageflips Chris Wilson
2014-09-02 13:57 ` [PATCH 04/10] drm/i915: Deminish contribution of wait-boosting from clients Chris Wilson
2014-09-02 13:57 ` [PATCH 05/10] drm/i915: Relax RPS contraints to allows setting minfreq on idle Chris Wilson
2014-09-02 13:57 ` [PATCH 06/10] drm/i915: Rearrange RPS frequency calculation Chris Wilson
2014-09-02 13:57 ` [PATCH 07/10] drm/i915: Improved w/a for rps on Baytrail Chris Wilson
2014-09-02 13:57 ` [PATCH 08/10] drm/i915: Use down ei for manual Baytrail RPS calculations Chris Wilson
2014-09-02 13:57 ` [PATCH 09/10] drm/i915: Agressive downclocking on Baytrail Chris Wilson
2014-09-02 13:57 ` [PATCH 10/10] drm/i915: Move pm_rps_events to i915->rps Chris Wilson
2014-09-02 14:31 ` [PATCH 01/10] drm/i915: Check for a stalled page flip after each vblank Ville Syrjälä
2014-09-02 14:36   ` Chris Wilson
2014-09-02 14:52 ` Daniel Vetter
2014-09-02 15:07   ` 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=20140904171532.GO4193@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox