From d1308990842fec5f523c129951a5c649d817be81 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 27 Jan 2016 14:17:53 +0000 Subject: [PATCH] igt/gem_sync: Use common array of rings Signed-off-by: Chris Wilson --- tests/gem_sync.c | 25 +++++++++---------------- 1 file 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);