[Intel-gfx] [RFC 15/15] drm/i915: Replace some negative Gen checks

Jani Nikula jani.nikula at linux.intel.com
Fri Feb 9 10:18:08 UTC 2018


On Thu, 08 Feb 2018, Tvrtko Ursulin <tursulin at ursulin.net> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> Instead of INTEL_GEN != x use !IS_GENx for more optimisation
> opportunities.

This could be upstreamed outside of this series.

BR,
Jani.

>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 37421fe4c0a3..41674aedbd2a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -7551,7 +7551,7 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
>  {
>  	unsigned long val;
>  
> -	if (INTEL_GEN(dev_priv) != 5)
> +	if (!IS_GEN5(dev_priv))
>  		return 0;
>  
>  	spin_lock_irq(&mchdev_lock);
> @@ -7635,7 +7635,7 @@ static void __i915_update_gfx_val(struct drm_i915_private *dev_priv)
>  
>  void i915_update_gfx_val(struct drm_i915_private *dev_priv)
>  {
> -	if (INTEL_GEN(dev_priv) != 5)
> +	if (!IS_GEN5(dev_priv))
>  		return;
>  
>  	spin_lock_irq(&mchdev_lock);
> @@ -7686,7 +7686,7 @@ unsigned long i915_gfx_val(struct drm_i915_private *dev_priv)
>  {
>  	unsigned long val;
>  
> -	if (INTEL_GEN(dev_priv) != 5)
> +	if (!IS_GEN5(dev_priv))
>  		return 0;
>  
>  	spin_lock_irq(&mchdev_lock);

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list