drm/i915/execlists: Distinguish the incomplete context notifies
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 3 Oct 2017 20:34:47 +0000 (21:34 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Oct 2017 16:52:45 +0000 (17:52 +0100)
Let the listener know that the context we just scheduled out was not
complete, and will be scheduled back in at a later point.

v2: Handle CONTEXT_STATUS_PREEMPTED in gvt by aliasing it to
CONTEXT_STATUS_OUT for the moment, gvt can expand upon the difference
later.

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>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gvt/scheduler.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_lrc.h

index d5892d24f0b6ad2c9330f5dff3aedeae820050a1..f6ded475bb2cc4dec19697b01e1e37c2c015f7dd 100644 (file)
@@ -174,6 +174,7 @@ static int shadow_context_status_change(struct notifier_block *nb,
                atomic_set(&workload->shadow_ctx_active, 1);
                break;
        case INTEL_CONTEXT_SCHEDULE_OUT:
+       case INTEL_CONTEXT_SCHEDULE_PREEMPTED:
                atomic_set(&workload->shadow_ctx_active, 0);
                break;
        default:
index 6ea5ecf0823008b956e02a0ffc72111973ce8ac6..a89bc1f148fbf0d40d3de1b3563d7ec1610746e5 100644 (file)
@@ -617,7 +617,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));
index 314adee7127a5f93473d3e3a227dc7e6d8f0a8bf..689fde1a63a90c7a2c0d2aa54a289a232c4d2464 100644 (file)
@@ -61,6 +61,7 @@
 enum {
        INTEL_CONTEXT_SCHEDULE_IN = 0,
        INTEL_CONTEXT_SCHEDULE_OUT,
+       INTEL_CONTEXT_SCHEDULE_PREEMPTED,
 };
 
 /* Logical Rings */