diff mbox

[2/8] drm/i915/skl: Updated intel_gpu_freq() and intel_freq_opcode()

Message ID 1424954986-24450-3-git-send-email-akash.goel@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

akash.goel@intel.com Feb. 26, 2015, 12:49 p.m. UTC
From: Akash Goel <akash.goel@intel.com>

On SKL, frequency is specified in units of 16.66 MHZ.
Updated the intel_gpu_freq() and intel_freq_opecode() functions
to do the conversion appropriately.

Signed-off-by: Akash Goel <akash.goel@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Ville Syrjälä March 5, 2015, 10:18 a.m. UTC | #1
On Thu, Feb 26, 2015 at 06:19:38PM +0530, akash.goel@intel.com wrote:
> From: Akash Goel <akash.goel@intel.com>
> 
> On SKL, frequency is specified in units of 16.66 MHZ.
> Updated the intel_gpu_freq() and intel_freq_opecode() functions
> to do the conversion appropriately.
> 
> Signed-off-by: Akash Goel <akash.goel@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 7dcb5b6..1b36d0e 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -6660,7 +6660,9 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
>  
>  int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
>  {
> -	if (IS_CHERRYVIEW(dev_priv->dev))
> +	if (IS_GEN9(dev_priv->dev))
> +		return (val * GT_FREQUENCY_MULTIPLIER) / GEN9_FREQ_SCALER;
> +	else if (IS_CHERRYVIEW(dev_priv->dev))
>  		return chv_gpu_freq(dev_priv, val);
>  	else if (IS_VALLEYVIEW(dev_priv->dev))
>  		return byt_gpu_freq(dev_priv, val);
> @@ -6670,7 +6672,9 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
>  
>  int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
>  {
> -	if (IS_CHERRYVIEW(dev_priv->dev))
> +	if (IS_GEN9(dev_priv->dev))
> +		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
> +	else if (IS_CHERRYVIEW(dev_priv->dev))
>  		return chv_freq_opcode(dev_priv, val);
>  	else if (IS_VALLEYVIEW(dev_priv->dev))
>  		return byt_freq_opcode(dev_priv, val);
> -- 
> 1.9.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7dcb5b6..1b36d0e 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6660,7 +6660,9 @@  static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_CHERRYVIEW(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev))
+		return (val * GT_FREQUENCY_MULTIPLIER) / GEN9_FREQ_SCALER;
+	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_gpu_freq(dev_priv, val);
 	else if (IS_VALLEYVIEW(dev_priv->dev))
 		return byt_gpu_freq(dev_priv, val);
@@ -6670,7 +6672,9 @@  int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_CHERRYVIEW(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev))
+		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
+	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
 	else if (IS_VALLEYVIEW(dev_priv->dev))
 		return byt_freq_opcode(dev_priv, val);