summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2014-01-21 17:40:08 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-22 09:45:27 +0100
commitc05c88c2b641aaab83608fb2c8e816893690c1fe (patch)
tree606dafa19c4e26b96373eec04dcde5a561bc4e05
parent1bbb607d9f3ee8e725a784f740937577f153a520 (diff)
tests/gem_reset_stats: stop only one ring when submitting hang
If we stop all the rings, we can end up blaming the innocent rings on hangcheck. Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73652 Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/gem_reset_stats.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 034a2987..331d9547 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -237,20 +237,37 @@ static int exec_valid(int fd, int ctx)
return exec_valid_ring(fd, ctx, current_ring->exec);
}
-static void stop_rings(void)
+static void stop_rings(const int mask)
{
int fd;
+ char buf[80];
+ igt_assert((mask & ~((1 << NUM_RINGS) - 1)) == 0);
+ igt_assert(snprintf(buf, sizeof(buf), "0x%02x", mask) == 4);
fd = igt_debugfs_open(&dfs, "i915_ring_stop", O_WRONLY);
igt_assert(fd >= 0);
- igt_assert(write(fd, "0xff", 4) == 4);
+ igt_assert(write(fd, buf, 4) == 4);
close(fd);
}
#define BUFSIZE (4 * 1024)
#define ITEMS (BUFSIZE >> 2)
+static int ring_to_mask(int ring)
+{
+ for (unsigned i = 0; i < NUM_RINGS; i++) {
+ const struct target_ring *r = &rings[i];
+
+ if (r->exec == ring)
+ return (1 << i);
+ }
+
+ igt_assert(0);
+
+ return -1;
+}
+
static int inject_hang_ring(int fd, int ctx, int ring)
{
struct drm_i915_gem_execbuffer2 execbuf;
@@ -340,7 +357,7 @@ static int inject_hang_ring(int fd, int ctx, int ring)
free(buf);
- stop_rings();
+ stop_rings(ring_to_mask(ring));
return exec.handle;
}