From 415398a778e60354492d2adad2c3952133f8c6da Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 20 May 2016 22:06:09 +0100 Subject: 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 --- lib/igt_gt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/igt_gt.c') 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); -- cgit v1.2.3