diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-26 13:41:17 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-01-28 10:06:10 +0000 |
commit | 004b7ccce8a6fc76f89344afc0a65e2dfe61e317 (patch) | |
tree | 427d34be827ca15b47668f921c4d193949de8e11 /lib | |
parent | 0ecbff50d72538b5e548fc6dd48a07173e9f8b42 (diff) |
i915: Inject invalid CS into hanging spinners
Some spinners are used with the intent of never ending and being
declared hung by the kernel. In some cases, these are being used to
simulate invalid payloads and so we can use an invalid command to
trigger a GPU hang. (Other cases, they are simulating infinite workloads
that truly never end, but we still need to be able to curtail to provide
multi-tasking). This patch adds IGT_SPIN_INVALID_CS to request the
injection of 0xdeadbeef into the command stream that should trigger a
GPU hang.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_dummyload.c | 2 | ||||
-rw-r--r-- | lib/igt_dummyload.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index b7f4caca..041122af 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -189,6 +189,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) + *cs++ = 0xdeadbeef; /* Pad with a few nops so that we do not completely hog the system. * diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h index 421ca183..cb696009 100644 --- a/lib/igt_dummyload.h +++ b/lib/igt_dummyload.h @@ -62,6 +62,7 @@ struct igt_spin_factory { #define IGT_SPIN_POLL_RUN (1 << 2) #define IGT_SPIN_FAST (1 << 3) #define IGT_SPIN_NO_PREEMPTION (1 << 4) +#define IGT_SPIN_INVALID_CS (1 << 5) igt_spin_t * __igt_spin_factory(int fd, const struct igt_spin_factory *opts); |