[Intel-gfx] [RFC 0/4] drm/i915/registers: use standard bits.h and bitfield.h macros

Jani Nikula jani.nikula at intel.com
Thu Sep 27 09:40:19 UTC 2018


This is an RFC to get input on how people feel about moving towards
using <linux/bits.h> and <linux/bitfield.h> macros for register field
definitions and manipulation:

* BIT()
* GENMASK()
* FIELD_GET()
* FIELD_PREP()

I'm not necessarily proposing pushing the patches in this series;
they're more of a piece-by-piece transformation of the power sequencer
macros and code to use the above macros, to give an idea what the end
result would look like.

I'm also not proposing mass conversions that are error prone and cause
unnecessary conflicts. At least not outside of i915_reg.h.

I'd like to figure out the *direction* where we'd like to go with what
we're adding in the future.


BR,
Jani.


Jani Nikula (4):
  drm/i915/registers: prefer GENMASK() over hand rolled masks
  drm/i915/registers: prefer BIT() for single bits
  drm/i915/registers: deprecate _SHIFT in favor of FIELD_GET() and _MASK
  drm/i915/registers: define field values using FIELD_PREP()

 drivers/gpu/drm/i915/i915_reg.h   | 82 +++++++++++++++++----------------------
 drivers/gpu/drm/i915/intel_dp.c   | 43 +++++++++-----------
 drivers/gpu/drm/i915/intel_lvds.c | 41 +++++++++-----------
 3 files changed, 73 insertions(+), 93 deletions(-)

-- 
2.11.0



More information about the Intel-gfx mailing list