Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: read current freq from Punit on VLV
@ 2013-05-02 17:48 Jesse Barnes
  2013-05-02 17:48 ` [PATCH 2/4] drm/i915: go back to switch for VLV mem freq detection v2 Jesse Barnes
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jesse Barnes @ 2013-05-02 17:48 UTC (permalink / raw)
  To: intel-gfx

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>
---
 drivers/gpu/drm/i915/i915_sysfs.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index ca00df2..c0d7875 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,
 	int ret;
 
 	mutex_lock(&dev_priv->rps.hw_lock);
-	if (IS_VALLEYVIEW(dev_priv->dev))
-		ret = vlv_gpu_freq(dev_priv->mem_freq, dev_priv->rps.cur_delay);
-	else
+	if (IS_VALLEYVIEW(dev_priv->dev)) {
+		u32 freq;
+		valleyview_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS, &freq);
+		ret = vlv_gpu_freq(dev_priv->mem_freq, (freq >> 8) & 0xff);
+	} else {
 		ret = dev_priv->rps.cur_delay * GT_FREQUENCY_MULTIPLIER;
+	}
 	mutex_unlock(&dev_priv->rps.hw_lock);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n", ret);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-06 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 17:48 [PATCH 1/4] drm/i915: read current freq from Punit on VLV Jesse Barnes
2013-05-02 17:48 ` [PATCH 2/4] drm/i915: go back to switch for VLV mem freq detection v2 Jesse Barnes
2013-05-03 17:52   ` Ben Widawsky
2013-05-06 15:30     ` Daniel Vetter
2013-05-02 17:48 ` [PATCH 3/4] drm/i915: set proper DPIO post divider for VGA on VLV v4 Jesse Barnes
2013-05-06 17:52   ` Kenneth Graunke
2013-05-06 20:50     ` Daniel Vetter
2013-05-02 17:48 ` [PATCH 4/4] drm/i915: BIOS and power context stolen mem handling for VLV Jesse Barnes
2013-05-03 18:05   ` Ben Widawsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox