diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-30 11:05:42 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-31 17:50:01 +0100 |
commit | ae0ea2a0cff1cf8516d18ada5b9db01c56b73ed9 (patch) | |
tree | 8a67bb7b2e50b4b051b9c6153abaf026b6099ddb /lib/i915 | |
parent | 94411f9b9fffe4dd875dfaa0a0a2172083179572 (diff) |
lib: Double check ring measurement
Check twice for the signal interrupting the execbuf, because the real
world is messy.
References: https://bugs.freedesktop.org/show_bug.cgi?id=106695
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
Diffstat (limited to 'lib/i915')
-rw-r--r-- | lib/i915/gem_ring.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c index 0c061000..0708c8a2 100644 --- a/lib/i915/gem_ring.c +++ b/lib/i915/gem_ring.c @@ -55,7 +55,7 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags struct drm_i915_gem_exec_object2 obj[2]; struct drm_i915_gem_execbuffer2 execbuf; const uint32_t bbe = MI_BATCH_BUFFER_END; - unsigned int count, last; + unsigned int last[2]= { -1, -1 }, count; struct itimerval itv; IGT_CORK_HANDLE(cork); @@ -85,7 +85,6 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags itv.it_value.tv_usec = 10000; setitimer(ITIMER_REAL, &itv, NULL); - last = -1; count = 0; do { if (__execbuf(fd, &execbuf) == 0) { @@ -93,12 +92,13 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags continue; } - if (last == count) + if (last[1] == count) break; /* sleep until the next timer interrupt (woken on signal) */ pause(); - last = count; + last[1] = last[0]; + last[0] = count; } while (1); igt_assert_eq(__execbuf(fd, &execbuf), -EINTR); |