All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] i915/gem_ctx_param: Keep the engine active while peeking at vm layout
@ 2019-11-24 11:27 ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2019-11-24 11:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

The implicit soft-pinning we use to probe the vm layout using execbuf,
depends on the batch remaining active (not retired) between execbufs.
Naturally, if the background retire worker runs the batch is retired and
the implicit soft-pinning is free to use a fresh address.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_ctx_param.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/i915/gem_ctx_param.c b/tests/i915/gem_ctx_param.c
index bd1ee3996..63e0db38d 100644
--- a/tests/i915/gem_ctx_param.c
+++ b/tests/i915/gem_ctx_param.c
@@ -161,6 +161,7 @@ static void test_vm(int i915)
 		.param = I915_CONTEXT_PARAM_VM,
 	};
 	uint32_t parent, child;
+	igt_spin_t *spin;
 
 	/*
 	 * Proving 2 contexts share the same GTT is quite tricky as we have no
@@ -177,6 +178,15 @@ static void test_vm(int i915)
 	parent = gem_context_create(i915);
 	child = gem_context_create(i915);
 
+	/* Create a background spinner to keep the engines busy */
+	spin = igt_spin_new(i915);
+	for (int i = 0; i < 16; i++) {
+		spin->execbuf.rsvd1 = gem_context_create(i915);
+		gem_context_set_priority(i915, spin->execbuf.rsvd1, 1023);
+		gem_execbuf(i915, &spin->execbuf);
+		gem_context_destroy(i915, spin->execbuf.rsvd1);
+	}
+
 	/* Using implicit soft-pinning */
 	eb.rsvd1 = parent;
 	batch.offset = nonzero_offset;
@@ -226,6 +236,7 @@ static void test_vm(int i915)
 	gem_context_destroy(i915, child);
 	gem_vm_destroy(i915, arg.value);
 
+	igt_spin_free(i915, spin);
 	gem_sync(i915, batch.handle);
 	gem_close(i915, batch.handle);
 }
-- 
2.24.0

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-25 18:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-24 11:27 [PATCH i-g-t] i915/gem_ctx_param: Keep the engine active while peeking at vm layout Chris Wilson
2019-11-24 11:27 ` [igt-dev] " Chris Wilson
2019-11-24 11:27 ` [Intel-gfx] " Chris Wilson
2019-11-24 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-24 20:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-11-25 18:45 ` [PATCH i-g-t] " Summers, Stuart
2019-11-25 18:45   ` [igt-dev] [Intel-gfx] " Summers, Stuart
2019-11-25 18:45   ` Summers, Stuart

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.