drm/i915/selftest: Check that GPR are restored across noa_wait
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 9 Jul 2020 22:45:04 +0000 (23:45 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 10 Jul 2020 09:20:38 +0000 (10:20 +0100)
commited2690a9ca896882a124ee0bd4eaff9678ed1162
tree3386064df30f367949251d2c70646f6a6f5e2a5b
parente43ff99c8deda85234e6233e0f4af6cb09566a37
drm/i915/selftest: Check that GPR are restored across noa_wait

Perf implements a GPU delay (noa_wait) by looping until the CS timestamp
has passed a certain point. This use MI_MATH and the general purpose
registers of the user's context, and since it is clobbering the user
state it must carefully save and restore the user's data around the
noa_wait. We can verify this by loading some values in the GPR that we
know will be clobbered by the noa_wait, and then inspecting the GPR after
the noa_wait completes and confirming that they have been restored.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200709224504.11345-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_perf.c