From 426d0073fb6d1a9513978cea4c9e8396f3721fba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 29 Apr 2020 21:54:41 +0100 Subject: 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 Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200429205446.3259-1-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/selftests/i915_request.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/drm/i915/selftests/i915_request.c') diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index 3b319c0953cb..15b1ca9f7a01 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -1679,8 +1679,7 @@ static int perf_series_engines(void *arg) p->engine = ps->ce[idx]->engine; intel_engine_pm_get(p->engine); - if (intel_engine_supports_stats(p->engine) && - !intel_enable_engine_stats(p->engine)) + if (intel_engine_supports_stats(p->engine)) p->busy = intel_engine_get_busy_time(p->engine) + 1; p->runtime = -intel_context_get_total_runtime_ns(ce); p->time = ktime_get(); @@ -1700,7 +1699,6 @@ static int perf_series_engines(void *arg) if (p->busy) { p->busy = ktime_sub(intel_engine_get_busy_time(p->engine), p->busy - 1); - intel_disable_engine_stats(p->engine); } err = switch_to_kernel_sync(ce, err); @@ -1762,8 +1760,7 @@ static int p_sync0(void *arg) } busy = false; - if (intel_engine_supports_stats(engine) && - !intel_enable_engine_stats(engine)) { + if (intel_engine_supports_stats(engine)) { p->busy = intel_engine_get_busy_time(engine); busy = true; } @@ -1796,7 +1793,6 @@ static int p_sync0(void *arg) if (busy) { p->busy = ktime_sub(intel_engine_get_busy_time(engine), p->busy); - intel_disable_engine_stats(engine); } err = switch_to_kernel_sync(ce, err); @@ -1830,8 +1826,7 @@ static int p_sync1(void *arg) } busy = false; - if (intel_engine_supports_stats(engine) && - !intel_enable_engine_stats(engine)) { + if (intel_engine_supports_stats(engine)) { p->busy = intel_engine_get_busy_time(engine); busy = true; } @@ -1866,7 +1861,6 @@ static int p_sync1(void *arg) if (busy) { p->busy = ktime_sub(intel_engine_get_busy_time(engine), p->busy); - intel_disable_engine_stats(engine); } err = switch_to_kernel_sync(ce, err); @@ -1899,8 +1893,7 @@ static int p_many(void *arg) } busy = false; - if (intel_engine_supports_stats(engine) && - !intel_enable_engine_stats(engine)) { + if (intel_engine_supports_stats(engine)) { p->busy = intel_engine_get_busy_time(engine); busy = true; } @@ -1924,7 +1917,6 @@ static int p_many(void *arg) if (busy) { p->busy = ktime_sub(intel_engine_get_busy_time(engine), p->busy); - intel_disable_engine_stats(engine); } err = switch_to_kernel_sync(ce, err); -- cgit v1.2.3-59-g8ed1b