]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: use variadic macros and arrays to choose port/pipe based registers
authorJani Nikula <jani.nikula@intel.com>
Fri, 27 Jan 2017 15:57:06 +0000 (17:57 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 30 Jan 2017 18:10:07 +0000 (20:10 +0200)
commit5af5829eeed0727ba008d8e3327fbcce1cc130fe
tree93f8009c6e8ba4deedaeb52918e338c516cdae6f
parent0791029d398af2ab08c1de0f2cb5c1a64975be73
drm/i915: use variadic macros and arrays to choose port/pipe based registers

This allows the use of more than 3 ports/pipes/whatever without tricks,
even if the register offsets are not evenly spaced.

There's the risk of out of bounds access if we're not careful; currently
that would "just" lead to the wrong register offset being used. It might
be possible to add build bug ons for build time constant indexing.

We already have ports defined up to E, not sure if we might have bugs
related to them and the current _PORT3() macro.

   text    data     bss     dec     hex filename
1239868   46199    4096 1290163  13afb3 drivers/gpu/drm/i915/i915.ko
1238828   46199    4096 1289123  13aba3 drivers/gpu/drm/i915/i915.ko

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1485532626-20923-1-git-send-email-jani.nikula@intel.com
drivers/gpu/drm/i915/i915_reg.h