summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_engine_types.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-29 21:54:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-30 00:57:34 +0100
commit426d0073fb6d1a9513978cea4c9e8396f3721fba (patch)
treee0e1c1a7971a7b5dd0b0eded8911a2a691c6cff3 /drivers/gpu/drm/i915/gt/intel_engine_types.h
parentbe1cb55a07bfc528d826962f1e421a44ed5f8311 (diff)
drm/i915/gt: Always enable busy-stats for execlists
In the near future, we will utilize the busy-stats on each engine to approximate the C0 cycles of each, and use that as an input to a manual RPS mechanism. That entails having busy-stats always enabled and so we can remove the enable/disable routines and simplify the pmu setup. As a consequence of always having the stats enabled, we can also show the current active time via sysfs/engine/xcs/active_time_ns. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_engine_types.h')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_engine_types.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h
index 483d8ff39a0d..83b1f95ebf12 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
@@ -532,27 +532,15 @@ struct intel_engine_cs {
struct {
/**
- * @lock: Lock protecting the below fields.
- */
- seqlock_t lock;
- /**
- * @enabled: Reference count indicating number of listeners.
- */
- unsigned int enabled;
- /**
* @active: Number of contexts currently scheduled in.
*/
- unsigned int active;
- /**
- * @enabled_at: Timestamp when busy stats were enabled.
- */
- ktime_t enabled_at;
+ atomic_t active;
+
/**
- * @start: Timestamp of the last idle to active transition.
- *
- * Idle is defined as active == 0, active is active > 0.
+ * @lock: Lock protecting the below fields.
*/
- ktime_t start;
+ seqlock_t lock;
+
/**
* @total: Total time this engine was busy.
*
@@ -560,6 +548,13 @@ struct intel_engine_cs {
* where engine is currently busy (active > 0).
*/
ktime_t total;
+
+ /**
+ * @start: Timestamp of the last idle to active transition.
+ *
+ * Idle is defined as active == 0, active is active > 0.
+ */
+ ktime_t start;
} stats;
struct {