summaryrefslogtreecommitdiff
path: root/lib/igt_gt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-20 22:06:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-20 22:09:53 +0100
commit415398a778e60354492d2adad2c3952133f8c6da (patch)
treebeedd424fa00111bc1a57d1a046521dd40b1b46d /lib/igt_gt.c
parenta7d58541977f7922b04ecd13159e186d1086c312 (diff)
lib/gt: Replace hanging instruction
First try an illegal instruction before the infinite loop to try and trigger a gpu hang more gracefully as the infinite loop is causing some older machines issues as the GPU hogs the entire systems and makes the machine laggy, unresponsive for long periods. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_gt.c')
-rw-r--r--lib/igt_gt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index ac3ab773..95d74a0c 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -137,7 +137,7 @@ igt_hang_ring_t igt_hang_ctx(int fd,
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 exec;
struct local_i915_gem_context_param param;
- uint32_t b[8];
+ uint32_t b[16];
unsigned ban;
unsigned len;
@@ -181,21 +181,21 @@ igt_hang_ring_t igt_hang_ctx(int fd,
exec.relocs_ptr = (uintptr_t)&reloc;
memset(b, 0xc5, sizeof(b));
+ b[0] = 0xffffffff;
len = 2;
if (intel_gen(intel_get_drm_devid(fd)) >= 8)
len++;
- b[0] = MI_BATCH_BUFFER_START | (len - 2);
- b[len] = MI_BATCH_BUFFER_END;
- b[len+1] = MI_NOOP;
+ b[1] = MI_BATCH_BUFFER_START | (len - 2);
+ b[1+len] = MI_BATCH_BUFFER_END;
+ b[2+len] = MI_NOOP;
gem_write(fd, exec.handle, 0, b, sizeof(b));
- reloc.offset = 4;
+ reloc.offset = 8;
reloc.target_handle = exec.handle;
reloc.read_domains = I915_GEM_DOMAIN_COMMAND;
execbuf.buffers_ptr = (uintptr_t)&exec;
execbuf.buffer_count = 1;
- execbuf.batch_len = sizeof(b);
execbuf.flags = ring;
i915_execbuffer2_set_context_id(execbuf, ctx);
gem_execbuf(fd, &execbuf);