]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Prune the reservation shared fence array
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Nov 2017 22:06:56 +0000 (22:06 +0000)
committerJani Nikula <jani.nikula@intel.com>
Thu, 9 Nov 2017 14:18:33 +0000 (16:18 +0200)
commit8a1a9578252dad7a43e933be95890186a43e63ac
tree078bf3254147293bf1cb67126050599fd4a47512
parent485f7b4604539b74f656aea41b450e823a2d5fc7
drm/i915: Prune the reservation shared fence array

The shared fence array is not autopruning and may continue to grow as an
object is shared between new timelines. Take the opportunity when we
think the object is idle (we have to confirm that any external fence is
also signaled) to decouple all the fences.

We apply a similar trick after waiting on an object, see commit
a57848c95b51 ("drm/i915: Remove completed fences after a wait")

v2: No longer need to handle the batch pool as a special case.
v3: Need to trylock from within i915_vma_retire as this may be called
form the shrinker - and we may later try to allocate underneath the
reservation lock, so a deadlock is possible.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102936
Fixes: ef27cac827fa ("drm/i915: Move GEM activity tracking into a common struct reservation_object")
Fixes: b2cb09a80777 ("drm/i915: Enable multiple timelines")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171107220656.5020-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 1ab22356b37ab08a391d6f007fda4c822bef9fb5)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_vma.c