diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-31 18:14:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-31 18:26:43 +0000 |
commit | 9d3872ede14307ef4adb0866f8474f5c41e6b1c1 (patch) | |
tree | e5bc14fe0e464f08e9757bd57c47817db9261a05 /lib/igt_dummyload.c | |
parent | d524f385a17a73e3cfeeb2ed5a0610f0f0e3a61b (diff) |
lib: Don't feed IGT_SPIN_INVALID_CS to the command parser
If using a cmdparser, it may be intelligent enough to not execute the
invalid batch leading to an unwritten breadcrumb and
igt_spin_busywait_until_started() in an infinite loop.
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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index 4ae4b5ef..657c3c64 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -41,6 +41,7 @@ #include "igt_vgem.h" #include "i915/gem_engine_topology.h" #include "i915/gem_mman.h" +#include "i915/gem_submission.h" /** * SECTION:igt_dummyload @@ -189,7 +190,8 @@ emit_recursive_batch(igt_spin_t *spin, /* Allow ourselves to be preempted */ if (!(opts->flags & IGT_SPIN_NO_PREEMPTION)) *cs++ = MI_ARB_CHK; - if (opts->flags & IGT_SPIN_INVALID_CS) + if (opts->flags & IGT_SPIN_INVALID_CS && + !gem_has_cmdparser(fd, opts->engine)) *cs++ = 0xdeadbeef; /* Pad with a few nops so that we do not completely hog the system. @@ -371,6 +373,9 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts) igt_require(gem_class_can_store_dword(fd, class)); } + if (opts->flags & IGT_SPIN_INVALID_CS) + igt_require(!gem_has_cmdparser(fd, opts->engine)); + spin = spin_create(fd, opts); if (!(opts->flags & IGT_SPIN_INVALID_CS)) { |