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] drm/i915/execlists: Delay updating ring register state after resume
Date: Wed, 28 Mar 2018 16:40:43 +0300 [thread overview]
Message-ID: <87y3ic2u90.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180327231029.10677-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Now that we reload both RING_HEAD and RING_TAIL when rebinding the
> context, we do not need to scrub those registers immediately on resume.
>
> v2: Handle the perma-pinned contexts.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 31 ++++++++++++-------------------
> 1 file changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 654634254b64..2bf5128efb26 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -2536,13 +2536,14 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
> return ret;
> }
>
> -void intel_lr_context_resume(struct drm_i915_private *dev_priv)
> +void intel_lr_context_resume(struct drm_i915_private *i915)
> {
> struct intel_engine_cs *engine;
> struct i915_gem_context *ctx;
> enum intel_engine_id id;
>
> - /* Because we emit WA_TAIL_DWORDS there may be a disparity
> + /*
> + * Because we emit WA_TAIL_DWORDS there may be a disparity
> * between our bookkeeping in ce->ring->head and ce->ring->tail and
> * that stored in context. As we only write new commands from
> * ce->ring->tail onwards, everything before that is junk. If the GPU
> @@ -2552,27 +2553,19 @@ void intel_lr_context_resume(struct drm_i915_private *dev_priv)
> * So to avoid that we reset the context images upon resume. For
> * simplicity, we just zero everything out.
> */
> - list_for_each_entry(ctx, &dev_priv->contexts.list, link) {
> - for_each_engine(engine, dev_priv, id) {
> - struct intel_context *ce = &ctx->engine[engine->id];
> - u32 *reg;
> -
> - if (!ce->state)
> - continue;
> + list_for_each_entry(ctx, &i915->contexts.list, link) {
> + for_each_engine(engine, i915, id) {
> + struct intel_context *ce = &ctx->engine[id];
>
> - reg = i915_gem_object_pin_map(ce->state->obj,
> - I915_MAP_WB);
> - if (WARN_ON(IS_ERR(reg)))
> + if (!ce->ring)
> continue;
>
> - reg += LRC_STATE_PN * PAGE_SIZE / sizeof(*reg);
> - reg[CTX_RING_HEAD+1] = 0;
> - reg[CTX_RING_TAIL+1] = 0;
> -
> - ce->state->obj->mm.dirty = true;
> - i915_gem_object_unpin_map(ce->state->obj);
> -
> intel_ring_reset(ce->ring, 0);
> +
> + if (ce->pin_count) { /* otherwise done in context_pin */
From my understanding this is for kernel context only. So the comment
should mention the kernel context.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> + ce->lrc_reg_state[CTX_RING_HEAD+1] = 0;
> + ce->lrc_reg_state[CTX_RING_TAIL+1] = 0;
> + }
> }
> }
> }
> --
> 2.16.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-03-28 13:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 21:01 [PATCH 1/3] drm/i915/execlists: Reset ring registers on rebinding contexts Chris Wilson
2018-03-27 21:01 ` [PATCH 2/3] drm/i915/execlists: Delay updating ring register state after resume Chris Wilson
2018-03-27 23:05 ` Chris Wilson
2018-03-27 23:10 ` [PATCH v2] " Chris Wilson
2018-03-28 13:40 ` Mika Kuoppala [this message]
2018-03-27 21:01 ` [PATCH 3/3] drm/i915: Include the HW breadcrumb whenever we trace the global_seqno Chris Wilson
2018-03-29 8:42 ` Tvrtko Ursulin
2018-03-29 8:55 ` Chris Wilson
2018-03-29 9:43 ` Tvrtko Ursulin
2018-03-29 11:22 ` Chris Wilson
2018-03-27 22:38 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/execlists: Reset ring registers on rebinding contexts Patchwork
2018-03-27 22:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-03-27 23:58 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/execlists: Reset ring registers on rebinding contexts (rev2) Patchwork
2018-03-28 0:13 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-28 10:12 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-03-28 11:31 ` [PATCH 1/3] drm/i915/execlists: Reset ring registers on rebinding contexts Mika Kuoppala
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=87y3ic2u90.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.