drm/i915: Allow optimized platform checks
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 27 Sep 2017 16:41:38 +0000 (17:41 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 28 Sep 2017 11:47:19 +0000 (12:47 +0100)
commitae7617f0ef1820be033eef93859a6bb6174a843f
treeeec0c1ba6a1879ea45a5f3d31667d5c4f90aee2c
parentbd30ca2d1a98fb9bd1f6ba63438068788b9e396b
drm/i915: Allow optimized platform checks

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@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927164138.15474-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h