diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-11 14:16:13 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-11 14:21:46 +0000 |
commit | 6291678f316405ddd6885831701b7512228218b2 (patch) | |
tree | 31c6e1ec8a11e47cdd269a7bdd6f7f5e112eb752 /tests/gem_exec_whisper.c | |
parent | d99db0990e6b6aae43bcda13dc0f6e46335cffa8 (diff) |
igt/gem_exec_whisper: Stop passing NO_RELOC
We don't preserve the execobj.offset nor set the right values into the
batches between iterations.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_whisper.c')
-rw-r--r-- | tests/gem_exec_whisper.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c index 8031e684..a127b471 100644 --- a/tests/gem_exec_whisper.c +++ b/tests/gem_exec_whisper.c @@ -137,6 +137,7 @@ static void whisper(int fd, unsigned flags) for (n = 0; n < 1024; n++) { batches[n].handle = gem_create(fd, 4096); inter[n] = reloc; + inter[n].presumed_offset = ~0; inter[n].delta = sizeof(uint32_t) * loc; batches[n].relocs_ptr = (uintptr_t)&inter[n]; batches[n].relocation_count = 1; @@ -152,44 +153,44 @@ static void whisper(int fd, unsigned flags) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)tmp; execbuf.buffer_count = 2; - execbuf.flags = 1 << 11 | 1 << 12; + execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; memset(tmp, 0, sizeof(tmp)); tmp[0].handle = scratch; - tmp[1].handle = gem_create(fd, 4096); reloc.presumed_offset = ~0; reloc.delta = 4*pass; batch[loc] = ~pass; + tmp[1].handle = gem_create(fd, 4096); gem_write(fd, tmp[1].handle, 0, batch, sizeof(batch)); tmp[1].relocs_ptr = (uintptr_t)&reloc; tmp[1].relocation_count = 1; execbuf.flags &= ~ENGINE_MASK; igt_require(__gem_execbuf(fd, &execbuf) == 0); - gem_close(fd, tmp[1].handle); - batch[loc] = pass; - gem_write(fd, batches[0].handle, 0, batch, sizeof(batch)); - inter[0].presumed_offset = 0; - for (n = 0; n < 1023; n++) { - tmp[0] = batches[n+1]; - tmp[0].relocation_count = 0; - tmp[1] = batches[n]; + gem_write(fd, batches[1023].handle, 4*loc, &pass, sizeof(pass)); + for (n = 1024; --n >= 1; ) { + execbuf.buffers_ptr = (uintptr_t)&batches[n-1]; + batches[n-1].relocation_count = 0; execbuf.flags &= ~ENGINE_MASK; execbuf.flags |= engines[rand() % nengine]; if (flags & CONTEXTS) execbuf.rsvd1 = contexts[rand() % 64]; gem_execbuf(fd, &execbuf); + + batches[n-1].relocation_count = 1; } + execbuf.flags &= ~ENGINE_MASK; execbuf.rsvd1 = 0; + execbuf.buffers_ptr = (uintptr_t)&tmp; - tmp[0].handle = gem_create(fd, 4096); - gem_write(fd, tmp[0].handle, 0, batch, sizeof(batch)); - tmp[1] = batches[n]; - execbuf.flags &= ~ENGINE_MASK; + tmp[0] = tmp[1]; + tmp[0].relocation_count = 0; + tmp[1] = batches[0]; gem_execbuf(fd, &execbuf); + batches[0] = tmp[1]; tmp[1] = tmp[0]; tmp[0].handle = scratch; |