drm/i915/selftests: Exercise adding requests to a full GGTT
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 12 Oct 2017 12:57:26 +0000 (13:57 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 12 Oct 2017 20:06:26 +0000 (21:06 +0100)
commit9c1477e83e629632758518cde4a039d62a1000e7
tree98c95f9178448b758f1ede5ba6afb209f1b8b540
parent214707fc2ce08d09982bc4fe4b7a1c1f010e82be
drm/i915/selftests: Exercise adding requests to a full GGTT

A bug recently encountered involved the issue where are we were
submitting requests to different ppGTT, each would pin a segment of the
GGTT for its logical context and ring. However, this is invisible to
eviction as we do not tie the context/ring VMA to a request and so do
not automatically wait upon it them (instead they are marked as pinned,
preventing eviction entirely). Instead the eviction code must flush those
contexts by switching to the kernel context. This selftest tries to
fill the GGTT with contexts to exercise a path where the
switch-to-kernel-context failed to make forward progress and we fail
with ENOSPC.

v2: Make the hole in the filled GGTT explicit.
v3: Swap out the arbitrary timeout for a private notification from
i915_gem_evict_something()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171012125726.14736-3-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/selftests/i915_gem_evict.c
drivers/gpu/drm/i915/selftests/i915_live_selftests.h
drivers/gpu/drm/i915/selftests/mock_context.c