diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-08-16 14:39:15 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-16 16:27:31 +0200 |
commit | f978cc027cd02a6c43b54b69fab2b538bbe05330 (patch) | |
tree | 24c8ac2aea2edf8c87372de6207d440117ede220 /lib/igt_dummyload.c | |
parent | c8811338e8a7723b5e99a303361ed97c092fc270 (diff) |
lib/dummyload: Pad with a few nops so that we do not completely hog the system
Part of the attraction of using a recursive batch is that it is
hard on the system (executing the "function" call is apparently
quite expensive). However, the GPU may hog the entire system for
a few minutes, preventing even NMI. Quite why this is so is unclear,
but presumably it relates to the PM_INTRMSK workaround on gen6/gen7.
If we give the system a break by having the GPU execute a few nops
between function calls, that appears enough to keep SNB out of
trouble.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
[danvet: Add bugzilla link]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_dummyload.c')
-rw-r--r-- | lib/igt_dummyload.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index 00c6a030..f2a94b55 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -103,7 +103,7 @@ static void emit_recursive_batch(igt_spin_t *spin, /* dummy write to dependency */ obj[SCRATCH].handle = dep; fill_reloc(&relocs[obj[BATCH].relocation_count++], - dep, 256, + dep, 1020, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); execbuf.buffer_count++; @@ -112,9 +112,23 @@ static void emit_recursive_batch(igt_spin_t *spin, spin->batch = batch; spin->handle = obj[BATCH].handle; + /* Pad with a few nops so that we do not completely hog the system. + * + * Part of the attraction of using a recursive batch is that it is + * hard on the system (executing the "function" call is apparently + * quite expensive). However, the GPU may hog the entire system for + * a few minutes, preventing even NMI. Quite why this is so is unclear, + * but presumably it relates to the PM_INTRMSK workaround on gen6/gen7. + * If we give the system a break by having the GPU execute a few nops + * between function calls, that appears enough to keep SNB out of + * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262 + */ + batch += 1000; + /* recurse */ fill_reloc(&relocs[obj[BATCH].relocation_count], - obj[BATCH].handle, 1, I915_GEM_DOMAIN_COMMAND, 0); + obj[BATCH].handle, (batch - spin->batch) + 1, + I915_GEM_DOMAIN_COMMAND, 0); if (gen >= 8) { *batch++ = MI_BATCH_BUFFER_START | 1 << 8 | 1; *batch++ = 0; |