Skip to content

Commit 927dfdd

Browse files
committed
drm/i915/dg2: Add SQIDI steering
Although DG2_G10 platforms will always have all SQIDI's present and don't need steering for registers in a SQIDI MMIO range, this isn't true for DG2_G11 platforms; only SQIDI's 2 and 3 can be used on those. We handle SQIDI ranges a bit differently from other types of explicit steering. The SQIDI ranges belong to either the MCFG unit or the SF unit, both of which have their own dedicated steering registers and do not use the typical 0xFDC steering control that all other types of ranges use. Thus we only need to worry about picking a valid initial value for the MCFG and SF steering registers (0xFD0 and 0xFD8 respectively) at driver init; they won't change after we set them up so we don't need to worry about re-steering them explicitly at runtime. Given that any SQIDI value should work fine for DG2-G10 and XeHP SDV, while only values of 2 and 3 are valid for DG2-G11, we'll just initialize the MCFG and SF steering registers to a constant value of "2" for all XeHP-based platforms for simplicity --- that will work in all cases. Bspec: 66534 Cc: Radhakrishna Sripada <[email protected]> Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1705f22 commit 927dfdd

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -889,17 +889,24 @@ cfl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
889889
GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
890890
}
891891

892-
static void __add_mcr_wa(struct drm_i915_private *i915, struct i915_wa_list *wal,
893-
unsigned slice, unsigned subslice)
892+
static void __set_mcr_steering(struct i915_wa_list *wal,
893+
i915_reg_t steering_reg,
894+
unsigned int slice, unsigned int subslice)
894895
{
895896
u32 mcr, mcr_mask;
896897

897898
mcr = GEN11_MCR_SLICE(slice) | GEN11_MCR_SUBSLICE(subslice);
898899
mcr_mask = GEN11_MCR_SLICE_MASK | GEN11_MCR_SUBSLICE_MASK;
899900

900-
drm_dbg(&i915->drm, "MCR slice/subslice = %x\n", mcr);
901+
wa_write_clr_set(wal, steering_reg, mcr_mask, mcr);
902+
}
903+
904+
static void __add_mcr_wa(struct drm_i915_private *i915, struct i915_wa_list *wal,
905+
unsigned int slice, unsigned int subslice)
906+
{
907+
drm_dbg(&i915->drm, "MCR slice=0x%x, subslice=0x%x\n", slice, subslice);
901908

902-
wa_write_clr_set(wal, GEN8_MCR_SELECTOR, mcr_mask, mcr);
909+
__set_mcr_steering(wal, GEN8_MCR_SELECTOR, slice, subslice);
903910
}
904911

905912
static void
@@ -953,7 +960,6 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
953960
* - L3 Bank (fusable)
954961
* - MSLICE (fusable)
955962
* - LNCF (sub-unit within mslice; always present if mslice is present)
956-
* - SQIDI (always on)
957963
*
958964
* We'll do our default/implicit steering based on GSLICE (in the
959965
* sliceid field) and DSS (in the subsliceid field). If we can
@@ -1003,6 +1009,18 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
10031009
WARN_ON(dss_mask >> (slice * GEN_DSS_PER_GSLICE) == 0);
10041010

10051011
__add_mcr_wa(i915, wal, slice, subslice);
1012+
1013+
/*
1014+
* SQIDI ranges are special because they use different steering
1015+
* registers than everything else we work with. On XeHP SDV and
1016+
* DG2-G10, any value in the steering registers will work fine since
1017+
* all instances are present, but DG2-G11 only has SQIDI instances at
1018+
* ID's 2 and 3, so we need to steer to one of those. For simplicity
1019+
* we'll just steer to a hardcoded "2" since that value will work
1020+
* everywhere.
1021+
*/
1022+
__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
1023+
__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
10061024
}
10071025

10081026
static void

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,6 +2695,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
26952695
#define GEN12_SC_INSTDONE_EXTRA2 _MMIO(0x7108)
26962696
#define GEN7_SAMPLER_INSTDONE _MMIO(0xe160)
26972697
#define GEN7_ROW_INSTDONE _MMIO(0xe164)
2698+
#define MCFG_MCR_SELECTOR _MMIO(0xfd0)
2699+
#define SF_MCR_SELECTOR _MMIO(0xfd8)
26982700
#define GEN8_MCR_SELECTOR _MMIO(0xfdc)
26992701
#define GEN8_MCR_SLICE(slice) (((slice) & 3) << 26)
27002702
#define GEN8_MCR_SLICE_MASK GEN8_MCR_SLICE(3)

0 commit comments

Comments
 (0)