[Intel-gfx] [PATCH v2 7/9] drm/i915: Confirm the request is still active before adding it to the await

Michał Winiarski michal.winiarski at intel.com
Wed Apr 12 16:31:45 UTC 2017


On Wed, Apr 12, 2017 at 01:48:23PM +0100, Chris Wilson wrote:
> Although we do check the completion-status of the request before
> actually adding a wait on it (either to its submit fence or its
> completion dma-fence), we currently do not check before adding it to the
> dependency lists.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Reviewed-by: Michał Winiarski <michal.winiarski at intel.com>

-Michał

> ---
>  drivers/gpu/drm/i915/i915_gem_request.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 87ca3453140a..436693b12bae 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -665,6 +665,9 @@ i915_gem_request_await_request(struct drm_i915_gem_request *to,
>  	GEM_BUG_ON(to == from);
>  	GEM_BUG_ON(to->timeline == from->timeline);
>  
> +	if (i915_gem_request_completed(from))
> +		return 0;
> +
>  	if (to->engine->schedule) {
>  		ret = i915_priotree_add_dependency(to->i915,
>  						   &to->priotree,
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list