[Intel-gfx] [PATCH 1/5] drm/i915: Only enqueue already completed requests

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Aug 6 14:25:49 UTC 2019


Chris Wilson <chris at chris-wilson.co.uk> writes:

> If we are asked to submit a completed request, just move it onto the
> active-list without modifying it's payload.
>

If the seqno is there then there is no need to write
it yes.

But I am not at all certain that I deduced the 'why'
part correctly so please spell it out.

-Mika


> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_request.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 8ac7d14ec8c9..69fc66bd1125 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -397,6 +397,9 @@ void __i915_request_submit(struct i915_request *request)
>  	GEM_BUG_ON(!irqs_disabled());
>  	lockdep_assert_held(&engine->active.lock);
>  
> +	if (i915_request_completed(request))
> +		goto xfer;
> +
>  	if (i915_gem_context_is_banned(request->gem_context))
>  		i915_request_skip(request, -EIO);
>  
> @@ -420,7 +423,13 @@ void __i915_request_submit(struct i915_request *request)
>  	    i915_sw_fence_signaled(&request->semaphore))
>  		engine->saturated |= request->sched.semaphores;
>  
> +	engine->emit_fini_breadcrumb(request,
> +				     request->ring->vaddr + request->postfix);
> +
> +	engine->serial++;
> +
>  	/* We may be recursing from the signal callback of another i915 fence */
> +xfer:
>  	spin_lock_nested(&request->lock, SINGLE_DEPTH_NESTING);
>  
>  	list_move_tail(&request->sched.link, &engine->active.requests);
> @@ -437,11 +446,6 @@ void __i915_request_submit(struct i915_request *request)
>  
>  	spin_unlock(&request->lock);
>  
> -	engine->emit_fini_breadcrumb(request,
> -				     request->ring->vaddr + request->postfix);
> -
> -	engine->serial++;
> -
>  	trace_i915_request_execute(request);
>  }
>  
> -- 
> 2.23.0.rc1
>
> _______________________________________________
> 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