[PATCH i-g-t 14/19] WIP: tests/gem_busy: Use allocator for no-reloc path
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Thu Apr 22 12:19:55 UTC 2021
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
tests/i915/gem_busy.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c
index 77a551013..7057432a9 100644
--- a/tests/i915/gem_busy.c
+++ b/tests/i915/gem_busy.c
@@ -165,8 +165,10 @@ static void one(int fd, const struct intel_execution_engine2 *e, unsigned test_f
struct timespec tv;
igt_spin_t *spin;
int timeout;
+ uint64_t ahnd = get_reloc_ahnd(fd);
spin = igt_spin_new(fd,
+ .ahnd = ahnd,
.engine = e->flags,
.dependency = scratch,
.flags = (test_flags & HANG) ? IGT_SPIN_NO_PREEMPTION : 0);
@@ -218,6 +220,7 @@ static void one(int fd, const struct intel_execution_engine2 *e, unsigned test_f
igt_spin_free(fd, spin);
gem_close(fd, scratch);
+ put_ahnd(ahnd);
}
static void xchg_u32(void *array, unsigned i, unsigned j)
@@ -345,19 +348,23 @@ static bool has_semaphores(int fd)
static bool has_extended_busy_ioctl(int fd)
{
- igt_spin_t *spin = igt_spin_new(fd, .engine = I915_EXEC_DEFAULT);
+ uint64_t ahnd = get_reloc_ahnd(fd);
+ igt_spin_t *spin = igt_spin_new(fd, .ahnd = ahnd, .engine = I915_EXEC_DEFAULT);
uint32_t read, write;
__gem_busy(fd, spin->handle, &read, &write);
igt_spin_free(fd, spin);
+ put_ahnd(ahnd);
return read != 0;
}
static void basic(int fd, const struct intel_execution_engine2 *e, unsigned flags)
{
+ uint64_t ahnd = get_reloc_ahnd(fd);
igt_spin_t *spin =
igt_spin_new(fd,
+ .ahnd = ahnd,
.engine = e->flags,
.flags = flags & HANG ?
IGT_SPIN_NO_PREEMPTION | IGT_SPIN_INVALID_CS : 0);
@@ -382,6 +389,7 @@ static void basic(int fd, const struct intel_execution_engine2 *e, unsigned flag
}
igt_spin_free(fd, spin);
+ put_ahnd(ahnd);
}
static void all(int i915)
@@ -419,8 +427,10 @@ igt_main
igt_subtest_with_dynamic("busy") {
igt_dynamic("all") {
+ intel_allocator_multiprocess_start();
gem_quiescent_gpu(fd);
all(fd);
+ intel_allocator_multiprocess_stop();
}
__for_each_physical_engine(fd, e) {
--
2.26.0
More information about the Intel-gfx-trybot
mailing list