[Intel-gfx] [PATCH 2/4] drm/i915: Fix chv GPU freq<->opcode conversions

Deepak S deepak.s at intel.com
Tue Nov 18 10:08:25 CET 2014


On Tuesday 11 November 2014 02:25 AM, ville.syrjala at linux.intel.com wrote:
> 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);

I think CHV is 2 X cck, shouldn't we report the cck freq and not 2 *cck?

>   }
>   
>   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)




More information about the Intel-gfx mailing list