From: Tvrtko Ursulin Date: Fri, 19 May 2023 15:49:42 +0000 (-0700) Subject: drm/i915/pmu: Skip sampling engines with no enabled counters X-Git-Tag: v6.5-rc1~28^2~19^2~5 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=08322dabb5cbce75e210d8df4774fc078ed7161c;p=linux-block.git drm/i915/pmu: Skip sampling engines with no enabled counters As we have more and more engines do not waste time sampling the ones no- one is monitoring. Signed-off-by: Tvrtko Ursulin Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230519154946.3751971-4-umesh.nerlige.ramappa@intel.com --- diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 9edf87ee5d10..6d594f67f365 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -350,6 +350,9 @@ engines_sample(struct intel_gt *gt, unsigned int period_ns) return; for_each_engine(engine, gt, id) { + if (!engine->pmu.enable) + continue; + if (!intel_engine_pm_get_if_awake(engine)) continue;