Commit dffc233a authored by Chris Wilson's avatar Chris Wilson 🤔

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's avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
parent b793b4b4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment