Skip to content

i915: Explicit handling of multicast registers

Matt Roper dri-devel intel-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15drm/i915/gen8: Create separate reg definitions for new MCR registersdrivers/gpu/drm/i915/gt/intel_engine_cs.c drivers/gpu/drm/i915/gt/intel_gt_regs.h drivers/gpu/drm/i915/gt/intel_workarounds.c +5 more+35 -260 replies
2/15drm/i915/xehp: Create separate reg definitions for new MCR registersdrivers/gpu/drm/i915/gt/intel_gt_regs.h drivers/gpu/drm/i915/gt/intel_gtt.c drivers/gpu/drm/i915/gt/intel_mocs.c +2 more+52 -310 replies
3/15drm/i915/gt: Drop a few unused register definitionsdrivers/gpu/drm/i915/gt/intel_gt_regs.h+0 -170 replies
4/15drm/i915/gt: Correct prefix on a few registersdrivers/gpu/drm/i915/gt/intel_gt_regs.h drivers/gpu/drm/i915/gt/intel_workarounds.c+9 -90 replies
5/15drm/i915/xehp: Check for faults on all mslicesdrivers/gpu/drm/i915/gt/intel_gt.c drivers/gpu/drm/i915/gt/intel_gt_regs.h+46 -10 replies
6/15drm/i915: Drop duplicated definition of XEHPSDV_FLAT_CCS_BASE_ADDRdrivers/gpu/drm/i915/i915_reg.h+0 -30 replies
7/15drm/i915: Move XEHPSDV_TILE0_ADDR_RANGE to GT register headerdrivers/gpu/drm/i915/gem/i915_gem_stolen.c drivers/gpu/drm/i915/gt/intel_gt_regs.h drivers/gpu/drm/i915/i915_reg.h+4 -30 replies
8/15drm/i915: Define MCR registers explicitlydrivers/gpu/drm/i915/gt/intel_gt_regs.h+63 -610 replies
9/15drm/i915/gt: Move multicast register handling to a dedicated filedrivers/gpu/drm/i915/Makefile drivers/gpu/drm/i915/gem/i915_gem_stolen.c drivers/gpu/drm/i915/gt/intel_engine_cs.c +10 more+458 -3950 replies
10/15drm/i915/gt: Cleanup interface for MCR operationsdrivers/gpu/drm/i915/gem/i915_gem_stolen.c drivers/gpu/drm/i915/gt/intel_engine_cs.c drivers/gpu/drm/i915/gt/intel_gt.c +6 more+184 -1520 replies
11/15drm/i915/gt: Always use MCR functions on multicast registersdrivers/gpu/drm/i915/gt/intel_ggtt.c drivers/gpu/drm/i915/gt/intel_gtt.c drivers/gpu/drm/i915/gt/intel_gtt.h +3 more+55 -450 replies
12/15drm/i915/guc: Handle save/restore of MCR registers explicitlydrivers/gpu/drm/i915/gt/uc/intel_guc_ads.c+34 -210 replies
13/15drm/i915/gt: Add MCR-specific workaround initializersdrivers/gpu/drm/i915/gt/intel_workarounds.c+198 -1480 replies
14/15drm/i915: Define multicast registers as a new typedrivers/gpu/drm/i915/gt/intel_gt_mcr.c drivers/gpu/drm/i915/gt/intel_gt_mcr.h drivers/gpu/drm/i915/gt/intel_gt_regs.h +10 more+113 -692 replies
15/15drm/i915/xehp: Eliminate shared/implicit steeringdrivers/gpu/drm/i915/gt/intel_gt_mcr.c drivers/gpu/drm/i915/gt/intel_gt_types.h drivers/gpu/drm/i915/gt/intel_workarounds.c+56 -836 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/15] i915: Explicit handling of multicast registers

Multicast/replicated (MCR) registers on Intel hardware are a purely GT-specific concept. Rather than leaving MCR register handling spread across several places throughout the driver (intel_uncore.c, intel_gt.c, etc.) with confusing combinations of handler functions living in different namespaces, let's consolidate it all into a single place (intel_gt_mcr.c) and provide a more consistent and clearly-documented interface for the rest of the driver to access such registers:

* intel_gt_mcr_read -- unicast read from specific instance
* intel_gt_mcr_read_any[_fw] -- unicast read from any non-terminated instance
* intel_gt_mcr_unicast_write -- unicast write to specific instance
* intel_gt_mcr_multicast_write[_fw] -- multicast write to all instances

