tests/gem_ring_sync_loop: Exercise all rings

Fix the engine selection to exercise all possible rings and in doing so
completely obsoletes gem_multi_bsd_sync_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2016-03-14 13:36:56 +00:00
parent 3d9bcd0804
commit e5abd779cf
3 changed files with 9 additions and 166 deletions
+9 -3
View File
@@ -39,12 +39,19 @@ static void
sync_loop(int fd)
{
const uint32_t bbe = MI_BATCH_BUFFER_END;
int num_rings = gem_get_num_rings(fd);
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 object[2];
struct drm_i915_gem_relocation_entry reloc[1];
unsigned engines[16];
unsigned nengine;
unsigned engine;
int i;
nengine = 0;
for_each_engine(fd, engine)
engines[nengine++] = engine;
igt_require(nengine);
memset(object, 0, sizeof(object));
object[0].handle = gem_create(fd, 4096);
object[0].flags = EXEC_OBJECT_WRITE;
@@ -74,7 +81,7 @@ sync_loop(int fd)
srandom(0xdeadbeef);
for (i = 0; i < SLOW_QUICK(0x100000, 10); i++) {
execbuf.flags = random() % num_rings + 1;
execbuf.flags = engines[rand() % nengine];
gem_execbuf(fd, &execbuf);
}
@@ -88,7 +95,6 @@ igt_simple_main
int fd;
fd = drm_open_driver(DRIVER_INTEL);
igt_require(gem_get_num_rings(fd) > 1);
intel_detect_and_clear_missed_interrupts(fd);
sync_loop(fd);