[Intel-gfx] [PATCH v3] drm/i915/pmu: Clear the previous sample value when parking

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 23 09:37:29 UTC 2017


Quoting Tvrtko Ursulin (2017-11-23 09:27:40)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> When turning off the engines, and the pmu sampling, clear the previous
> value as the current measurement should be 0.
> 
> v2: Use a for-loop
> v3:
>  * Move clearing to timer self-dis-arm to avoid race with parking.
>  * Clear frequency samples as well.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>

That makes sense (wrt to the sampling),
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

(However, for freq.sample we should be using idle-freq not 0, and init
sample.prev to idle-freq?)

Hmm, actual-freq depends on gt.awake, but we are not including that in
pmu_needs_timer.

@@ -119,7 +119,8 @@ static bool pmu_needs_timer(struct drm_i915_private *i915, bool gpu_active)
         * running so clear those bits out.
         */
        if (!gpu_active)
-               enable &= ~ENGINE_SAMPLE_MASK;
+               enable &= ~(config_enabled_mask(I915_PMU_ACTUAL_FREQUENCY) |
+                           ENGINE_SAMPLE_MASK);

I think.
-Chris


More information about the Intel-gfx mailing list