drm/i915/selftests: exercise emit_pte() with nearly full ring
authorMatthew Auld <matthew.auld@intel.com>
Fri, 2 Dec 2022 12:28:44 +0000 (12:28 +0000)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 12 Dec 2022 09:56:52 +0000 (09:56 +0000)
commite288e178738fff41d90454317d9333d88c263fa1
tree280334cfc46524a4dc0d03157f88acf8fd4cffbe
parentf7f0ca5788d399e5e523c59fd119df359498864d
drm/i915/selftests: exercise emit_pte() with nearly full ring

Simple regression test to check that we don't trample the
rq->reserved_space when returning from emit_pte(), if the ring is nearly
full.

v2: Make spinner_kill() static
v3: Reduce the ring size further, which should mean we need to execute less
    noops; hopefully this appeases bsw. Also add some debug logging.
v4: Fix the min request construction to account for reserved_space +
    I915_EMIT_PTE_NUM_DWORDS
v5: Use a simple on-stack timer to kill the spinner instead of kthread (Chris)

References: https://gitlab.freedesktop.org/drm/intel/-/issues/7535
References: https://gitlab.freedesktop.org/drm/intel/-/issues/6889
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris.p.wilson@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221202122844.428006-3-matthew.auld@intel.com
drivers/gpu/drm/i915/gt/intel_migrate.c
drivers/gpu/drm/i915/gt/selftest_migrate.c