aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-08 17:35:35 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-09 15:52:22 -0400
commitc6a828d3269a5d0b9adda1438cf8d7cb2007ca71 (patch)
tree461339ff364393d241388e597a04fe07c911b7b6 /drivers/gpu/drm/i915/i915_debugfs.c
parent22bcfc6a4b2288675a54b761ebcd85b9613ab9a6 (diff)
drm/i915: move all rps state into dev_priv->rps
This way it's easier so see what belongs together, and what is used by the ilk ips code. Also add some comments that explain the locking. Note that (cur|min|max)_delay need to be duplicated, because they're also used by the ips code. v2: Missed one place that the dev_priv->ips change caught ... Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9c9e199970af..ed4bc98095b1 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1274,7 +1274,8 @@ static int i915_ring_freq_table(struct seq_file *m, void *unused)
1274 1274
1275 seq_printf(m, "GPU freq (MHz)\tEffective CPU freq (MHz)\n"); 1275 seq_printf(m, "GPU freq (MHz)\tEffective CPU freq (MHz)\n");
1276 1276
1277 for (gpu_freq = dev_priv->min_delay; gpu_freq <= dev_priv->max_delay; 1277 for (gpu_freq = dev_priv->rps.min_delay;
1278 gpu_freq <= dev_priv->rps.max_delay;
1278 gpu_freq++) { 1279 gpu_freq++) {
1279 I915_WRITE(GEN6_PCODE_DATA, gpu_freq); 1280 I915_WRITE(GEN6_PCODE_DATA, gpu_freq);
1280 I915_WRITE(GEN6_PCODE_MAILBOX, GEN6_PCODE_READY | 1281 I915_WRITE(GEN6_PCODE_MAILBOX, GEN6_PCODE_READY |
@@ -1712,7 +1713,7 @@ i915_max_freq_read(struct file *filp,
1712 return ret; 1713 return ret;
1713 1714
1714 len = snprintf(buf, sizeof(buf), 1715 len = snprintf(buf, sizeof(buf),
1715 "max freq: %d\n", dev_priv->max_delay * 50); 1716 "max freq: %d\n", dev_priv->rps.max_delay * 50);
1716 mutex_unlock(&dev->struct_mutex); 1717 mutex_unlock(&dev->struct_mutex);
1717 1718
1718 if (len > sizeof(buf)) 1719 if (len > sizeof(buf))
@@ -1755,7 +1756,7 @@ i915_max_freq_write(struct file *filp,
1755 /* 1756 /*
1756 * Turbo will still be enabled, but won't go above the set value. 1757 * Turbo will still be enabled, but won't go above the set value.
1757 */ 1758 */
1758 dev_priv->max_delay = val / 50; 1759 dev_priv->rps.max_delay = val / 50;
1759 1760
1760 gen6_set_rps(dev, val / 50); 1761 gen6_set_rps(dev, val / 50);
1761 mutex_unlock(&dev->struct_mutex); 1762 mutex_unlock(&dev->struct_mutex);
@@ -1788,7 +1789,7 @@ i915_min_freq_read(struct file *filp, char __user *ubuf, size_t max,
1788 return ret; 1789 return ret;
1789 1790
1790 len = snprintf(buf, sizeof(buf), 1791 len = snprintf(buf, sizeof(buf),
1791 "min freq: %d\n", dev_priv->min_delay * 50); 1792 "min freq: %d\n", dev_priv->rps.min_delay * 50);
1792 mutex_unlock(&dev->struct_mutex); 1793 mutex_unlock(&dev->struct_mutex);
1793 1794
1794 if (len > sizeof(buf)) 1795 if (len > sizeof(buf))
@@ -1829,7 +1830,7 @@ i915_min_freq_write(struct file *filp, const char __user *ubuf, size_t cnt,
1829 /* 1830 /*
1830 * Turbo will still be enabled, but won't go below the set value. 1831 * Turbo will still be enabled, but won't go below the set value.
1831 */ 1832 */
1832 dev_priv->min_delay = val / 50; 1833 dev_priv->rps.min_delay = val / 50;
1833 1834
1834 gen6_set_rps(dev, val / 50); 1835 gen6_set_rps(dev, val / 50);
1835 mutex_unlock(&dev->struct_mutex); 1836 mutex_unlock(&dev->struct_mutex);