[PATCH i-g-t 45/52] CHECK: tests/i915_hangman: Adopt to use no-reloc

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Jul 1 12:37:25 UTC 2021


Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 tests/i915/i915_hangman.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index f6fac283e..17a93825c 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -233,6 +233,7 @@ test_engine_hang(const struct intel_execution_engine2 *e, unsigned int flags)
 	igt_spin_t *spin, *next;
 	IGT_LIST_HEAD(list);
 	uint32_t ctx;
+	uint64_t ahnd = get_reloc_ahnd(device, 0), ahndN;
 
 	igt_skip_on(flags & IGT_SPIN_INVALID_CS &&
 		    gem_has_cmdparser(device, e->flags));
@@ -243,7 +244,9 @@ test_engine_hang(const struct intel_execution_engine2 *e, unsigned int flags)
 			continue;
 
 		ctx = gem_context_clone_with_engines(device, 0);
+		ahndN = get_reloc_ahnd(device, ctx);
 		spin = __igt_spin_new(device, ctx,
+				      .ahnd = ahndN,
 				      .engine = other->flags,
 				      .flags = IGT_SPIN_FENCE_OUT);
 		gem_context_destroy(device, ctx);
@@ -253,6 +256,7 @@ test_engine_hang(const struct intel_execution_engine2 *e, unsigned int flags)
 
 	/* And on the target engine, we hang */
 	spin = igt_spin_new(device,
+			    .ahnd = ahnd,
 			    .engine = e->flags,
 			    .flags = (IGT_SPIN_FENCE_OUT |
 				      IGT_SPIN_NO_PREEMPTION |
@@ -265,13 +269,16 @@ test_engine_hang(const struct intel_execution_engine2 *e, unsigned int flags)
 
 	/* But no other engines/clients should be affected */
 	igt_list_for_each_entry_safe(spin, next, &list, link) {
+		ahndN = spin->ahnd;
 		igt_assert(sync_fence_wait(spin->out_fence, 0) == -ETIME);
 		igt_spin_end(spin);
 
 		igt_assert(sync_fence_wait(spin->out_fence, 500) == 0);
 		igt_assert_eq(sync_fence_status(spin->out_fence), 1);
 		igt_spin_free(device, spin);
+		put_ahnd(ahndN);
 	}
+	put_ahnd(ahnd);
 }
 
 /* This test covers the case where we end up in an uninitialised area of the
-- 
2.26.0



More information about the Intel-gfx-trybot mailing list