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 v2 2/9] drm/i915: Force the switch to the i915->kernel_context
Date: Fri, 03 Nov 2017 16:13:14 +0200	[thread overview]
Message-ID: <87tvybcux1.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <150971806546.13980.4989758226641870683@mail.alporthouse.com>

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

> Quoting Mika Kuoppala (2017-11-03 14:03:25)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> 
>> > 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.
>> >
>> > v2: verbose verbosity
>> > v3: Always force the switch, even when the engine is idle, and update
>> > the assert that this happens before suspend.
>> >
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> > Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v1
>> > ---
>> >  drivers/gpu/drm/i915/i915_gem.c        | 10 ++++++----
>> >  drivers/gpu/drm/i915/intel_engine_cs.c | 26 ++++++++++++++++++++++++--
>> >  2 files changed, 30 insertions(+), 6 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
>> > index 9470ba0c1930..fe312ab3b664 100644
>> > --- a/drivers/gpu/drm/i915/i915_gem.c
>> > +++ b/drivers/gpu/drm/i915/i915_gem.c
>> > @@ -4687,14 +4687,16 @@ 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 *dev_priv)
>> > +static void assert_kernel_context_is_current(struct drm_i915_private *i915)
>> >  {
>> > +     struct i915_gem_context *kernel_context = i915->kernel_context;
>> >       struct intel_engine_cs *engine;
>> >       enum intel_engine_id id;
>> >  
>> > -     for_each_engine(engine, dev_priv, id)
>> > -             GEM_BUG_ON(engine->last_retired_context &&
>> > -                        !i915_gem_context_is_kernel(engine->last_retired_context));
>> > +     for_each_engine(engine, i915, id) {
>> > +             GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline->last_request));
>> 
>> It could be that we have a active request for kernel context and we
>> still bail out with assert. Why?
>
> Because we waited for the system to be idle, so we expect the timeline
> to have been completely retired, which implies that
> timline->last_request is now NULL.

Ok, the callsite did reveal this. And I did reveal being lazy for not
looking.

assert_idle_on_kernel_context()?

Regardless,

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

> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-03 14:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 13:34 [PATCH v2 1/9] drm/i915: Define an engine class enum for the uABI Chris Wilson
2017-11-03 13:34 ` [PATCH v2 2/9] drm/i915: Force the switch to the i915->kernel_context Chris Wilson
2017-11-03 14:03   ` Mika Kuoppala
2017-11-03 14:07     ` Chris Wilson
2017-11-03 14:13       ` Mika Kuoppala [this message]
2017-11-03 13:34 ` [PATCH v2 3/9] drm/i915: Move GT powersaving init to i915_gem_init() Chris Wilson
2017-11-03 13:34 ` [PATCH v2 4/9] drm/i915: Inline intel_modeset_gem_init() Chris Wilson
2017-11-03 14:06   ` Mika Kuoppala
2017-11-03 13:34 ` [PATCH v2 5/9] drm/i915: Mark the context state as dirty/written Chris Wilson
2017-11-03 14:29   ` Mika Kuoppala
2017-11-03 13:34 ` [PATCH v2 6/9] drm/i915: Record the default hw state after reset upon load Chris Wilson
2017-11-03 13:34 ` [PATCH v2 7/9] drm/i915: Report whether we have true context isolation Chris Wilson
2017-11-03 13:34 ` [PATCH v2 8/9] drm/i915: Remove redundant intel_autoenable_gt_powersave() Chris Wilson
2017-11-03 13:34 ` [PATCH v2 9/9] drm/i915: Stop caching the "golden" renderstate Chris Wilson
2017-11-03 14:01 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/9] drm/i915: Define an engine class enum for the uABI Patchwork
2017-11-03 14:08 ` [PATCH v3] " Chris Wilson
2017-11-03 14:58 ` ✓ Fi.CI.BAT: success for series starting with [v3] drm/i915: Define an engine class enum for the uABI (rev2) Patchwork
2017-11-03 18:06 ` ✗ Fi.CI.IGT: failure " 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=87tvybcux1.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.