All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/8] drm/i915: Flush GPU relocs harder for gen3
Date: Mon,  3 Dec 2018 11:36:58 +0000	[thread overview]
Message-ID: <20181203113701.12106-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20181203113701.12106-1-chris@chris-wilson.co.uk>

Adding an extra MI_STORE_DWORD_IMM to the gpu relocation path for gen3
was good, but still not good enough. To survive 24+ hours under test we
needed to perform not one, not two but three extra store-dw. Doing so
for each GPU relocation was a little unsightly and since we need to
worry about userspace hitting the same issues, we should apply the dummy
store-dw into the EMIT_FLUSH.

Fixes: 7dd4f6729f92 ("drm/i915: Async GPU relocation processing")
References: 7fa28e146994 ("drm/i915: Write GPU relocs harder with gen3")
Testcase: igt/gem_tiled_fence_blits # blb/pnv
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  7 +------
 drivers/gpu/drm/i915/intel_ringbuffer.c    | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index d4fac09095f8..1aaccbe7e1de 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1268,7 +1268,7 @@ relocate_entry(struct i915_vma *vma,
 		else if (gen >= 4)
 			len = 4;
 		else
-			len = 6;
+			len = 3;
 
 		batch = reloc_gpu(eb, vma, len);
 		if (IS_ERR(batch))
@@ -1309,11 +1309,6 @@ relocate_entry(struct i915_vma *vma,
 			*batch++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
 			*batch++ = addr;
 			*batch++ = target_offset;
-
-			/* And again for good measure (blb/pnv) */
-			*batch++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
-			*batch++ = addr;
-			*batch++ = target_offset;
 		}
 
 		goto out;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index a3d3126a3938..37bd05cef0e9 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -69,19 +69,28 @@ unsigned int intel_ring_update_space(struct intel_ring *ring)
 static int
 gen2_render_ring_flush(struct i915_request *rq, u32 mode)
 {
+	unsigned int num_store_dw;
 	u32 cmd, *cs;
 
 	cmd = MI_FLUSH;
-
+	num_store_dw = 0;
 	if (mode & EMIT_INVALIDATE)
 		cmd |= MI_READ_FLUSH;
+	if (mode & EMIT_FLUSH)
+		num_store_dw = 4;
 
-	cs = intel_ring_begin(rq, 2);
+	cs = intel_ring_begin(rq, 2 + 3 * num_store_dw);
 	if (IS_ERR(cs))
 		return PTR_ERR(cs);
 
 	*cs++ = cmd;
-	*cs++ = MI_NOOP;
+	while (num_store_dw--) {
+		*cs++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
+		*cs++ = i915_scratch_offset(rq->i915);
+		*cs++ = 0;
+	}
+	*cs++ = MI_FLUSH | MI_NO_WRITE_FLUSH;
+
 	intel_ring_advance(rq, cs);
 
 	return 0;
-- 
2.20.0.rc1

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

  parent reply	other threads:[~2018-12-03 11:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 11:36 [PATCH 1/8] drm/i915/breadcrumbs: Reduce missed-breadcrumb false positive rate Chris Wilson
2018-12-03 11:36 ` [PATCH 2/8] drm/i915: Complete the fences as they are cancelled due to wedging Chris Wilson
2018-12-03 17:11   ` Tvrtko Ursulin
2018-12-03 17:36     ` Chris Wilson
2018-12-04 10:30       ` Tvrtko Ursulin
2018-12-03 11:36 ` [PATCH 3/8] drm/i915/ringbuffer: Clear semaphore sync registers on ring init Chris Wilson
2018-12-03 12:05   ` Mika Kuoppala
2018-12-03 12:15     ` Chris Wilson
2018-12-03 11:36 ` [PATCH 4/8] drm/i915: Allocate a common scratch page Chris Wilson
2018-12-03 15:28   ` Mika Kuoppala
2018-12-03 17:10     ` Chris Wilson
2018-12-03 17:29   ` [PATCH v2] " Chris Wilson
2018-12-03 11:36 ` Chris Wilson [this message]
2018-12-03 11:36 ` [PATCH 6/8] drm/i915/selftests: Terminate hangcheck sanitycheck forcibly Chris Wilson
2018-12-03 12:09   ` Mika Kuoppala
2018-12-03 12:17     ` Chris Wilson
2018-12-03 12:21       ` Mika Kuoppala
2018-12-03 11:37 ` [PATCH 7/8] drm/i915/selftests: Reorder request allocation vs vma pinning Chris Wilson
2018-12-04 11:06   ` Tvrtko Ursulin
2018-12-03 11:37 ` [PATCH 8/8] drm/i915: Pipeline PDP updates for Braswell Chris Wilson
2018-12-04 11:53   ` Tvrtko Ursulin
2018-12-04 12:09     ` Chris Wilson
2018-12-03 12:00 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/i915/breadcrumbs: Reduce missed-breadcrumb false positive rate Patchwork
2018-12-03 12:03 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-12-03 12:17 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-03 13:49 ` [PATCH 1/8] " Tvrtko Ursulin
2018-12-03 15:01 ` ✓ Fi.CI.IGT: success for series starting with [1/8] " Patchwork
2018-12-03 17:42 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/i915/breadcrumbs: Reduce missed-breadcrumb false positive rate (rev2) Patchwork
2018-12-03 17:44 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-12-04  8:40 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-04 11:22 ` ✓ Fi.CI.IGT: " 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=20181203113701.12106-5-chris@chris-wilson.co.uk \
    --to=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.