Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/6] drm/i915: Don't wait for page flips if there was GPU reset
Date: Wed, 13 Feb 2013 18:09:48 +0100	[thread overview]
Message-ID: <20130213170947.GN5813@phenom.ffwll.local> (raw)
In-Reply-To: <20130213165229.GP9135@intel.com>

On Wed, Feb 13, 2013 at 06:52:29PM +0200, Ville Syrjälä wrote:
> On Wed, Feb 13, 2013 at 04:23:27PM +0100, Daniel Vetter wrote:
> > On Tue, Jan 29, 2013 at 06:13:34PM +0200, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > If a GPU reset occurs while a page flip has been submitted to the ring,
> > > the flip will never complete once the ring has been reset.
> > > 
> > > The GPU reset can be detected by sampling the reset_counter before the
> > > flip is submitted, and then while waiting for the flip, the sampled
> > > counter is compared with the current reset_counter value.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_display.c | 14 +++++++++++++-
> > >  drivers/gpu/drm/i915/intel_drv.h     |  3 +++
> > >  2 files changed, 16 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index 4097118..e348a68 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -2862,10 +2862,12 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
> > >  {
> > >  	struct drm_device *dev = crtc->dev;
> > >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > > +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > >  	unsigned long flags;
> > >  	bool pending;
> > >  
> > > -	if (i915_reset_in_progress(&dev_priv->gpu_error))
> > > +	if (i915_reset_in_progress(&dev_priv->gpu_error) ||
> > > +	    intel_crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
> > >  		return false;
> > >  
> > >  	spin_lock_irqsave(&dev->event_lock, flags);
> > > @@ -6912,6 +6914,8 @@ static int intel_gen2_queue_flip(struct drm_device *dev,
> > >  	if (ret)
> > >  		goto err_unpin;
> > >  
> > > +	intel_crtc->reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
> > 
> > Ok no bikeshed about ->reset_counter, but a different one: Why does this
> > need to be in the per-gen callback? Can't we just grab this before we call
> > down into these callbacks? Imo races wrt the reset/hang code don't matter
> > that much as long as we don't wait forever for a pageflip which won't
> > happen. Hanging the gpu concurrently to pageflipping is undefined anyway
> > right now ...
> 
> Yeah. It could be moved to happen a little earlier, and thus avoid the
> duplication.

Applied the patch and moved the assignment around a bit, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-02-13 17:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 16:13 [PATCH 0/6] drm/i915: Avoid stuck page flip waiters on GPU reset ville.syrjala
2013-01-29 16:13 ` [PATCH 1/6] drm/i915: Kill obj->pending_flip ville.syrjala
2013-02-13 10:16   ` Damien Lespiau
2013-02-13 16:13     ` Daniel Vetter
2013-01-29 16:13 ` [PATCH 2/6] drm/i915: Don't wait for page flips if there was GPU reset ville.syrjala
2013-02-13 10:23   ` Damien Lespiau
2013-02-13 10:51     ` Ville Syrjälä
2013-02-13 11:49       ` Daniel Vetter
2013-02-13 15:23   ` Daniel Vetter
2013-02-13 16:52     ` Ville Syrjälä
2013-02-13 17:09       ` Daniel Vetter [this message]
2013-01-29 16:13 ` [PATCH 3/6] drm/i915: Wake up pending_flip_queue as part of reset handling ville.syrjala
2013-02-13 10:24   ` Damien Lespiau
2013-02-13 15:31   ` Daniel Vetter
2013-01-29 16:13 ` [PATCH 4/6] drm/i915: Move intel_crtc_has_pending_flip() earlier ville.syrjala
2013-02-13 10:27   ` Damien Lespiau
2013-01-29 16:13 ` [PATCH 5/6] drm/i915: Add intel_crtc_wait_for_pending_flips_locked() ville.syrjala
2013-02-13 10:37   ` Damien Lespiau
2013-01-29 16:13 ` [PATCH 6/6] drm/i915: Really wait for pending flips in intel_pipe_set_base() ville.syrjala
2013-02-13 10:40   ` Damien Lespiau
2013-02-13 15:49   ` Daniel Vetter
2013-02-13 17:06     ` Ville Syrjälä
2013-02-13 17:11       ` Daniel Vetter
2013-02-13 17:26         ` Ville Syrjälä
2013-02-13 17:31           ` Daniel Vetter
2013-02-13 17:39         ` Chris Wilson
2013-01-29 16:39 ` [PATCH 0/6] drm/i915: Avoid stuck page flip waiters on GPU reset Daniel Vetter
2013-01-29 16:40   ` 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=20130213170947.GN5813@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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