diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-21 15:14:08 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-21 15:28:43 +0000 |
commit | a0c936cfc128dfea6c58c4eef1e56cc29df21406 (patch) | |
tree | 19870d1f593f952b12bdde076853d5fc826c235d /tests | |
parent | 0cc6a219f1de667ddc0c9a4011dc1c36a584be7b (diff) |
kms_flip: Skip tests that try to inject GPU hangs if already terminally wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kms_flip.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index a42b4469..e0197864 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -757,6 +757,14 @@ static uint32_t hang_gpu(int fd) return gem_exec.handle; } +static bool is_hung(int fd) +{ + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_THROTTLE, 0) == 0) + return false; + + return errno == EIO; +} + static int set_mode(struct test_output *o, uint32_t fb, int x, int y) { int n; @@ -869,8 +877,10 @@ static unsigned int run_test_step(struct test_output *o) igt_info("."); fflush(stdout); - if (do_flip && (o->flags & TEST_HANG)) + if (do_flip && (o->flags & TEST_HANG)) { hang = hang_gpu(drm_fd); + igt_assert_f(hang, "failed to exercise page flip hang recovery\n"); + } if (do_flip) do_or_die(do_page_flip(o, new_fb_id, !(o->flags & TEST_NOEVENT))); @@ -925,9 +935,6 @@ static unsigned int run_test_step(struct test_output *o) if (hang) unhang_gpu(drm_fd, hang); - igt_assert_f(!(do_flip && (o->flags & TEST_HANG)) || hang, - "failed to exercise page flip hang recovery\n"); - return completed_events; } @@ -1303,6 +1310,8 @@ static int run_test(int duration, int flags) struct test_output o; int i, n, modes = 0; + igt_require((flags & TEST_HANG) == 0 || !is_hung(drm_fd)); + resources = drmModeGetResources(drm_fd); igt_assert(resources); @@ -1358,6 +1367,8 @@ static int run_pair(int duration, int flags) struct test_output o; int i, j, m, n, modes = 0; + igt_require((flags & TEST_HANG) == 0 || !is_hung(drm_fd)); + resources = drmModeGetResources(drm_fd); igt_assert(resources); |