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

2019-08-06 Thread Chris Wilson
Quoting Mika Kuoppala (2019-08-06 15:25:49)
> Chris Wilson  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.

Because if the request is complete, we may have moved the ring->head
during retirement (or in the new reset-on-completion) past the breadcrumb
and generate warnings for appearing to go backwards.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

2019-08-06 Thread Mika Kuoppala
Chris Wilson  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 
> ---
>  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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

2019-08-06 Thread Chris Wilson
If we are asked to submit a completed request, just move it onto the
active-list without modifying it's payload.

Signed-off-by: Chris Wilson 
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx