summaryrefslogtreecommitdiff
path: root/tests/i915/gem_spin_batch.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-10-09 17:20:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-10-09 20:14:16 +0100
commit3844f333747a9ac64c7ed72ee68d837708eb1ad8 (patch)
tree8f5e8da471ef330465930699e58f399849e7bb6c /tests/i915/gem_spin_batch.c
parent48005bda72a06669a73d26a7f6a3cdef4ac22689 (diff)
lib: Launch spinners from inside userptr
Add support for dummyload to be userptr, the variation in object type may be useful in some tests and to ensure complete coverage of some dark corners. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_spin_batch.c')
-rw-r--r--tests/i915/gem_spin_batch.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/i915/gem_spin_batch.c b/tests/i915/gem_spin_batch.c
index e7dd58ec..19bc4638 100644
--- a/tests/i915/gem_spin_batch.c
+++ b/tests/i915/gem_spin_batch.c
@@ -33,7 +33,9 @@
"'%s' != '%s' (%lld not within %d%% tolerance of %lld)\n",\
#x, #ref, (long long)x, tolerance, (long long)ref)
-static void spin(int fd, const struct intel_execution_engine2 *e2,
+static void spin(int fd,
+ const struct intel_execution_engine2 *e2,
+ unsigned int flags,
unsigned int timeout_sec)
{
const uint64_t timeout_100ms = 100000000LL;
@@ -43,9 +45,10 @@ static void spin(int fd, const struct intel_execution_engine2 *e2,
struct timespec itv = { };
uint64_t elapsed;
- spin = __igt_spin_new(fd, .engine = e2->flags);
+ spin = __igt_spin_new(fd, .engine = e2->flags, .flags = flags);
while ((elapsed = igt_nsec_elapsed(&tv)) >> 30 < timeout_sec) {
- igt_spin_t *next = __igt_spin_new(fd, .engine = e2->flags);
+ igt_spin_t *next =
+ __igt_spin_new(fd, .engine = e2->flags, .flags = flags);
igt_spin_set_timeout(spin,
timeout_100ms - igt_nsec_elapsed(&itv));
@@ -120,14 +123,15 @@ static void spin_exit_handler(int sig)
igt_terminate_spins();
}
-static void spin_on_all_engines(int fd, unsigned int timeout_sec)
+static void
+spin_on_all_engines(int fd, unsigned long flags, unsigned int timeout_sec)
{
const struct intel_execution_engine2 *e2;
__for_each_physical_engine(fd, e2) {
igt_fork(child, 1) {
igt_install_exit_handler(spin_exit_handler);
- spin(fd, e2, timeout_sec);
+ spin(fd, e2, flags, timeout_sec);
}
}
@@ -186,7 +190,7 @@ igt_main
e2 = &e2__;
igt_subtest_f("legacy-%s", e->name)
- spin(fd, e2, 3);
+ spin(fd, e2, 0, 3);
igt_subtest_f("legacy-resubmit-%s", e->name)
spin_resubmit(fd, e2, 0);
@@ -202,7 +206,7 @@ igt_main
__for_each_physical_engine(fd, e2) {
igt_subtest_f("%s", e2->name)
- spin(fd, e2, 3);
+ spin(fd, e2, 0, 3);
igt_subtest_f("resubmit-%s", e2->name)
spin_resubmit(fd, e2, 0);
@@ -220,7 +224,10 @@ igt_main
}
igt_subtest("spin-each")
- spin_on_all_engines(fd, 3);
+ spin_on_all_engines(fd, 0, 3);
+
+ igt_subtest("user-each")
+ spin_on_all_engines(fd, IGT_SPIN_USERPTR, 3);
igt_fixture {
igt_stop_hang_detector();