diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-27 14:17:53 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-27 14:47:19 +0000 |
commit | d1308990842fec5f523c129951a5c649d817be81 (patch) | |
tree | faeb8deee51d4980e2d33b1b2ce394ed89891f3a /tests/gem_sync.c | |
parent | dd6b45235b5f1eea9b37e686460fdf1a1c56f431 (diff) |
igt/gem_sync: Use common array of rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_sync.c')
-rw-r--r-- | tests/gem_sync.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/tests/gem_sync.c b/tests/gem_sync.c index 8450bcd0..48d2dfda 100644 --- a/tests/gem_sync.c +++ b/tests/gem_sync.c @@ -66,7 +66,7 @@ out: } static void -sync_ring(int fd, int ring, unsigned flags) +sync_ring(int fd, unsigned ring) { const uint32_t bbe = MI_BATCH_BUFFER_END; struct drm_i915_gem_execbuffer2 execbuf; @@ -74,6 +74,8 @@ sync_ring(int fd, int ring, unsigned flags) double start, elapsed; unsigned long cycles; + gem_require_ring(fd, ring); + intel_detect_and_clear_missed_interrupts(fd); memset(&object, 0, sizeof(object)); @@ -83,9 +85,8 @@ sync_ring(int fd, int ring, unsigned flags) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)&object; execbuf.buffer_count = 1; - execbuf.flags = ring | flags; - - igt_require(__gem_execbuf(fd, &execbuf) == 0); + execbuf.flags = ring; + gem_execbuf(fd, &execbuf); srandom(0xdeadbeef); @@ -104,6 +105,7 @@ sync_ring(int fd, int ring, unsigned flags) igt_main { + const struct intel_execution_engine *e; int fd = -1; igt_skip_on_simulation(); @@ -111,18 +113,9 @@ igt_main igt_fixture fd = drm_open_driver(DRIVER_INTEL); - igt_subtest("basic-render") - sync_ring(fd, I915_EXEC_RENDER, 0); - igt_subtest("basic-blt") - sync_ring(fd, I915_EXEC_BLT, 0); - igt_subtest("bsd") - sync_ring(fd, I915_EXEC_BSD, 0); - igt_subtest("bsd1") - sync_ring(fd, I915_EXEC_BSD, 1<<13 /*I915_EXEC_BSD_RING1*/); - igt_subtest("bsd2") - sync_ring(fd, I915_EXEC_BSD, 2<<13 /*I915_EXEC_BSD_RING2*/); - igt_subtest("vebox") - sync_ring(fd, I915_EXEC_VEBOX, 0); + for (e = intel_execution_engines; e->name; e++) + igt_subtest_f("basic-%s", e->name) + sync_ring(fd, e->exec_id | e->flags); igt_fixture close(fd); |