drm/i915: Shrink search list for active timelines
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 15 May 2018 14:31:49 +0000 (15:31 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 16 May 2018 06:32:10 +0000 (07:32 +0100)
commitf75f91574617a3c6fbc821c6b156f5777a59d0ed
tree71757e711a9485b25e376c95a0249af06a9120d3
parent01f83786f9ab9c8883ce634cb9a0de51086ad7ea
drm/i915: Shrink search list for active timelines

When switching to the kernel context, we force the switch to occur after
all currently active requests (so that we know the GPU won't switch
immediately away and the kernel context remains current as we work). To
do so we have to inspect all the timelines and add a fence from the
active work to queue our switch afterwards. We can use the tracked set
of active rings to shrink our search for active timelines.

v2: Use a local to shrink the list_for_each_entry()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180515143149.4795-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_context.c