[PATCH i-g-t 29/58] tests/i915_hangman: Adopt to use no-reloc
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Tue Jul 6 07:09:06 UTC 2021
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
tests/i915/i915_hangman.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index f6fac283e..ca9e17376 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -211,10 +211,11 @@ static void test_error_state_capture(unsigned ring_id,
uint32_t *batch;
igt_hang_t hang;
uint64_t offset;
+ uint64_t ahnd = get_reloc_ahnd(device, 0);
clear_error_state();
- hang = igt_hang_ctx(device, 0, ring_id, HANG_ALLOW_CAPTURE);
+ hang = igt_hang_ctx_with_ahnd(device, ahnd, 0, ring_id, HANG_ALLOW_CAPTURE);
offset = hang.spin->obj[IGT_SPIN_BATCH].offset;
batch = gem_mmap__cpu(device, hang.spin->handle, 0, 4096, PROT_READ);
@@ -224,6 +225,7 @@ static void test_error_state_capture(unsigned ring_id,
check_error_state(ring_name, offset, batch);
munmap(batch, 4096);
+ put_ahnd(ahnd);
}
static void
@@ -233,6 +235,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 +246,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 +258,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 +271,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