[PATCH] drm/i915/pmu: Clear the previous sample value when parking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When turning off the engines, and the pmu sampling, clear the previous
value as the current measurement should be 0.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_pmu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index f1e932a3fb85..6f1316f5039a 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -135,9 +135,18 @@ static bool pmu_needs_timer(struct drm_i915_private *i915, bool gpu_active)
 
 void i915_pmu_gt_parked(struct drm_i915_private *i915)
 {
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
 	if (!i915->pmu.base.event_init)
 		return;
 
+	for_each_engine(engine, i915, id) {
+		engine->pmu.sample[I915_SAMPLE_BUSY].prev = 0;
+		engine->pmu.sample[I915_SAMPLE_WAIT].prev = 0;
+		engine->pmu.sample[I915_SAMPLE_SEMA].prev = 0;
+	}
+
 	spin_lock_irq(&i915->pmu.lock);
 	/*
 	 * Signal sampling timer to stop if only engine events are enabled and
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux