summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-07-12 12:08:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-07-12 12:11:50 +0100
commitdffc233ae25866fa7a632b6237fee43dbbaeaf32 (patch)
tree508ccb8257da1d79a942dbb886ab79f0e29b0bc0 /lib
parentb793b4b40e42300f165dd3fdd670c2a85bd657c6 (diff)
lib/i915: Set NO_RELOC flag for spinners
We write the addresses into the batch and fill in the presumed_offset and execobj.offset correctly, so we meet the no-relocation requirements and so can normally avoid relocations. In order to let the kernel know it can trust us, we should also set the I915_EXEC_NO_RELOC flags. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_dummyload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index f79f16dee..26ea154ac 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -121,11 +121,10 @@ emit_recursive_batch(igt_spin_t *spin,
}
igt_require(nengine);
- memset(&spin->execbuf, 0, sizeof(spin->execbuf));
- execbuf = &spin->execbuf;
- memset(spin->obj, 0, sizeof(spin->obj));
- obj = spin->obj;
memset(relocs, 0, sizeof(relocs));
+ execbuf = memset(&spin->execbuf, 0, sizeof(spin->execbuf));
+ execbuf->flags = I915_EXEC_NO_RELOC;
+ obj = memset(spin->obj, 0, sizeof(spin->obj));
obj[BATCH].handle = gem_create(fd, BATCH_SIZE);
batch = gem_mmap__device_coherent(fd, obj[BATCH].handle,
@@ -146,6 +145,7 @@ emit_recursive_batch(igt_spin_t *spin,
/* dummy write to dependency */
obj[SCRATCH].handle = opts->dependency;
obj[SCRATCH].offset = addr;
+ obj[SCRATCH].flags = EXEC_OBJECT_WRITE;
r->presumed_offset = obj[SCRATCH].offset;
r->target_handle = obj[SCRATCH].handle;