Skip to content

Commit e367d3c

Browse files
tursulinunerlige
authored andcommitted
drm/i915/pmu: Support PMU for all engines
Given how the metrics are already exported, we also need to run sampling over engines from all GTs. Problem of GT frequencies is left for later. Signed-off-by: Tvrtko Ursulin <[email protected]> Reviewed-by: Umesh Nerlige Ramappa <[email protected]> Signed-off-by: Umesh Nerlige Ramappa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a644fde commit e367d3c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "gt/intel_engine_pm.h"
1111
#include "gt/intel_engine_regs.h"
1212
#include "gt/intel_engine_user.h"
13+
#include "gt/intel_gt.h"
1314
#include "gt/intel_gt_pm.h"
1415
#include "gt/intel_gt_regs.h"
1516
#include "gt/intel_rc6.h"
@@ -425,8 +426,9 @@ static enum hrtimer_restart i915_sample(struct hrtimer *hrtimer)
425426
struct drm_i915_private *i915 =
426427
container_of(hrtimer, struct drm_i915_private, pmu.timer);
427428
struct i915_pmu *pmu = &i915->pmu;
428-
struct intel_gt *gt = to_gt(i915);
429429
unsigned int period_ns;
430+
struct intel_gt *gt;
431+
unsigned int i;
430432
ktime_t now;
431433

432434
if (!READ_ONCE(pmu->timer_enabled))
@@ -442,8 +444,13 @@ static enum hrtimer_restart i915_sample(struct hrtimer *hrtimer)
442444
* grabbing the forcewake. However the potential error from timer call-
443445
* back delay greatly dominates this so we keep it simple.
444446
*/
445-
engines_sample(gt, period_ns);
446-
frequency_sample(gt, period_ns);
447+
448+
for_each_gt(gt, i915, i) {
449+
engines_sample(gt, period_ns);
450+
451+
if (i == 0) /* FIXME */
452+
frequency_sample(gt, period_ns);
453+
}
447454

448455
hrtimer_forward(hrtimer, now, ns_to_ktime(PERIOD));
449456

0 commit comments

Comments
 (0)