All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/guc: Support engine busy stats
@ 2018-02-21 17:25 Tvrtko Ursulin
  2018-02-21 17:25 ` [PATCH 2/2] drm/i915: GuC test run Tvrtko Ursulin
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 17:25 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Place context in/out hooks into the GuC backend, when contexts are
assigned to ports, and removed from them, in order to be able to
provide engine busy stats in GuC mode.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Testcase: igt/perf_pmu/busy-accuracy-*-*
---
 drivers/gpu/drm/i915/intel_guc_submission.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
index 946766b62459..fab5033b9987 100644
--- a/drivers/gpu/drm/i915/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/intel_guc_submission.c
@@ -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;
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-02-22  9:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 17:25 [PATCH 1/2] drm/i915/guc: Support engine busy stats Tvrtko Ursulin
2018-02-21 17:25 ` [PATCH 2/2] drm/i915: GuC test run Tvrtko Ursulin
2018-02-21 17:41 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/guc: Support engine busy stats Patchwork
2018-02-21 17:56 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-02-21 19:17 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2018-02-21 19:31 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-02-22  6:07 ` [PATCH 1/2] " Tvrtko Ursulin
2018-02-22  7:51   ` Chris Wilson
2018-02-22  8:26     ` Tvrtko Ursulin
2018-02-22  8:31       ` Chris Wilson
2018-02-22  6:30 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/guc: Support engine busy stats (rev2) Patchwork
2018-02-22  6:44 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-22  9:01 ` ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.