diff mbox

[2/2] drm/i915/execlists: Distinguish the incomplete context notifies

Message ID F3B0350DF4CB6849A642218320DE483D7D645F0E@SHSMSX101.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang, Zhi A Sept. 26, 2017, 10:42 a.m. UTC
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:chris@chris-wilson.co.uk] 
Sent: Tuesday, September 26, 2017 1:17 PM
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>; Zhenyu Wang <zhenyuw@linux.intel.com>; Wang, Zhi A <zhi.a.wang@intel.com>; Winiarski, Michal <michal.winiarski@intel.com>; Mika Kuoppala <mika.kuoppala@linux.intel.com>; Ursulin, Tvrtko <tvrtko.ursulin@intel.com>
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 <chris@chris-wilson.co.uk>
Cc: "Zhenyu Wang" <zhenyuw@linux.intel.com>
Cc: "Wang, Zhi A" <zhi.a.wang@intel.com>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-  drivers/gpu/drm/i915/intel_lrc.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

--
2.14.1

Comments

Chris Wilson Sept. 26, 2017, 10:48 a.m. UTC | #1
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
diff mbox

Patch

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 */