intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Force the switch to the i915->kernel_context
Date: Thu, 02 Nov 2017 15:45:27 +0200	[thread overview]
Message-ID: <1509630327.27999.5.camel@linux.intel.com> (raw)
In-Reply-To: <20171102124226.30086-2-chris@chris-wilson.co.uk>

On Thu, 2017-11-02 at 12:42 +0000, Chris Wilson wrote:
> In the next few patches, we will have a hard requirement that we emit a
> context-switch to the perma-pinned i915->kernel_context (so that we can
> save the HW state using that context-switch). As the first context
> itself may be classed as a kernel context, we want to be explicit in our
> comparison. For an extra-layer of finesse, we can check the last
> unretired context on the engine; as well as the last retired context
> when idle.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> @@ -1587,8 +1587,20 @@ bool intel_engines_are_idle(struct drm_i915_private *dev_priv)
>  
>  bool intel_engine_has_kernel_context(const struct intel_engine_cs *engine)
>  {
> -	return (!engine->last_retired_context ||
> -		i915_gem_context_is_kernel(engine->last_retired_context));
> +	const struct i915_gem_context *kctx = engine->i915->kernel_context;

*kernel_context = ...

> +	struct drm_i915_gem_request *rq;
> +
> +	lockdep_assert_held(&engine->i915->drm.struct_mutex);
> +
> +	/* An unretired request? */
> +	rq = __i915_gem_active_peek(&engine->timeline->last_request);
> +	if (rq)
> +		return rq->ctx == kctx;
> +
> +	if (!engine->last_retired_context)
> +		return true;
> +
> +	return engine->last_retired_context == kctx;

It might be worthy dropping a comment that a nonexistent context is
considered kernel context to the *cough*nonexistent*cough* kerneldoc.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-02 13:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 12:42 Context isolation Chris Wilson
2017-11-02 12:42 ` [PATCH 1/6] drm/i915: Force the switch to the i915->kernel_context Chris Wilson
2017-11-02 13:45   ` Joonas Lahtinen [this message]
2017-11-02 15:40   ` Mika Kuoppala
2017-11-02 15:45     ` Chris Wilson
2017-11-02 12:42 ` [PATCH 2/6] drm/i915: Move GT powersaving init to i915_gem_init() Chris Wilson
2017-11-02 13:46   ` Joonas Lahtinen
2017-11-02 14:35   ` Sagar Arun Kamble
2017-11-02 14:55     ` Chris Wilson
2017-11-02 15:38       ` Sagar Arun Kamble
2017-11-02 12:42 ` [PATCH 3/6] drm/i915: Inline intel_modeset_gem_init() Chris Wilson
2017-11-02 13:47   ` Joonas Lahtinen
2017-11-02 12:42 ` [PATCH 4/6] drm/i915: Record the default hw state after reset upon load Chris Wilson
2017-11-02 13:56   ` Mika Kuoppala
2017-11-02 14:10     ` Chris Wilson
2017-11-02 14:23   ` Ville Syrjälä
2017-11-02 14:37     ` Chris Wilson
2017-11-02 14:26   ` Joonas Lahtinen
2017-11-02 12:42 ` [PATCH 5/6] drm/i915: Remove redundant intel_autoenable_gt_powersave() Chris Wilson
2017-11-02 13:36   ` Joonas Lahtinen
2017-11-02 12:42 ` [PATCH 6/6] drm/i915: Stop caching the "golden" renderstate Chris Wilson
2017-11-02 14:43   ` Joonas Lahtinen
2017-11-02 14:54     ` Rodrigo Vivi
2017-11-02 14:56       ` Joonas Lahtinen
2017-11-02 22:36         ` Oscar Mateo
2017-11-02 23:34           ` Rodrigo Vivi
2017-11-02 23:36             ` Chris Wilson
2017-11-03  8:39             ` Joonas Lahtinen
2017-11-03 17:44               ` Rodrigo Vivi
2017-11-02 13:14 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] drm/i915: Force the switch to the i915->kernel_context 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=1509630327.27999.5.camel@linux.intel.com \
    --to=joonas.lahtinen@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;
as well as URLs for NNTP newsgroup(s).