OSDN Git Service

drm/i915/gem: Utilize rcu iteration of context engines
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Apr 2020 12:42:18 +0000 (13:42 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Apr 2020 20:43:53 +0000 (21:43 +0100)
commit89ff76bf9b3b0b86e6bbe344bd6378d8661303fc
tree4925a0a764902a53a0785f3fc67f72e53e5ead5d
parent4c977837ba296e4b601e2b0abd11c4b296e7786b
drm/i915/gem: Utilize rcu iteration of context engines

Now that we can peek at GEM->engines[] and obtain a reference to them
using RCU, do so for instances where we can safely iterate the
potentially old copy of the engines. For setting, we can do this when we
know the engine properties are copied over before swapping, so we know
the new engines already have the global property and we update the old
before they are discarded. For reading, we only need to be safe; as we
do so on behalf of the user, their races are their own problem.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200402124218.6375-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c