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>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset
Date: Fri, 24 Oct 2014 15:50:16 +0300	[thread overview]
Message-ID: <20141024125016.GB4284@intel.com> (raw)
In-Reply-To: <20141024124035.GA24617@nuc-i3427.alporthouse.com>

On Fri, Oct 24, 2014 at 01:40:35PM +0100, Chris Wilson wrote:
> On Wed, May 28, 2014 at 01:10:55PM +0100, Chris Wilson wrote:
> > On Tue, May 27, 2014 at 09:33:09PM +0300, ville.syrjala@linux.intel.com wrote:
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index 94ac51f..cb9dd8e 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -8895,6 +8895,10 @@ static bool page_flip_finished(struct intel_crtc *crtc)
> > >  	struct drm_device *dev = crtc->base.dev;
> > >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > >  
> > > +	if (i915_reset_in_progress(&dev_priv->gpu_error) ||
> > > +	    crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
> > > +		return true;
> > 
> > I really don't like this. The reset_count is incremented when the reset
> > starts, so we shouldn't get here with
> > crtc->reset_counter == gpu_error->reset_counter && reset_in_progress().
> > 
> > I'd prefer this to be
> >  if (i915_has_reset(dev_priv, crtc->reset_counter)) return true;
> > 
> > with a guard when reading the gpu reset_counter:
> > 
> >  ret = i915_get_reset_counter(dev_priv, &intel_crtc->reset_counter);
> >  if (ret)
> > 	goto cleanup;
> > 
> > that does something like
> > 
> >  static inline int i915_get_reset_counter(struct drm_i915_private *dev_priv,
> >                                           int *value)
> >  {
> >      *value = atomic_read(dev_priv->gpu_error.reset_counter);
> >      if (*value & I915_WEDGED)
> >      	return -EIO;
> >      if (*value & I915_RESET_IN_PROGRESS_FLAG)
> >         return -EAGAIN;
> >      return 0;
> >   }
> 
> Bleh, I've seen the light and this is overly complicated and doesn't
> actually help make the code more readable than
> 
> if (intel_crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
> 	return true;
> 
> The original patch is
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks. I think we need cc:stable on this now.

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-10-24 12:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 18:33 [PATCH] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset ville.syrjala
2014-05-27 18:33 ` [PATCH igt] tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURF ville.syrjala
2014-05-28 12:10 ` [PATCH] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset Chris Wilson
2014-10-24 12:40   ` Chris Wilson
2014-10-24 12:50     ` Ville Syrjälä [this message]
2014-10-24 14:28 ` Daniel Vetter
2014-10-24 14:39   ` Ville Syrjälä
2014-11-21  7:43   ` Jani Nikula

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=20141024125016.GB4284@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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