diff mbox series

[RFC,8/8] drm/i915: Simplify intel_has_sagv function.

Message ID 20181018233447.5187-9-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show
Series re-organize a bit gen10 and gen11 | expand

Commit Message

Rodrigo Vivi Oct. 18, 2018, 11:34 p.m. UTC
Let's just handle SKL as special case instead of listing
platform by platform.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Jani Nikula Oct. 19, 2018, 8:15 a.m. UTC | #1
On Thu, 18 Oct 2018, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> Let's just handle SKL as special case instead of listing
> platform by platform.
>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 5663b7059467..97f191b081e0 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3612,15 +3612,11 @@ static bool skl_needs_memory_bw_wa(struct intel_atomic_state *state)
>  static bool
>  intel_has_sagv(struct drm_i915_private *dev_priv)
>  {
> -	if (INTEL_GEN(dev_priv) >= 10 ||
> -	    IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
> -		return true;
> -
>  	if (IS_SKYLAKE(dev_priv) &&
>  	    dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED)
>  		return true;
>  
> -	return false;
> +	return IS_GEN9_BC(dev_priv) || INTEL_GEN(dev_priv) >= 10;
>  }

You can go one step further and remove the Skylake special case even for
I915_SAGV_NOT_CONTROLLED:

	return (IS_GEN9_BC(dev_priv) || INTEL_GEN(dev_priv) >= 10) && 
		dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED;

dev_priv->sagv_status == I915_SAGV_NOT_CONTROLLED only on SKL, but this
function doesn't have to know that.

BR,
Jani.

>  
>  /*
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 5663b7059467..97f191b081e0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3612,15 +3612,11 @@  static bool skl_needs_memory_bw_wa(struct intel_atomic_state *state)
 static bool
 intel_has_sagv(struct drm_i915_private *dev_priv)
 {
-	if (INTEL_GEN(dev_priv) >= 10 ||
-	    IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
-		return true;
-
 	if (IS_SKYLAKE(dev_priv) &&
 	    dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED)
 		return true;
 
-	return false;
+	return IS_GEN9_BC(dev_priv) || INTEL_GEN(dev_priv) >= 10;
 }
 
 /*