[PATCH i-g-t 09/13] NORELOC - gem_exec_store - store_dword() FIX
Andrzej Turko
andrzej.turko at linux.intel.com
Fri Apr 30 11:07:02 UTC 2021
From: Andrzej Turko <andrzej.turko at intel.com>
---
tests/i915/gem_exec_store.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/tests/i915/gem_exec_store.c b/tests/i915/gem_exec_store.c
index 4b2ae886a..b6ceca16f 100644
--- a/tests/i915/gem_exec_store.c
+++ b/tests/i915/gem_exec_store.c
@@ -48,7 +48,7 @@ static void store_dword(int fd, const struct intel_execution_engine2 *e)
uint32_t batch[16];
uint64_t ahnd;
int i;
- bool do_relocs = !gem_uses_ppgtt(fd);
+ bool do_relocs = gem_has_relocations(fd);
intel_detect_and_clear_missed_interrupts(fd);
memset(&execbuf, 0, sizeof(execbuf));
@@ -62,15 +62,9 @@ static void store_dword(int fd, const struct intel_execution_engine2 *e)
memset(obj, 0, sizeof(obj));
obj[0].handle = gem_create(fd, 4096);
- obj[0].offset = intel_allocator_alloc(ahnd, obj[0].handle,
- 4096, ALIGNMENT);
- obj[0].offset = CANONICAL(obj[0].offset);
- obj[0].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
obj[1].handle = gem_create(fd, 4096);
- obj[1].offset = intel_allocator_alloc(ahnd, obj[1].handle,
- 4096, ALIGNMENT);
- obj[1].offset = CANONICAL(obj[1].offset);
- obj[1].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+
+
if (do_relocs) {
memset(&reloc, 0, sizeof(reloc));
@@ -83,8 +77,17 @@ static void store_dword(int fd, const struct intel_execution_engine2 *e)
obj[1].relocs_ptr = to_user_pointer(&reloc);
obj[1].relocation_count = 1;
} else {
- obj[0].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE;
- obj[1].flags |= EXEC_OBJECT_PINNED;
+ obj[0].offset = intel_allocator_alloc(ahnd, obj[0].handle,
+ 4096, ALIGNMENT);
+ obj[0].offset = CANONICAL(obj[0].offset);
+ obj[0].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS |
+ EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE;
+
+ obj[1].offset = intel_allocator_alloc(ahnd, obj[1].handle,
+ 4096, ALIGNMENT);
+ obj[1].offset = CANONICAL(obj[1].offset);
+ obj[1].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS |
+ EXEC_OBJECT_PINNED;
}
i = 0;
--
2.25.1
More information about the Intel-gfx-trybot
mailing list