drm/i915/gem: Protect used framebuffers from casual eviction
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 19 Jan 2021 21:43:35 +0000 (21:43 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 20 Jan 2021 21:05:12 +0000 (21:05 +0000)
commite956996cb078c590807469be5fd527af5a1cfb14
treee25ab27bb723cb209247bc8eb3abe9ba27bcadfc
parent0175969e489aaa0522e52c7d0ac06f2cab0c1ca7
drm/i915/gem: Protect used framebuffers from casual eviction

In the shrinker, we protect framebuffers from light reclaim as we
typically expect framebuffers to be reused in the near future (and with
low latency requirements). We can apply the same logic to the GGTT
eviction and defer framebuffers to the second pass only used if the
caller is desperate enough to wait for space to become available.
In most cases, the caller will use a smaller partial vma instead of
trying to force the object into the GGTT if doing so will cause other
users to be evicted.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210119214336.1463-5-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/display/intel_frontbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_domain.c
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/i915_vma.h
drivers/gpu/drm/i915/i915_vma_types.h