igt/gem_sync: Use common array of rings

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-01-27 14:17:53 +00:00
parent dd6b45235b
commit d130899084

View File

@ -66,7 +66,7 @@ out:
} }
static void static void
sync_ring(int fd, int ring, unsigned flags) sync_ring(int fd, unsigned ring)
{ {
const uint32_t bbe = MI_BATCH_BUFFER_END; const uint32_t bbe = MI_BATCH_BUFFER_END;
struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_execbuffer2 execbuf;
@ -74,6 +74,8 @@ sync_ring(int fd, int ring, unsigned flags)
double start, elapsed; double start, elapsed;
unsigned long cycles; unsigned long cycles;
gem_require_ring(fd, ring);
intel_detect_and_clear_missed_interrupts(fd); intel_detect_and_clear_missed_interrupts(fd);
memset(&object, 0, sizeof(object)); memset(&object, 0, sizeof(object));
@ -83,9 +85,8 @@ sync_ring(int fd, int ring, unsigned flags)
memset(&execbuf, 0, sizeof(execbuf)); memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)&object; execbuf.buffers_ptr = (uintptr_t)&object;
execbuf.buffer_count = 1; execbuf.buffer_count = 1;
execbuf.flags = ring | flags; execbuf.flags = ring;
gem_execbuf(fd, &execbuf);
igt_require(__gem_execbuf(fd, &execbuf) == 0);
srandom(0xdeadbeef); srandom(0xdeadbeef);
@ -104,6 +105,7 @@ sync_ring(int fd, int ring, unsigned flags)
igt_main igt_main
{ {
const struct intel_execution_engine *e;
int fd = -1; int fd = -1;
igt_skip_on_simulation(); igt_skip_on_simulation();
@ -111,18 +113,9 @@ igt_main
igt_fixture igt_fixture
fd = drm_open_driver(DRIVER_INTEL); fd = drm_open_driver(DRIVER_INTEL);
igt_subtest("basic-render") for (e = intel_execution_engines; e->name; e++)
sync_ring(fd, I915_EXEC_RENDER, 0); igt_subtest_f("basic-%s", e->name)
igt_subtest("basic-blt") sync_ring(fd, e->exec_id | e->flags);
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);
igt_fixture igt_fixture
close(fd); close(fd);