diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-01 09:45:54 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-01 09:49:30 +0000 |
commit | fa432c96e38f5e09234096c740d62cd6b7160f59 (patch) | |
tree | f5aeb433ea8ea836fecfc165ce1a2b1291d4a58b /tests/i915/gem_fence_thrash.c | |
parent | 13dbe276f21d75a42795567973b9303112bd7c5d (diff) |
i915/gem_fence_thrash: Cap the amount of work done per subtest
Use fixed duration and only a single stress tests for bo-write-verify to
bring the runtime to within reason.
Closes: https://gitlab.freedesktop.org/drm/intel/issues/1286
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_fence_thrash.c')
-rw-r--r-- | tests/i915/gem_fence_thrash.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/tests/i915/gem_fence_thrash.c b/tests/i915/gem_fence_thrash.c index 9beada98..97902890 100644 --- a/tests/i915/gem_fence_thrash.c +++ b/tests/i915/gem_fence_thrash.c @@ -89,16 +89,14 @@ static void * bo_copy (void *_arg) { struct test *t = (struct test *)_arg; - int fd = t->fd; - int n; - char *a, *b; + void *a, *b; - a = bo_create (fd, t->tiling); - b = bo_create (fd, t->tiling); + a = bo_create(t->fd, t->tiling); + b = bo_create(t->fd, t->tiling); - for (n = 0; n < 1000; n++) { - memcpy (a, b, OBJECT_SIZE); - sched_yield (); + igt_until_timeout(1) { + memcpy(a, b, OBJECT_SIZE); + sched_yield(); } munmap(a, OBJECT_SIZE); @@ -183,9 +181,8 @@ static void * bo_write_verify(void *_arg) { struct test *t = (struct test *)_arg; - int i; - for (i = 0; i < 10; i++) + igt_until_timeout(1) _bo_write_verify(t); return 0; @@ -246,19 +243,11 @@ igt_main igt_subtest("bo-write-verify-threaded-none") igt_assert(run_test(5, bo_write_verify, I915_TILING_NONE, 2) == 0); - igt_subtest("bo-write-verify-threaded-x") { - igt_assert(run_test(2, bo_write_verify, I915_TILING_X, 2) == 0); + igt_subtest("bo-write-verify-threaded-x") igt_assert(run_test(5, bo_write_verify, I915_TILING_X, 2) == 0); - igt_assert(run_test(10, bo_write_verify, I915_TILING_X, 2) == 0); - igt_assert(run_test(20, bo_write_verify, I915_TILING_X, 2) == 0); - } - igt_subtest("bo-write-verify-threaded-y") { - igt_assert(run_test(2, bo_write_verify, I915_TILING_Y, 2) == 0); + igt_subtest("bo-write-verify-threaded-y") igt_assert(run_test(5, bo_write_verify, I915_TILING_Y, 2) == 0); - igt_assert(run_test(10, bo_write_verify, I915_TILING_Y, 2) == 0); - igt_assert(run_test(20, bo_write_verify, I915_TILING_Y, 2) == 0); - } igt_subtest("bo-copy") igt_assert(run_test(1, bo_copy, I915_TILING_X, 1) == 0); |