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 18:12:59 +0200
committerMika Kuoppala <mika.kuoppala@intel.com>2017-03-16 12:28:28 +0200
commit6b7f6aa75e38ef4e2bfb9e13726f6561e682892f (patch)
treec0028fc967d28217d8ffb5f2ef2a4de548d488bb /drivers/gpu/drm/i915/intel_pm.c
parent679cb6c1320bc0d4b1572a4cf0988c3bba66becf (diff)
downloadop-kernel-dev-6b7f6aa75e38ef4e2bfb9e13726f6561e682892f.zip
op-kernel-dev-6b7f6aa75e38ef4e2bfb9e13726f6561e682892f.tar.gz
drm/i915: Use coarse grained residency counter with byt
Set byt rc residency counters high level as chv does by default. We lose some accuracy on byt but we can do the calculation without extra hw read on both platforms, as now they behave identically in this respect. v2: use ktime v3: keep comparison u32 (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/1489592584-10422-1-git-send-email-mika.kuoppala@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index dcf1b72..934a8c0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6392,7 +6392,8 @@ static void valleyview_enable_rps(struct drm_i915_private *dev_priv)
/* allows RC6 residency counter to work */
I915_WRITE(VLV_COUNTER_CONTROL,
- _MASKED_BIT_ENABLE(VLV_MEDIA_RC0_COUNT_EN |
+ _MASKED_BIT_ENABLE(VLV_COUNT_RANGE_HIGH |
+ VLV_MEDIA_RC0_COUNT_EN |
VLV_RENDER_RC0_COUNT_EN |
VLV_MEDIA_RC6_COUNT_EN |
VLV_RENDER_RC6_COUNT_EN));
@@ -8361,7 +8362,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
spin_lock_irq(&dev_priv->uncore.lock);
saved_ctl = I915_READ_FW(VLV_COUNTER_CONTROL);
- if (!(saved_ctl & VLV_COUNT_RANGE_HIGH))
+ if (WARN_ON(!(saved_ctl & VLV_COUNT_RANGE_HIGH)))
I915_WRITE_FW(VLV_COUNTER_CONTROL,
_MASKED_BIT_ENABLE(VLV_COUNT_RANGE_HIGH));
@@ -8382,10 +8383,6 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
upper = I915_READ_FW(reg);
} while (upper != tmp);
- if (!(saved_ctl & VLV_COUNT_RANGE_HIGH))
- I915_WRITE_FW(VLV_COUNTER_CONTROL,
- _MASKED_BIT_DISABLE(VLV_COUNT_RANGE_HIGH));
-
spin_unlock_irq(&dev_priv->uncore.lock);
return lower | (u64)upper << 8;
OpenPOWER on IntegriCloud