All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/11] drm/i915/execlists: Reset the CSB head tracking on reset/sanitization
Date: Fri, 1 Jun 2018 14:54:20 +0100	[thread overview]
Message-ID: <c610de84-c414-db52-bd3d-228c57b8cd6f@linux.intel.com> (raw)
In-Reply-To: <20180531185204.19520-3-chris@chris-wilson.co.uk>


On 31/05/2018 19:51, Chris Wilson wrote:
> We can avoid the mmio read of the CSB pointers after reset based on the
> knowledge that the HW always start writing at entry 0 in the CSB buffer.
> We need to reset our CSB head tracking after GPU reset (and on
> sanitization after resume) so that we are expecting to read from entry
> 0.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_lrc.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 517e92c6a70b..e5cf049c18f8 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -965,22 +965,19 @@ static void process_csb(struct intel_engine_cs *engine)
>   			&engine->status_page.page_addr[I915_HWS_CSB_BUF0_INDEX];
>   		unsigned int head, tail;
>   
> -		if (unlikely(execlists->csb_use_mmio)) {
> -			buf = (u32 * __force)
> -				(i915->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_BUF_LO(engine, 0)));
> -			execlists->csb_head = -1; /* force mmio read of CSB */
> -		}
> -
>   		/* Clear before reading to catch new interrupts */
>   		clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
>   		smp_mb__after_atomic();
>   
> -		if (unlikely(execlists->csb_head == -1)) { /* after a reset */
> +		if (unlikely(execlists->csb_use_mmio)) {
>   			if (!fw) {
>   				intel_uncore_forcewake_get(i915, execlists->fw_domains);
>   				fw = true;
>   			}
>   
> +			buf = (u32 * __force)
> +				(i915->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_BUF_LO(engine, 0)));
> +
>   			head = readl(i915->regs + i915_mmio_reg_offset(RING_CONTEXT_STATUS_PTR(engine)));
>   			tail = GEN8_CSB_WRITE_PTR(head);
>   			head = GEN8_CSB_READ_PTR(head);
> @@ -1959,7 +1956,7 @@ static void execlists_reset(struct intel_engine_cs *engine,
>   	spin_unlock(&engine->timeline.lock);
>   
>   	/* Following the reset, we need to reload the CSB read/write pointers */
> -	engine->execlists.csb_head = -1;
> +	engine->execlists.csb_head = GEN8_CSB_ENTRIES - 1;
>   
>   	local_irq_restore(flags);
>   
> @@ -2460,7 +2457,7 @@ static int logical_ring_init(struct intel_engine_cs *engine)
>   			upper_32_bits(ce->lrc_desc);
>   	}
>   
> -	engine->execlists.csb_head = -1;
> +	engine->execlists.csb_head = GEN8_CSB_ENTRIES - 1;
>   
>   	return 0;
>   
> 

Looks OK. Just not that exciting due rarity of the event.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 18:51 ksoftirqd avoidance Chris Wilson
2018-05-31 18:51 ` [PATCH 01/11] drm/i915: Be irqsafe inside reset Chris Wilson
2018-06-01 13:44   ` Tvrtko Ursulin
2018-05-31 18:51 ` [PATCH 02/11] drm/i915/execlists: Reset the CSB head tracking on reset/sanitization Chris Wilson
2018-06-01 13:54   ` Tvrtko Ursulin [this message]
2018-05-31 18:51 ` [PATCH 03/11] drm/i915/execlists: Pull submit after dequeue under timeline lock Chris Wilson
2018-06-01 14:02   ` Tvrtko Ursulin
2018-06-01 14:07     ` Chris Wilson
2018-06-04  9:25       ` Tvrtko Ursulin
2018-06-04 10:12         ` Chris Wilson
2018-06-04 10:58           ` Tvrtko Ursulin
2018-06-04 11:15             ` Chris Wilson
2018-06-04 14:19   ` Tvrtko Ursulin
2018-05-31 18:51 ` [PATCH 04/11] drm/i915/execlists: Pull CSB reset under the timeline.lock Chris Wilson
2018-06-04 14:25   ` Tvrtko Ursulin
2018-06-04 15:29     ` Chris Wilson
2018-06-05  8:25       ` Tvrtko Ursulin
2018-05-31 18:51 ` [PATCH 05/11] drm/i915/execlists: Process one CSB interrupt at a time Chris Wilson
2018-06-04 14:27   ` Tvrtko Ursulin
2018-06-04 15:32     ` Chris Wilson
2018-06-05  8:30       ` Tvrtko Ursulin
2018-05-31 18:51 ` [PATCH 06/11] drm/i915/execlists: Unify CSB access pointers Chris Wilson
2018-06-04 14:53   ` Tvrtko Ursulin
2018-06-04 16:58     ` Daniele Ceraolo Spurio
2018-06-05  8:38       ` Tvrtko Ursulin
2018-05-31 18:52 ` [PATCH 07/11] drm/i915/execlists: Direct submission of new requests (avoid tasklet/ksoftirqd) Chris Wilson
2018-05-31 19:57   ` [PATCH] " Chris Wilson
2018-05-31 18:52 ` [PATCH 08/11] drm/i915: Move rate-limiting request retire to after submission Chris Wilson
2018-05-31 18:52 ` [PATCH 09/11] drm/i915: Wait for engines to idle before retiring Chris Wilson
2018-05-31 18:52 ` [PATCH 10/11] drm/i915: Move engine request retirement to intel_engine_cs Chris Wilson
2018-05-31 18:52 ` [PATCH 11/11] drm/i915: Hold request reference for submission until retirement Chris Wilson
2018-05-31 20:21   ` [PATCH] " Chris Wilson
2018-05-31 19:30 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915: Be irqsafe inside reset Patchwork
2018-05-31 19:48 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-05-31 20:14 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915: Be irqsafe inside reset (rev2) Patchwork
2018-05-31 20:33 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-31 20:37 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/i915: Be irqsafe inside reset (rev3) Patchwork
2018-05-31 20:54 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-31 21:54 ` ✗ 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=c610de84-c414-db52-bd3d-228c57b8cd6f@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.