From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/execlists: Skip forcewake for ELSP submission
Date: Mon, 22 Jan 2018 16:59:21 +0000 [thread overview]
Message-ID: <bd31f99c-e64e-e5e5-e67d-3a45647a4dda@linux.intel.com> (raw)
In-Reply-To: <20180122100714.15137-1-chris@chris-wilson.co.uk>
On 22/01/2018 10:07, Chris Wilson wrote:
> Now that we can read the CSB from the HWSP, we may avoid having to
> perform mmio reads entirely and so forgo the rigmarole of the forcewake
> dance.
>
> v2: Include forcewake hint for GEM_TRACE readback of mmio. If we don't
> hold fw ourselves, the reads may return garbage.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index ff25f209d0a5..075e7f56e9ba 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -778,6 +778,7 @@ static void execlists_submission_tasklet(unsigned long data)
> struct intel_engine_execlists * const execlists = &engine->execlists;
> struct execlist_port * const port = execlists->port;
> struct drm_i915_private *dev_priv = engine->i915;
> + bool fw = false;
>
> /* We can skip acquiring intel_runtime_pm_get() here as it was taken
> * on our behalf by the request (see i915_gem_mark_busy()) and it will
> @@ -788,8 +789,6 @@ static void execlists_submission_tasklet(unsigned long data)
> */
> GEM_BUG_ON(!dev_priv->gt.awake);
>
> - intel_uncore_forcewake_get(dev_priv, execlists->fw_domains);
> -
> /* Prefer doing test_and_clear_bit() as a two stage operation to avoid
> * imposing the cost of a locked atomic transaction when submitting a
> * new request (outside of the context-switch interrupt).
> @@ -818,6 +817,12 @@ static void execlists_submission_tasklet(unsigned long data)
> */
> __clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
> if (unlikely(execlists->csb_head == -1)) { /* following a reset */
> + if (!fw) {
> + intel_uncore_forcewake_get(dev_priv,
> + execlists->fw_domains);
> + fw = true;
> + }
> +
> head = readl(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)));
> tail = GEN8_CSB_WRITE_PTR(head);
> head = GEN8_CSB_READ_PTR(head);
> @@ -830,10 +835,10 @@ static void execlists_submission_tasklet(unsigned long data)
> head = execlists->csb_head;
> tail = READ_ONCE(buf[write_idx]);
> }
> - GEM_TRACE("%s cs-irq head=%d [%d], tail=%d [%d]\n",
> + GEM_TRACE("%s cs-irq head=%d [%d%s], tail=%d [%d%s]\n",
> engine->name,
> - head, GEN8_CSB_READ_PTR(readl(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)))),
> - tail, GEN8_CSB_WRITE_PTR(readl(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)))));
> + head, GEN8_CSB_READ_PTR(readl(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)))), fw ? "" : "?",
> + tail, GEN8_CSB_WRITE_PTR(readl(dev_priv->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)))), fw ? "" : "?");
Not useful to log the correct value in any case? Or in other words, this
trace is not useful for debugging potential problems with the HWSP CSB
copy, while with this change it stops being so?
>
> while (head != tail) {
> struct drm_i915_gem_request *rq;
> @@ -943,7 +948,8 @@ static void execlists_submission_tasklet(unsigned long data)
There is a writel a bit above which now has no fw in HWSP mode.
> if (!execlists_is_active(execlists, EXECLISTS_ACTIVE_PREEMPT))
> execlists_dequeue(engine); > - intel_uncore_forcewake_put(dev_priv, execlists->fw_domains);
> + if (fw)
> + intel_uncore_forcewake_put(dev_priv, execlists->fw_domains);
> }
>
> static void insert_request(struct intel_engine_cs *engine,
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-01-22 16:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-20 9:31 [PATCH 1/2] drm/i915: Increase render/media power gating hysteresis for gen9+ Chris Wilson
2018-01-20 9:31 ` [PATCH 2/2] drm/i915/execlists: Skip forcewake for ELSP submission Chris Wilson
2018-01-22 9:50 ` Tvrtko Ursulin
2018-01-22 9:53 ` Chris Wilson
2018-01-22 10:07 ` [PATCH v2] " Chris Wilson
2018-01-22 16:59 ` Tvrtko Ursulin [this message]
2018-01-22 17:17 ` Chris Wilson
2018-01-22 17:29 ` Tvrtko Ursulin
2018-01-20 10:02 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Increase render/media power gating hysteresis for gen9+ Patchwork
2018-01-20 13:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-21 11:01 ` [PATCH 1/2] " Sagar Arun Kamble
2018-01-21 12:25 ` Chris Wilson
2018-01-22 7:04 ` Sagar Arun Kamble
2018-01-22 10:29 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Increase render/media power gating hysteresis for gen9+ (rev2) Patchwork
2018-01-22 13:55 ` [PATCH v2] drm/i915: Increase render/media power gating hysteresis for gen9+ Chris Wilson
2018-01-22 14:15 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Increase render/media power gating hysteresis for gen9+ (rev3) Patchwork
2018-01-22 21:26 ` ✓ Fi.CI.IGT: " Patchwork
2018-01-23 13:02 ` Chris Wilson
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=bd31f99c-e64e-e5e5-e67d-3a45647a4dda@linux.intel.com \
--to=tvrtko.ursulin@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.