[Intel-gfx] [PATCH v2] drm/i915: Allow optimized platform checks

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 27 17:03:57 UTC 2017


Quoting Tvrtko Ursulin (2017-09-27 17:41:38)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> If we store the platform as a bitmask, and convert the
> IS_PLATFORM macro to use it, we allow the compiler to
> merge the IS_PLATFORM(a) || IS_PLATFORM(b) || ... checks
> into a single conditional.
> 
> As a secondary benefit this saves almost 1k of text:
> 
>     text           data     bss     dec     hex filename
> -1460254          60014    3656 1523924  1740d4 drivers/gpu/drm/i915/i915.ko
> +1459260          60026    3656 1522942  173cfe drivers/gpu/drm/i915/i915.ko
> 
> v2: Removed the infamous -1.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Jani Nikula <jani.nikula at intel.com>

I checked a few of our IS_*() to make sure we were not storing any
inside a local int which may cause a few surprises (but unlikely if they
are ever used outside of boolean contxt).

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list