summaryrefslogtreecommitdiff
path: root/tests/gem_ringfill.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-03 08:37:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-03 09:27:22 +0100
commitd654aa0d091c0d7ccb7c8b13d00460ad6ce99714 (patch)
treed6ca0a5632fe8240d71b33ef5dfea8c1a35d5bf9 /tests/gem_ringfill.c
parent3edaa1d347e5c91058a5dfab821e57beb5217ccc (diff)
igt/gem_ringfill: Avoid CPU -> GTT -> CPU transition
Avoid the second pair of full clflushes when setting up the batch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_ringfill.c')
-rw-r--r--tests/gem_ringfill.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index f2dc8034..52192d9b 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -103,17 +103,18 @@ static void run_test(int fd, unsigned ring, unsigned flags)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)obj;
- execbuf.buffer_count = 2;
- execbuf.flags = ring | (1 << 11);
+ execbuf.flags = ring | (1 << 11) | (1 << 12);
if (gen < 6)
execbuf.flags |= I915_EXEC_SECURE;
memset(obj, 0, sizeof(obj));
obj[0].handle = gem_create(fd, 4096);
+ gem_write(fd, obj[0].handle, 0, &bbe, sizeof(bbe));
+ execbuf.buffer_count = 1;
+ igt_require(__gem_execbuf(fd, &execbuf) == 0);
+
obj[0].flags |= EXEC_OBJECT_WRITE;
obj[1].handle = gem_create(fd, 1024*16 + 4096);
- gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
- igt_require(__gem_execbuf(fd, &execbuf) == 0);
obj[1].relocs_ptr = (uintptr_t)reloc;
obj[1].relocation_count = 1024;
@@ -128,7 +129,6 @@ static void run_test(int fd, unsigned ring, unsigned flags)
for (i = 0; i < 1024; i++) {
uint64_t offset;
- reloc[i].target_handle = obj[0].handle;
reloc[i].presumed_offset = obj[0].offset;
reloc[i].offset = (b - batch + 1) * sizeof(*batch);
reloc[i].delta = i * sizeof(uint32_t);
@@ -152,6 +152,7 @@ static void run_test(int fd, unsigned ring, unsigned flags)
}
*b++ = MI_BATCH_BUFFER_END;
munmap(batch, 16*1024+4096);
+ execbuf.buffer_count = 2;
gem_execbuf(fd, &execbuf);
check_bo(fd, obj[0].handle);