summaryrefslogtreecommitdiff
path: root/lib/igt_dummyload.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-01-29 11:11:09 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-01-29 11:13:31 +0000
commitccefe6bf07b075f786d96904e19eaa03695c26d5 (patch)
treed09714db326ffcd574c9f08c736c74999593a1f4 /lib/igt_dummyload.c
parent8835c97dcf650cdf220786d2da9fa4e5c3bc69fa (diff)
lib: Don't assert spinner is still alive when using INVALID_CS
Using INVALID_CS may lead to an immediate GPU hang and reset of the spinner. So even before we return the new spinner to the caller, it may be completed and we cannot assert that it is still busy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'lib/igt_dummyload.c')
-rw-r--r--lib/igt_dummyload.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 041122af..4ae4b5ef 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -373,11 +373,17 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts)
spin = spin_create(fd, opts);
- igt_assert(gem_bo_busy(fd, spin->handle));
- if (opts->flags & IGT_SPIN_FENCE_OUT) {
- struct pollfd pfd = { spin->out_fence, POLLIN };
+ if (!(opts->flags & IGT_SPIN_INVALID_CS)) {
+ /*
+ * When injecting invalid CS into the batch, the spinner may
+ * be killed immediately -- i.e. may already be completed!
+ */
+ igt_assert(gem_bo_busy(fd, spin->handle));
+ if (opts->flags & IGT_SPIN_FENCE_OUT) {
+ struct pollfd pfd = { spin->out_fence, POLLIN };
- igt_assert(poll(&pfd, 1, 0) == 0);
+ igt_assert(poll(&pfd, 1, 0) == 0);
+ }
}
return spin;