[Intel-gfx] [PATCH 2/4] drm/i915: Fix chv GPU freq<->opcode conversions
ville.syrjala at linux.intel.com
ville.syrjala at linux.intel.com
Mon Nov 10 21:55:13 CET 2014
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Currently we miscalculate the GPU frequency on chv. This causes us to
report the GPU frequency as half of what it really is. Drop the extra
factor of 2 from the calculations to get the correct answer.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 03fbb45..74e4293 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7329,7 +7329,7 @@ static int chv_gpu_freq(struct drm_i915_private *dev_priv, int val)
if (div < 0)
return div;
- return DIV_ROUND_CLOSEST(czclk_freq * val, 2 * div) / 2;
+ return DIV_ROUND_CLOSEST(czclk_freq * val, 2 * div);
}
static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
@@ -7341,7 +7341,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
return mul;
/* CHV needs even values */
- return DIV_ROUND_CLOSEST(val * 2 * mul, czclk_freq) * 2;
+ return DIV_ROUND_CLOSEST(val * mul, czclk_freq) * 2;
}
int vlv_gpu_freq(struct drm_i915_private *dev_priv, int val)
--
2.0.4
More information about the Intel-gfx
mailing list