drm/xe: Plumb xe_reg into WAs, rtp, etc
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 27 Apr 2023 22:32:55 +0000 (15:32 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:32:21 +0000 (18:32 -0500)
commit07fbd1f85df18a9a33556de76499fd3693639a7d
tree9481afea77781172c6c7c4050f0c7c7c53602512
parentca2acce76d81fda9520b8b797119deddbe660968
drm/xe: Plumb xe_reg into WAs, rtp, etc

Now that struct xe_reg and struct xe_reg_mcr are types that can be used
by xe, convert more of the driver to use them. Some notes about the
conversions:

- The RTP tables don't need the MASKED flags anymore in the
  actions as that information now comes from the register
  definition

- There is no need for the _XE_RTP_REG/_XE_RTP_REG_MCR macros
  and the register types on RTP infra: that comes from the
  register definitions.

- When declaring the RTP entries, there is no need anymore to
  undef XE_REG and friends: the RTP macros deal with removing
  the cast where needed due to not being able to use a compound
  statement for initialization in the tables

- The index in the reg-sr xarray is the register offset only.
  Otherwise we wouldn't catch mistakes about adding both a
  MCR-style and normal-style registers. For that, the register
  is now also part of the entry, so the options can be compared
  to check for compatible entries.

In order to be able to accomplish this, some improvements are needed on
the RTP macros. Change its implementation to concentrate on "pasting a prefix
to each argument" rather than the more general "call any macro for each
argument". Hopefully this will avoid trying to extend this infra and
making it more complex. With the use of tuples for building the
arguments, it's not possible to pass additional register fields and
using xe_reg in the RTP tables.

xe_mmio_* still need to be converted, from u32 to xe_reg, but that is
left for another change.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230427223256.1432787-10-lucas.demarchi@intel.com
Link: https://lore.kernel.org/r/20230427223256.1432787-6-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/tests/xe_rtp_test.c
drivers/gpu/drm/xe/xe_guc_ads.c
drivers/gpu/drm/xe/xe_reg_sr.c
drivers/gpu/drm/xe/xe_reg_sr.h
drivers/gpu/drm/xe/xe_reg_sr_types.h
drivers/gpu/drm/xe/xe_reg_whitelist.c
drivers/gpu/drm/xe/xe_rtp.c
drivers/gpu/drm/xe/xe_rtp.h
drivers/gpu/drm/xe/xe_rtp_types.h
drivers/gpu/drm/xe/xe_tuning.c
drivers/gpu/drm/xe/xe_wa.c