]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Reduce ctx->engine_mutex for reading the clone source
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jan 2021 13:56:10 +0000 (13:56 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 15 Jan 2021 08:00:03 +0000 (08:00 +0000)
commit6e28f1f4001318706e29f9431503f6bb38d4e675
treece3adc436f24368bc14819347f430ce10e80c77b
parentfbfd6909368d7461e358f05a699b77fb3260b838
drm/i915/gem: Reduce ctx->engine_mutex for reading the clone source

When cloning the engines from the source context, we need to ensure that
the engines are not freed as we copy them, and that the flags we clone
from the source correspond with the engines we copy across. To do this
we need only take a reference to the src->engines, rather than hold the
src->engine_mutex, so long as we verify that nothing changed under the
read.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210114135612.13210-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c