summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2017-03-15 17:43:00 +0200
committerMika Kuoppala <mika.kuoppala@intel.com>2017-03-16 12:28:28 +0200
commitc5a0ad114b6a9f4ad03f30bd7c61994bc6e8ab52 (patch)
treee30d1155564a7a9ae2f827a4473cfdb9ee366220 /drivers/gpu/drm/i915/intel_pm.c
parent135bafa551de3e7a8fff29e80a714b44d7dfd778 (diff)
downloadop-kernel-dev-c5a0ad114b6a9f4ad03f30bd7c61994bc6e8ab52.zip
op-kernel-dev-c5a0ad114b6a9f4ad03f30bd7c61994bc6e8ab52.tar.gz
drm/i915: Return residency as microseconds
Change the granularity from milliseconds to microseconds when returning rc6 residencies. This is in preparation for increased resolution on some platforms. v2: use 64bit div macro (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a4a2c23..da742a9 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -8350,12 +8350,12 @@ void intel_pm_setup(struct drm_i915_private *dev_priv)
atomic_set(&dev_priv->pm.wakeref_count, 0);
}
-u32 intel_rc6_residency(struct drm_i915_private *dev_priv,
- i915_reg_t reg)
+u64 intel_rc6_residency_us(struct drm_i915_private *dev_priv,
+ const i915_reg_t reg)
{
u64 raw_time; /* 32b value may overflow during fixed point math */
- u64 units = 128ULL, div = 100000ULL;
- u32 ret;
+ u64 units = 128000ULL, div = 100000ULL;
+ u64 ret;
if (!intel_enable_rc6())
return 0;
@@ -8364,13 +8364,13 @@ u32 intel_rc6_residency(struct drm_i915_private *dev_priv,
/* On VLV and CHV, residency time is in CZ units rather than 1.28us */
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
- units = 1;
+ units = 1000;
div = dev_priv->czclk_freq;
if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
units <<= 8;
} else if (IS_GEN9_LP(dev_priv)) {
- units = 1;
+ units = 1000;
div = 1200; /* 833.33ns */
}
OpenPOWER on IntegriCloud