summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-12-06 09:53:50 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-12-06 09:54:42 +0000
commit47f770e8e544831ae5a984b2083df73f71067762 (patch)
treecc803ed3e5691b62b09d50dc705776a9de98c4b6
parent10d4e2e9177eb747b9f2ab9122e3ab60e91654fb (diff)
i915/gem_ctx_exec: Check spinner requirements before fork
Do a check to see if we support a pollable spinner before forking to avoid upsetting libigt. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-rw-r--r--tests/i915/gem_ctx_exec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index 74e67ab9..89776185 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -341,6 +341,10 @@ static void close_race(int i915)
{
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
uint32_t *contexts;
+ igt_spin_t *spin;
+
+ /* Check we can execute a polling spinner */
+ igt_spin_free(i915, igt_spin_new(i915, .flags = IGT_SPIN_POLL_RUN));
contexts = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
igt_assert(contexts != MAP_FAILED);
@@ -349,9 +353,7 @@ static void close_race(int i915)
contexts[child] = gem_context_clone_with_engines(i915, 0);
igt_fork(child, ncpus) {
- igt_spin_t *spin;
-
- spin = igt_spin_new(i915, .flags = IGT_SPIN_POLL_RUN);
+ spin = __igt_spin_new(i915, .flags = IGT_SPIN_POLL_RUN);
igt_spin_end(spin);
gem_sync(i915, spin->handle);