[Intel-gfx] [RFC 8/8] drm/i915: Simplify intel_has_sagv function.
Jani Nikula
jani.nikula at linux.intel.com
Fri Oct 19 08:15:15 UTC 2018
On Thu, 18 Oct 2018, Rodrigo Vivi <rodrigo.vivi at intel.com> wrote:
> Let's just handle SKL as special case instead of listing
> platform by platform.
>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at 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.
>
> /*
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list