@@ -675,6 +675,7 @@ static void guc_dequeue(struct intel_engine_cs *engine)
struct intel_engine_execlists * const execlists = &engine->execlists;
struct execlist_port *port = execlists->port;
struct drm_i915_gem_request *last = NULL;
+ struct i915_gem_context *last_ctx = NULL;
const struct execlist_port * const last_port =
&execlists->port[execlists->port_mask];
bool submit = false;
@@ -720,8 +721,13 @@ static void guc_dequeue(struct intel_engine_cs *engine)
goto done;
}
- if (submit)
+ if (submit) {
port_assign(port, last);
+ if (last->ctx != last_ctx) {
+ intel_engine_context_in(last->engine);
+ last_ctx = last->ctx;
+ }
+ }
port++;
}
@@ -744,6 +750,8 @@ static void guc_dequeue(struct intel_engine_cs *engine)
execlists->first = rb;
if (submit) {
port_assign(port, last);
+ if (last->ctx != last_ctx)
+ intel_engine_context_in(last->engine);
execlists_set_active(execlists, EXECLISTS_ACTIVE_USER);
guc_submit(engine);
}
@@ -766,6 +774,7 @@ static void guc_submission_tasklet(unsigned long data)
rq = port_request(&port[0]);
while (rq && i915_gem_request_completed(rq)) {
+ intel_engine_context_out(rq->engine);
trace_i915_gem_request_out(rq);
i915_gem_request_put(rq);
@@ -1195,8 +1204,6 @@ int intel_guc_submission_enable(struct intel_guc *guc)
execlists->tasklet.func = guc_submission_tasklet;
engine->park = guc_submission_park;
engine->unpark = guc_submission_unpark;
-
- engine->flags &= ~I915_ENGINE_SUPPORTS_STATS;
}
return 0;