To ensure these new interfaces are used for all accesses to MCR registers (rather than relying on the implicit and possibly incorrect semantics of our regular mmio accessors), we'll also promote multicast registers to a unique type within the driver (i915_mcr_reg_t rather than the traditional i915_reg_t). This will let the compiler help us catch places where the code is trying to perform a non-MCR-aware MMIO operation on an MCR register.

Finally, we'll implement new guidance from our hardware architects that we should steer every undirected access to MCR registers (including registers in GSLICE/DSS MCR ranges) at the time of access on Xe_HP, rather than relying on a default steering target programmed at driver initialization time.

One aspect of this series that I'm not super happy with is the handling of mixed lists MCR and non-MCR registers that we have in a few places (e.g., the various whitelists used by perf, GVT, etc.). Since we're not actually accessing the registers in those spots, just listing them out so their MMIO offsets can be used for comparison, for now I've effectively cast the MCR registers on those lists back to i915_reg_t type so that the compiler doesn't complain about seeing incompatible i915_mcr_reg_t elements in a list that's supposed to be i915_reg_t. We may want to think about better ways to handle heterogeneous lists of MCR and non-MCR registers, or possibly just convert those to lists of u32 offsets since we're not actually using them to perform MMIO accesses.

Cc Daniele Ceraolo Spurio <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>

Matt Roper (15):
drm/i915/gen8: Create separate reg definitions for new MCR registers drm/i915/xehp: Create separate reg definitions for new MCR registers drm/i915/gt: Drop a few unused register definitions drm/i915/gt: Correct prefix on a few registers drm/i915/xehp: Check for faults on all mslices
drm/i915: Drop duplicated definition of XEHPSDV_FLAT_CCS_BASE_ADDR drm/i915: Move XEHPSDV_TILE0_ADDR_RANGE to GT register header drm/i915: Define MCR registers explicitly
drm/i915/gt: Move multicast register handling to a dedicated file drm/i915/gt: Cleanup interface for MCR operations drm/i915/gt: Always use MCR functions on multicast registers drm/i915/guc: Handle save/restore of MCR registers explicitly drm/i915/gt: Add MCR-specific workaround initializers drm/i915: Define multicast registers as a new type drm/i915/xehp: Eliminate shared/implicit steering

 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c    |   4 +-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  34 +-
 drivers/gpu/drm/i915/gt/intel_ggtt.c          |   4 +-
 drivers/gpu/drm/i915/gt/intel_gt.c            | 303 ++---------
 drivers/gpu/drm/i915/gt/intel_gt.h            |  15 -
 drivers/gpu/drm/i915/gt/intel_gt_debugfs.c    |   3 +-
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c        | 506 ++++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_gt_mcr.h        |  34 ++
 drivers/gpu/drm/i915/gt/intel_gt_regs.h       | 153 +++---
 drivers/gpu/drm/i915/gt/intel_gt_types.h      |   1 +
 drivers/gpu/drm/i915/gt/intel_gtt.c           |  44 +-
 drivers/gpu/drm/i915/gt/intel_gtt.h           |   2 +-
 drivers/gpu/drm/i915/gt/intel_lrc.c           |   6 +-
 drivers/gpu/drm/i915/gt/intel_mocs.c          |  12 +-
 drivers/gpu/drm/i915/gt/intel_region_lmem.c   |   3 +-
 drivers/gpu/drm/i915/gt/intel_workarounds.c   | 473 ++++++++--------
 .../gpu/drm/i915/gt/selftest_workarounds.c    |   2 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    |  61 ++-
 .../gpu/drm/i915/gt/uc/intel_guc_capture.c    |   8 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c     |  12 +-
 drivers/gpu/drm/i915/gvt/cmd_parser.c         |   2 +-
 drivers/gpu/drm/i915/gvt/handlers.c           |  19 +-
 drivers/gpu/drm/i915/gvt/mmio_context.c       |  16 +-
 drivers/gpu/drm/i915/i915_perf.c              |   2 +-
 drivers/gpu/drm/i915/i915_reg.h               |   6 -
 drivers/gpu/drm/i915/i915_reg_defs.h          |   9 +
 drivers/gpu/drm/i915/intel_pm.c               |  20 +-
 drivers/gpu/drm/i915/intel_uncore.c           | 112 ----
 drivers/gpu/drm/i915/intel_uncore.h           |   8 -
 30 files changed, 1059 insertions(+), 816 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_mcr.c
 create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_mcr.h
Signature · 1 line
2.34.1