[Intel-gfx] [PATCH 0/1] Start cleaning up register definitions

Matt Roper matthew.d.roper at intel.com
Thu Jan 6 23:08:22 UTC 2022


Our i915_reg.h file has become a huge unwieldy mess over the years.  A
lot of definitions don't follow any logical ordering, there's
unintentional duplication of registers under different names, the coding
style is very inconsistent, and there's tons of unused definitions
(nearly a quarter of i915_reg.h is dead code!).  This makes it a pain to
work with and also needlessly slows down development since any trivial
change to i915_reg.h forces us to unnecessarily rebuild the entire i915
driver instead of just the affected are of the code.

I'd like to start cleaning up the register definitions in a few steps:
 (1) Eliminate unnused register and bit definitions.  Some of these may
     get re-added in the future if/when code starts using them but
     that's fine; we'd prefer to carefully (re)review the register
     definitions at that time anyway.
 (2) Move registers exclusive to the command parser to their own header
 (3) Move OA registers to their own header
 (4) Move GT registers to their own header
 (5) Move display registers to their own header
 (6) While moving things to new files, take the opportunity to also
     update to update to a consistent coding style:  consistent
     indentation, consistent case for hex values, use of
     REG_BIT/REG_GENMASK, etc.

This will make it easier to find an appropriate place to add new
registers and should also improve quality of life for developers since
driver builds will be faster in cases where a register is added/updated
and only a specific part of the driver needs to be rebuilt.

This only includes step (1) above; the other steps will come as
follow-up patches if there's no concern with the general goal.

Cc: Jani Nikula <jani.nikula at linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Signed-off-by: Matt Roper <matthew.d.roper at intel.com>

Matt Roper (1):
  drm/i915: Drop unused register definitions

 drivers/gpu/drm/i915/i915_reg.h | 3107 +------------------------------
 1 file changed, 9 insertions(+), 3098 deletions(-)

-- 
2.34.1



More information about the Intel-gfx mailing list