All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Assert we idle in the kernel context
Date: Fri, 01 Jun 2018 12:13:12 +0300	[thread overview]
Message-ID: <87in727tuf.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180531224057.6036-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Now that we always switch to the kernel context upon idling, we can
> make that assertion.
>
> References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index f5c4ef052001..66bb81cd43cd 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3498,6 +3498,22 @@ new_requests_since_last_retire(const struct drm_i915_private *i915)
>  		work_pending(&i915->gt.idle_work.work));
>  }
>  
> +static void assert_kernel_context_is_current(struct drm_i915_private *i915)
> +{
> +	struct intel_engine_cs *engine;
> +	enum intel_engine_id id;
> +
> +	if (i915_terminally_wedged(&i915->gpu_error))
> +		return;
> +
> +	GEM_BUG_ON(i915->gt.active_requests);
> +	for_each_engine(engine, i915, id) {
> +		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
> +		GEM_BUG_ON(engine->last_retired_context !=
> +			   to_intel_context(i915->kernel_context, engine));
> +	}
> +}
> +
>  static void
>  i915_gem_idle_work_handler(struct work_struct *work)
>  {
> @@ -3558,6 +3574,8 @@ i915_gem_idle_work_handler(struct work_struct *work)
>  	if (new_requests_since_last_retire(dev_priv))
>  		goto out_unlock;
>  
> +	assert_kernel_context_is_current(dev_priv);
> +
>  	epoch = __i915_gem_park(dev_priv);
>  
>  	rearm_hangcheck = false;
> @@ -4944,19 +4962,6 @@ void __i915_gem_object_release_unless_active(struct drm_i915_gem_object *obj)
>  		i915_gem_object_put(obj);
>  }
>  
> -static void assert_kernel_context_is_current(struct drm_i915_private *i915)
> -{
> -	struct i915_gem_context *kctx = i915->kernel_context;
> -	struct intel_engine_cs *engine;
> -	enum intel_engine_id id;
> -
> -	GEM_BUG_ON(i915->gt.active_requests);
> -	for_each_engine(engine, i915, id) {
> -		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
> -		GEM_BUG_ON(engine->last_retired_context->gem_context != kctx);
> -	}
> -}
> -
>  void i915_gem_sanitize(struct drm_i915_private *i915)
>  {
>  	struct intel_engine_cs *engine;
> -- 
> 2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2018-06-01  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
2018-05-31 22:57 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-05-31 23:17 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-01  0:10 ` ✓ Fi.CI.IGT: " Patchwork
2018-06-01  9:13 ` Mika Kuoppala [this message]

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=87in727tuf.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@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 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.