Re: [Intel-gfx] [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context notifies

2017-09-26 Thread Chris Wilson
Quoting Wang, Zhi A (2017-09-26 11:42:48)
> Thanks for the patch! :)
> 
> I got a question: Will the re-scheduling of the request be handled by i915? 
> Or the client has to re-submit the request by itself after it got preempted? 
> :)

It remains in the execlist queue, so it will be rescheduled at the
next opportunity. At the moment, that will be after the reset; but in
the future that will also include after the preemption event is over.
 
> Currently, we will call i915_wait_request() to wait the request. I guess the 
> preemption will not wake up the i915_wait_request() with a EINTR?

Correct, The i915_wait_request() will continue, and will not return
until the request has been rescheduled and completed. (Except in the
case where we are cancelling the request due to the driver exploding, in
which case we will wake up the i915_wait_request() as we will signal all
the outstanding requests, but they will be marked as in error.)
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context notifies

2017-09-26 Thread Wang, Zhi A
Thanks for the patch! :)

I got a question: Will the re-scheduling of the request be handled by i915? Or 
the client has to re-submit the request by itself after it got preempted? :)

Currently, we will call i915_wait_request() to wait the request. I guess the 
preemption will not wake up the i915_wait_request() with a EINTR?

Thanks,
Zhi.

-Original Message-
From: Chris Wilson [mailto:ch...@chris-wilson.co.uk] 
Sent: Tuesday, September 26, 2017 1:17 PM
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson ; Zhenyu Wang 
; Wang, Zhi A ; Winiarski, 
Michal ; Mika Kuoppala 
; Ursulin, Tvrtko 
Subject: [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context 
notifies

Let the listener know that the context we just scheduled out was not complete, 
and will be scheduled back in at a later point.

Signed-off-by: Chris Wilson 
Cc: "Zhenyu Wang" 
Cc: "Wang, Zhi A" 
Cc: MichaƂ Winiarski 
Cc: Mika Kuoppala 
Cc: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-  drivers/gpu/drm/i915/intel_lrc.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 61cac26a8b05..79fe5f807098 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -580,7 +580,7 @@ execlist_cancel_port_requests(struct intel_engine_execlists 
*execlists)
while (num_ports-- && port_isset(port)) {
struct drm_i915_gem_request *rq = port_request(port);
 
-   execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_OUT);
+   execlists_context_status_change(rq, 
+INTEL_CONTEXT_SCHEDULE_PREEMPTED);
i915_gem_request_put(rq);
 
memset(port, 0, sizeof(*port));
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
index 314adee7127a..689fde1a63a9 100644
--- a/drivers/gpu/drm/i915/intel_lrc.h
+++ b/drivers/gpu/drm/i915/intel_lrc.h
@@ -61,6 +61,7 @@
 enum {
INTEL_CONTEXT_SCHEDULE_IN = 0,
INTEL_CONTEXT_SCHEDULE_OUT,
+   INTEL_CONTEXT_SCHEDULE_PREEMPTED,
 };
 
 /* Logical Rings */
--
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx