OSDN Git Service

drm/i915: Keep the most recently used active-fence upon discard
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 31 Jul 2020 08:50:12 +0000 (09:50 +0100)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Mon, 7 Sep 2020 10:18:36 +0000 (13:18 +0300)
commit99a7f4dae7ee6081df04741e0c4ea5e49b139540
tree2d16bacb5fec32fdaff5d1109cdd5d74d62620d8
parent5d9341370f57c058a8d880490ba9e79e761b2d7a
drm/i915: Keep the most recently used active-fence upon discard

Whenever an i915_active idles, we prune its tree of old fence slots to
prevent a gradual leak should it be used to track many, many timelines.
The downside is that we then have to frequently reallocate the rbtree.
A compromise is that we keep the most recently used fence slot, and
reuse that for the next active reference as that is the most likely
timeline to be reused.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Thomas Hellström <thomas.hellstrom@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200731085015.32368-4-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_active.c
drivers/gpu/drm/i915/i915_active.h