Commit daa3afb2 authored by Tom O'Rourke's avatar Tom O'Rourke Committed by Daniel Vetter

drm/i915/bdw: Add Broadwell support for debugfs rps freq info

Add Broadwell support to i915_frequency_info
and extend i915_max|min_freq_get|set to (gen >= 6).

v2: generalized support for i915_max|min_freq_get|set (Daniel).
Signed-off-by: default avatarTom O'Rourke <Tom.O'Rourke@intel.com>
Reviewed-by: default avatarJeff McGee <jeff.mcgee@intel.com>
[danvet: Fix checkpatch fail.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent f417c11b
...@@ -1027,7 +1027,8 @@ static int i915_frequency_info(struct seq_file *m, void *unused) ...@@ -1027,7 +1027,8 @@ static int i915_frequency_info(struct seq_file *m, void *unused)
MEMSTAT_VID_SHIFT); MEMSTAT_VID_SHIFT);
seq_printf(m, "Current P-state: %d\n", seq_printf(m, "Current P-state: %d\n",
(rgvstat & MEMSTAT_PSTATE_MASK) >> MEMSTAT_PSTATE_SHIFT); (rgvstat & MEMSTAT_PSTATE_MASK) >> MEMSTAT_PSTATE_SHIFT);
} else if ((IS_GEN6(dev) || IS_GEN7(dev)) && !IS_VALLEYVIEW(dev)) { } else if (IS_GEN6(dev) || (IS_GEN7(dev) && !IS_VALLEYVIEW(dev)) ||
IS_BROADWELL(dev)) {
u32 gt_perf_status = I915_READ(GEN6_GT_PERF_STATUS); u32 gt_perf_status = I915_READ(GEN6_GT_PERF_STATUS);
u32 rp_state_limits = I915_READ(GEN6_RP_STATE_LIMITS); u32 rp_state_limits = I915_READ(GEN6_RP_STATE_LIMITS);
u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP); u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
...@@ -1046,7 +1047,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused) ...@@ -1046,7 +1047,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused)
reqf = I915_READ(GEN6_RPNSWREQ); reqf = I915_READ(GEN6_RPNSWREQ);
reqf &= ~GEN6_TURBO_DISABLE; reqf &= ~GEN6_TURBO_DISABLE;
if (IS_HASWELL(dev)) if (IS_HASWELL(dev) || IS_BROADWELL(dev))
reqf >>= 24; reqf >>= 24;
else else
reqf >>= 25; reqf >>= 25;
...@@ -1063,7 +1064,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused) ...@@ -1063,7 +1064,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused)
rpdownei = I915_READ(GEN6_RP_CUR_DOWN_EI); rpdownei = I915_READ(GEN6_RP_CUR_DOWN_EI);
rpcurdown = I915_READ(GEN6_RP_CUR_DOWN); rpcurdown = I915_READ(GEN6_RP_CUR_DOWN);
rpprevdown = I915_READ(GEN6_RP_PREV_DOWN); rpprevdown = I915_READ(GEN6_RP_PREV_DOWN);
if (IS_HASWELL(dev)) if (IS_HASWELL(dev) || IS_BROADWELL(dev))
cagf = (rpstat & HSW_CAGF_MASK) >> HSW_CAGF_SHIFT; cagf = (rpstat & HSW_CAGF_MASK) >> HSW_CAGF_SHIFT;
else else
cagf = (rpstat & GEN6_CAGF_MASK) >> GEN6_CAGF_SHIFT; cagf = (rpstat & GEN6_CAGF_MASK) >> GEN6_CAGF_SHIFT;
...@@ -3505,7 +3506,7 @@ i915_max_freq_get(void *data, u64 *val) ...@@ -3505,7 +3506,7 @@ i915_max_freq_get(void *data, u64 *val)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int ret; int ret;
if (!(IS_GEN6(dev) || IS_GEN7(dev))) if (INTEL_INFO(dev)->gen < 6)
return -ENODEV; return -ENODEV;
flush_delayed_work(&dev_priv->rps.delayed_resume_work); flush_delayed_work(&dev_priv->rps.delayed_resume_work);
...@@ -3531,7 +3532,7 @@ i915_max_freq_set(void *data, u64 val) ...@@ -3531,7 +3532,7 @@ i915_max_freq_set(void *data, u64 val)
u32 rp_state_cap, hw_max, hw_min; u32 rp_state_cap, hw_max, hw_min;
int ret; int ret;
if (!(IS_GEN6(dev) || IS_GEN7(dev))) if (INTEL_INFO(dev)->gen < 6)
return -ENODEV; return -ENODEV;
flush_delayed_work(&dev_priv->rps.delayed_resume_work); flush_delayed_work(&dev_priv->rps.delayed_resume_work);
...@@ -3586,7 +3587,7 @@ i915_min_freq_get(void *data, u64 *val) ...@@ -3586,7 +3587,7 @@ i915_min_freq_get(void *data, u64 *val)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int ret; int ret;
if (!(IS_GEN6(dev) || IS_GEN7(dev))) if (INTEL_INFO(dev)->gen < 6)
return -ENODEV; return -ENODEV;
flush_delayed_work(&dev_priv->rps.delayed_resume_work); flush_delayed_work(&dev_priv->rps.delayed_resume_work);
...@@ -3612,7 +3613,7 @@ i915_min_freq_set(void *data, u64 val) ...@@ -3612,7 +3613,7 @@ i915_min_freq_set(void *data, u64 val)
u32 rp_state_cap, hw_max, hw_min; u32 rp_state_cap, hw_max, hw_min;
int ret; int ret;
if (!(IS_GEN6(dev) || IS_GEN7(dev))) if (INTEL_INFO(dev)->gen < 6)
return -ENODEV; return -ENODEV;
flush_delayed_work(&dev_priv->rps.delayed_resume_work); flush_delayed_work(&dev_priv->rps.delayed_resume_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment