aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_sysfs.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2013-05-02 13:48:07 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-10 15:56:27 -0400
commit177006a10b33c9bd729cd60be0a37b41a23e4df3 (patch)
tree98c320a261954aa5333f61da24d6fcca8f896114 /drivers/gpu/drm/i915/i915_sysfs.c
parent8f375e10ee47b9d7b9b3aefcf67854c6e92708be (diff)
drm/i915: read current freq from Punit on VLV
Instead of returning the cached value, which is just what the kernel requested. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_sysfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_sysfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index ca00df2de07b..c0d7875b475c 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -212,10 +212,13 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
212 int ret; 212 int ret;
213 213
214 mutex_lock(&dev_priv->rps.hw_lock); 214 mutex_lock(&dev_priv->rps.hw_lock);
215 if (IS_VALLEYVIEW(dev_priv->dev)) 215 if (IS_VALLEYVIEW(dev_priv->dev)) {
216 ret = vlv_gpu_freq(dev_priv->mem_freq, dev_priv->rps.cur_delay); 216 u32 freq;
217 else 217 valleyview_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS, &freq);
218 ret = vlv_gpu_freq(dev_priv->mem_freq, (freq >> 8) & 0xff);
219 } else {
218 ret = dev_priv->rps.cur_delay * GT_FREQUENCY_MULTIPLIER; 220 ret = dev_priv->rps.cur_delay * GT_FREQUENCY_MULTIPLIER;
221 }
219 mutex_unlock(&dev_priv->rps.hw_lock); 222 mutex_unlock(&dev_priv->rps.hw_lock);
220 223
221 return snprintf(buf, PAGE_SIZE, "%d\n", ret); 224 return snprintf(buf, PAGE_SIZE, "%d\n", ret);