@@ -505,6 +505,7 @@ void intel_engine_setup_common(struct intel_engine_cs *engine)
i915_timeline_init(engine->i915, &engine->timeline, engine->name);
memset(&engine->last_sseu, 0, sizeof(engine->last_sseu));
+ atomic_set(&engine->sseu_transitions, 0);
intel_engine_init_execlist(engine);
intel_engine_init_hangcheck(engine);
@@ -1439,6 +1440,8 @@ void intel_engine_dump(struct intel_engine_cs *engine,
hexdump(m, engine->status_page.page_addr, PAGE_SIZE);
drm_printf(m, "Idle? %s\n", yesno(intel_engine_is_idle(engine)));
+
+ drm_printf(m, "Powergating transitions: %u\n", atomic_read(&engine->sseu_transitions));
}
static u8 user_class_map[] = {
@@ -542,6 +542,7 @@ static void maybe_enable_noa_reprogram(struct i915_request *rq)
*cs++ = upper_32_bits(engine->noa_reprogram_vma->node.start);
engine->last_sseu = rq->sseu;
+ atomic_inc(&engine->sseu_transitions);
}
static void port_assign(struct execlist_port *port, struct i915_request *rq)
@@ -357,6 +357,12 @@ struct intel_engine_cs {
*/
union intel_sseu last_sseu;
+ /**
+ * @sseu_transitions: A counter of the number of powergating
+ * transition this engine has gone through.
+ */
+ atomic_t sseu_transitions;
+
atomic_t irq_count;
unsigned long irq_posted;
#define ENGINE_IRQ_BREADCRUMB 0
This can be used to monitor the number of powergating transition changes for a particular workload. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> --- drivers/gpu/drm/i915/intel_engine_cs.c | 3 +++ drivers/gpu/drm/i915/intel_lrc.c | 1 + drivers/gpu/drm/i915/intel_ringbuffer.h | 6 ++++++ 3 files changed, 10 insertions(+)