summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-11 00:21:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-11 00:23:30 +0100
commita355b2d6eb428f8c64ff7251a32e40d81ea4bbec (patch)
tree9880e61afeed52f12b38b58c37354478694ec567 /tests
parent1c2c593363012b60e7b64ac2f39b0afb63cd1b83 (diff)
igt/gem_exec_reloc: Filter out unavailable addresses for !ppgtt
In the old shared GTT modes, some addresses may already be in use and so we cannot pin our objects there. Skip placing objects to those locations for maximum test coverage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_reloc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/gem_exec_reloc.c b/tests/gem_exec_reloc.c
index b98c89b6..f6142714 100644
--- a/tests/gem_exec_reloc.c
+++ b/tests/gem_exec_reloc.c
@@ -530,13 +530,19 @@ static void basic_range(int fd, unsigned flags)
memset(obj, 0, sizeof(obj));
memset(reloc, 0, sizeof(reloc));
+ memset(&execbuf, 0, sizeof(execbuf));
n = 0;
for (int i = 0; i <= count; i++) {
obj[n].handle = gem_create(fd, 4096);
obj[n].offset = (1ull << (i + 12)) - 4096;
- obj[n].offset = gen8_canonical_address(obj[i].offset);
+ obj[n].offset = gen8_canonical_address(obj[n].offset);
obj[n].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+ gem_write(fd, obj[n].handle, 0, &bbe, sizeof(bbe));
+ execbuf.buffers_ptr = to_user_pointer(&obj[n]);
+ execbuf.buffer_count = 1;
+ if (__gem_execbuf(fd, &execbuf))
+ continue;
igt_debug("obj[%d] handle=%d, address=%llx\n",
n, obj[n].handle, (long long)obj[n].offset);
@@ -552,6 +558,11 @@ static void basic_range(int fd, unsigned flags)
obj[n].offset = 1ull << (i + 12);
obj[n].offset = gen8_canonical_address(obj[n].offset);
obj[n].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+ gem_write(fd, obj[n].handle, 0, &bbe, sizeof(bbe));
+ execbuf.buffers_ptr = to_user_pointer(&obj[n]);
+ execbuf.buffer_count = 1;
+ if (__gem_execbuf(fd, &execbuf))
+ continue;
igt_debug("obj[%d] handle=%d, address=%llx\n",
n, obj[n].handle, (long long)obj[n].offset);
@@ -562,12 +573,13 @@ static void basic_range(int fd, unsigned flags)
reloc[n].presumed_offset = -1;
n++;
}
+ igt_require(n);
+
obj[n].handle = gem_create(fd, 4096);
obj[n].relocs_ptr = to_user_pointer(reloc);
obj[n].relocation_count = n;
gem_write(fd, obj[n].handle, 0, &bbe, sizeof(bbe));
- memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = to_user_pointer(obj);
execbuf.buffer_count = n + 1;