All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 2/3] drm/i915: Split GEM resetting into 3 phases
Date: Tue, 7 Feb 2017 21:23:24 +0000	[thread overview]
Message-ID: <20170207212324.GK11545@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20170207211226.14029-2-chris@chris-wilson.co.uk>

On Tue, Feb 07, 2017 at 09:12:25PM +0000, Chris Wilson wrote:
> Currently we do a reset prepare/finish around the call to reset the GPU,
> but it looks like we need a later stage after the hw has been
> reinitialised to allow GEM to restart itself. Start by splitting the 2
> GEM phases into 3:
> 
>   prepare - before the reset, check if GEM recovered, then stop GEM
> 
>   reset - after the reset, update GEM bookkeeping
> 
>   finish - after the re-initialisation following the reset, restart GEM
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c |  3 ++-
>  drivers/gpu/drm/i915/i915_drv.h |  1 +
>  drivers/gpu/drm/i915/i915_gem.c | 11 ++++++++---
>  3 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index acbd772837b5..0aa4ac2b43ca 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1836,7 +1836,7 @@ void i915_reset(struct drm_i915_private *dev_priv)
>  		goto error;
>  	}
>  
> -	i915_gem_reset_finish(dev_priv);
> +	i915_gem_reset(dev_priv);
>  	intel_overlay_reset(dev_priv);
>  
>  	/* Ok, now get things going again... */
> @@ -1859,6 +1859,7 @@ void i915_reset(struct drm_i915_private *dev_priv)
>  		goto error;
>  	}
>  
> +	i915_gem_reset_finish(dev_priv);
>  	i915_queue_hangcheck(dev_priv);
>  
>  wakeup:
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0cbd289da4ba..972d35259883 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3353,6 +3353,7 @@ static inline u32 i915_reset_count(struct i915_gpu_error *error)
>  }
>  
>  int i915_gem_reset_prepare(struct drm_i915_private *dev_priv);
> +void i915_gem_reset(struct drm_i915_private *dev_priv);
>  void i915_gem_reset_finish(struct drm_i915_private *dev_priv);
>  void i915_gem_set_wedged(struct drm_i915_private *dev_priv);
>  void i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 17bcec9f1321..e125c0d61ce9 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2760,7 +2760,7 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine)
>  		engine_skip_context(request);
>  }
>  
> -void i915_gem_reset_finish(struct drm_i915_private *dev_priv)
> +void i915_gem_reset(struct drm_i915_private *dev_priv)
>  {
>  	struct intel_engine_cs *engine;
>  	enum intel_engine_id id;
> @@ -2772,8 +2772,6 @@ void i915_gem_reset_finish(struct drm_i915_private *dev_priv)
>  	for_each_engine(engine, dev_priv, id)
>  		i915_gem_reset_engine(engine);
>  
> -	i915_gem_restore_fences(dev_priv);

Restore fences has to be before the init_hw() for gen2/3 - otherwise we
may restart requests trying to access through the fences.

Imagine this patch just introduced the empty function and renamed the
pair.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-07 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 21:12 [PATCH 1/3] drm/i915: Move calling engine->init_hw() to its own function Chris Wilson
2017-02-07 21:12 ` [PATCH 2/3] drm/i915: Split GEM resetting into 3 phases Chris Wilson
2017-02-07 21:23   ` Chris Wilson [this message]
2017-02-07 21:12 ` [PATCH 3/3] drm/i915: Disable engine->irq_tasklet around resets Chris Wilson
2017-02-07 22:52 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Move calling engine->init_hw() to its own function Patchwork

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=20170207212324.GK11545@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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 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.