[Intel-gfx] [PATCH 03/10] drm/i915/gem: Reduce ctx->engine_mutex for reading the clone source

Andi Shyti andi at etezian.org
Thu Jan 14 03:01:42 UTC 2021

Hi Chris,

On Wed, Jan 13, 2021 at 12:45:53PM +0000, Chris Wilson wrote:
> 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 at chris-wilson.co.uk>

Reviewed-by: Andi Shyti <andi.shyti at intel.com>


> +		if (user_engines)
> +			*user_engines = i915_gem_context_user_engines(ctx);
> +

> +		/* successful await => strong mb */

P.S.: mmhhh? :)

>  		if (unlikely(!i915_sw_fence_await(&engines->fence)))
>  			continue;

More information about the Intel-gfx mailing list