drm/i915: Add live selftests for indirect ctx batchbuffers
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Fri, 24 Apr 2020 21:48:40 +0000 (00:48 +0300)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 25 Apr 2020 18:08:18 +0000 (19:08 +0100)
commit1dd47b54baeac460f677a3c8bb347b2ffed56d4d
tree6c28e50211361236ac03e9f6f8346028bd1031c8
parent685d21096f6ceb44bda186dd42520f2a9d21d1aa
drm/i915: Add live selftests for indirect ctx batchbuffers

Indirect ctx batchbuffers are a hw feature of which
batch can be run, by hardware, during context restoration stage.
Driver can setup a batchbuffer and also an offset into the
context image. When context image is marshalled from
memory to registers, and when the offset from the start of
context register state is equal of what driver pre-determined,
batch will run. So one can manipulate context restoration
process at cacheline granularity, given some limitations,
as you need to have rudimentaries in place before you can
run a batch.

Add selftest which will write the ring start register
to a canary spot. This will test that hardware will run a
batchbuffer for the context in question.

v2: request wait fix, naming (Chris)
v3: test order (Chris)
v4: rebase

Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200424214841.28076-3-mika.kuoppala@linux.intel.com
drivers/gpu/drm/i915/gt/selftest_lrc.c