drm/i915/pmu: Clear the previous sample value when parking
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 23 Nov 2017 10:26:54 +0000 (10:26 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 23 Nov 2017 12:27:52 +0000 (12:27 +0000)
commitfbba5559d91e812db0fd446fb383a37fde48b1cb
treede59a6a6afef6dcef4a11a92849943ecc5eec360
parentb552ae444e454eb3254c958e05b69820c0ef346d
drm/i915/pmu: Clear the previous sample value when parking

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.
v4:
 * Init frequency to idle_freq. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v3)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171123102654.29296-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_pmu.c