drm/i915/selftests: Exercise far preemption rollbacks
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 16 Jun 2020 18:55:17 +0000 (19:55 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 16 Jun 2020 23:32:29 +0000 (00:32 +0100)
commit9199c070cdde5ef5959c81d76608f992846fe894
tree3ee3280eb991b639f4add02e67fd4def8987ea5f
parent223128f767102127bf651a509df745fb6d56b3fb
drm/i915/selftests: Exercise far preemption rollbacks

Not too long ago, we realised we had issues with a rolling back a
context so far for a preemption request we considered the resubmit not
to be a rollback but a forward roll. This means we would issue a lite
restore instead of forcing a full restore, continuing execution of the
old requests rather than causing a preemption. Add a selftest to
exercise such a far rollback, such that if we were to skip the full
restore, we would execute invalid instructions in the ring and hang.

Note that while I was able to confirm that this causes us to do a
lite-restore preemption rollback (with commit e36ba817fa96 ("drm/i915/gt:
Incrementally check for rewinding") disabled), it did not trick the HW
into rolling past the old RING_TAIL. Myybe on other HW.

References: e36ba817fa96 ("drm/i915/gt: Incrementally check for rewinding")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200616185518.11948-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/selftest_lrc.c