diff mbox series

drm/i915: Split GAM and MSLICE steering

Message ID 20220916014345.3317739-1-matthew.d.roper@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Split GAM and MSLICE steering | expand

Commit Message

Matt Roper Sept. 16, 2022, 1:43 a.m. UTC
Although the bspec lists several MMIO ranges as "MSLICE," it turns out
that a subset of these are of a "GAM" subclass that has unique rules and
doesn't followed regular mslice steering behavior.

 * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
   registers share the regular steering control register (0xFDC) with
   other steering types

 * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
   dedicated steering control register (0xFE0) so we can set the value
   once at startup and rely on implicit steering.  Technically the
   hardware default should already be set to 1,0 properly, but it never
   hurts to ensure that in the driver.

Bspec: 66534
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
 drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
 drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
 4 files changed, 34 insertions(+), 2 deletions(-)

Comments

Tvrtko Ursulin Sept. 16, 2022, 9:02 a.m. UTC | #1
On 16/09/2022 02:43, Matt Roper wrote:
> Although the bspec lists several MMIO ranges as "MSLICE," it turns out
> that a subset of these are of a "GAM" subclass that has unique rules and
> doesn't followed regular mslice steering behavior.
> 
>   * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
>     registers share the regular steering control register (0xFDC) with
>     other steering types
> 
>   * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
>     dedicated steering control register (0xFE0) so we can set the value
>     once at startup and rely on implicit steering.  Technically the
>     hardware default should already be set to 1,0 properly, but it never
>     hurts to ensure that in the driver.

Do you have any data on whether the "technically should" holds in 
practice? What would be the consequences of some platform/machine 
surprising us here?

Regards,

Tvrtko

> 
> Bspec: 66534
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
>   drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
>   drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
>   drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
>   4 files changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> index e79405a45312..a2047a68ea7a 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> @@ -40,6 +40,7 @@ static const char * const intel_steering_types[] = {
>   	"L3BANK",
>   	"MSLICE",
>   	"LNCF",
> +	"GAM",
>   	"INSTANCE 0",
>   };
>   
> @@ -48,14 +49,23 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = {
>   	{},
>   };
>   
> +/*
> + * Although the bspec lists more "MSLICE" ranges than shown here, some of those
> + * are of a "GAM" subclass that has special rules.  Thus we use a separate
> + * GAM table farther down for those.
> + */
>   static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
> -	{ 0x004000, 0x004AFF },
> -	{ 0x00C800, 0x00CFFF },
>   	{ 0x00DD00, 0x00DDFF },
>   	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
>   	{},
>   };
>   
> +static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
> +	{ 0x004000, 0x004AFF },
> +	{ 0x00C800, 0x00CFFF },
> +	{},
> +};
> +
>   static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
>   	{ 0x00B000, 0x00B0FF },
>   	{ 0x00D800, 0x00D8FF },
> @@ -114,9 +124,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
>   	} else if (IS_DG2(i915)) {
>   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
>   		gt->steering_table[LNCF] = dg2_lncf_steering_table;
> +		/*
> +		 * No need to hook up the GAM table since it has a dedicated
> +		 * steering control register on DG2 and can use implicit
> +		 * steering.
> +		 */
>   	} else if (IS_XEHPSDV(i915)) {
>   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
>   		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
> +		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
>   	} else if (GRAPHICS_VER(i915) >= 11 &&
>   		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
>   		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
> @@ -351,6 +367,10 @@ static void get_nonterminated_steering(struct intel_gt *gt,
>   		*group = __ffs(gt->info.mslice_mask) << 1;
>   		*instance = 0;	/* unused */
>   		break;
> +	case GAM:
> +		*group = IS_DG2(gt->i915) ? 1 : 0;
> +		*instance = 0;
> +		break;
>   	case INSTANCE0:
>   		/*
>   		 * There are a lot of MCR types for which instance (0, 0)
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> index 2275ee47da95..2343b26e0e21 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> @@ -42,6 +42,7 @@
>   #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
>   #define SF_MCR_SELECTOR				_MMIO(0xfd8)
>   #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
> +#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
>   #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
>   #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
>   #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> index f19c2de77ff6..30003d68fd51 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> @@ -59,6 +59,7 @@ enum intel_steering_type {
>   	L3BANK,
>   	MSLICE,
>   	LNCF,
> +	GAM,
>   
>   	/*
>   	 * On some platforms there are multiple types of MCR registers that
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index 6d2003d598e6..d04652a3b4e5 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -1181,6 +1181,9 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
>   		gt->steering_table[MSLICE] = NULL;
>   	}
>   
> +	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
> +		gt->steering_table[GAM] = NULL;
> +
>   	slice = __ffs(slice_mask);
>   	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
>   		GEN_DSS_PER_GSLICE;
> @@ -1198,6 +1201,13 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
>   	 */
>   	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
>   	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
> +
> +	/*
> +	 * On DG2, GAM registers have a dedicated steering control register
> +	 * and must always be programmed to a hardcoded groupid of "1."
> +	 */
> +	if (IS_DG2(gt->i915))
> +		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
>   }
>   
>   static void
Matt Roper Sept. 16, 2022, 2:53 p.m. UTC | #2
On Fri, Sep 16, 2022 at 10:02:32AM +0100, Tvrtko Ursulin wrote:
> 
> On 16/09/2022 02:43, Matt Roper wrote:
> > Although the bspec lists several MMIO ranges as "MSLICE," it turns out
> > that a subset of these are of a "GAM" subclass that has unique rules and
> > doesn't followed regular mslice steering behavior.
> > 
> >   * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
> >     registers share the regular steering control register (0xFDC) with
> >     other steering types
> > 
> >   * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
> >     dedicated steering control register (0xFE0) so we can set the value
> >     once at startup and rely on implicit steering.  Technically the
> >     hardware default should already be set to 1,0 properly, but it never
> >     hurts to ensure that in the driver.
> 
> Do you have any data on whether the "technically should" holds in practice?
> What would be the consequences of some platform/machine surprising us here?

The bspec indicates the hardware default value is already the necessary
1,0 value; I'm mostly paranoid about some kind of boot firmware wiping
it to 0,0 by accident.  I don't have any evidence that has ever actually
happened, but explicitly re-programming it to 1,0 in the patch here is a
defensive measure just to be safe.

If we didn't have this patch _and_ some firmware screwed up the GAM
steering target, then presumably we might read back garbage or 0 from
GAM registers in places where we should have received a real value.


Matt

> 
> Regards,
> 
> Tvrtko
> 
> > 
> > Bspec: 66534
> > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
> >   drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
> >   drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
> >   drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
> >   4 files changed, 34 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > index e79405a45312..a2047a68ea7a 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > @@ -40,6 +40,7 @@ static const char * const intel_steering_types[] = {
> >   	"L3BANK",
> >   	"MSLICE",
> >   	"LNCF",
> > +	"GAM",
> >   	"INSTANCE 0",
> >   };
> > @@ -48,14 +49,23 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = {
> >   	{},
> >   };
> > +/*
> > + * Although the bspec lists more "MSLICE" ranges than shown here, some of those
> > + * are of a "GAM" subclass that has special rules.  Thus we use a separate
> > + * GAM table farther down for those.
> > + */
> >   static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
> > -	{ 0x004000, 0x004AFF },
> > -	{ 0x00C800, 0x00CFFF },
> >   	{ 0x00DD00, 0x00DDFF },
> >   	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
> >   	{},
> >   };
> > +static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
> > +	{ 0x004000, 0x004AFF },
> > +	{ 0x00C800, 0x00CFFF },
> > +	{},
> > +};
> > +
> >   static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
> >   	{ 0x00B000, 0x00B0FF },
> >   	{ 0x00D800, 0x00D8FF },
> > @@ -114,9 +124,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
> >   	} else if (IS_DG2(i915)) {
> >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> >   		gt->steering_table[LNCF] = dg2_lncf_steering_table;
> > +		/*
> > +		 * No need to hook up the GAM table since it has a dedicated
> > +		 * steering control register on DG2 and can use implicit
> > +		 * steering.
> > +		 */
> >   	} else if (IS_XEHPSDV(i915)) {
> >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> >   		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
> > +		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
> >   	} else if (GRAPHICS_VER(i915) >= 11 &&
> >   		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
> >   		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
> > @@ -351,6 +367,10 @@ static void get_nonterminated_steering(struct intel_gt *gt,
> >   		*group = __ffs(gt->info.mslice_mask) << 1;
> >   		*instance = 0;	/* unused */
> >   		break;
> > +	case GAM:
> > +		*group = IS_DG2(gt->i915) ? 1 : 0;
> > +		*instance = 0;
> > +		break;
> >   	case INSTANCE0:
> >   		/*
> >   		 * There are a lot of MCR types for which instance (0, 0)
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > index 2275ee47da95..2343b26e0e21 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > @@ -42,6 +42,7 @@
> >   #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
> >   #define SF_MCR_SELECTOR				_MMIO(0xfd8)
> >   #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
> > +#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
> >   #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
> >   #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
> >   #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > index f19c2de77ff6..30003d68fd51 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > @@ -59,6 +59,7 @@ enum intel_steering_type {
> >   	L3BANK,
> >   	MSLICE,
> >   	LNCF,
> > +	GAM,
> >   	/*
> >   	 * On some platforms there are multiple types of MCR registers that
> > diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > index 6d2003d598e6..d04652a3b4e5 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > @@ -1181,6 +1181,9 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> >   		gt->steering_table[MSLICE] = NULL;
> >   	}
> > +	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
> > +		gt->steering_table[GAM] = NULL;
> > +
> >   	slice = __ffs(slice_mask);
> >   	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
> >   		GEN_DSS_PER_GSLICE;
> > @@ -1198,6 +1201,13 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> >   	 */
> >   	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
> >   	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
> > +
> > +	/*
> > +	 * On DG2, GAM registers have a dedicated steering control register
> > +	 * and must always be programmed to a hardcoded groupid of "1."
> > +	 */
> > +	if (IS_DG2(gt->i915))
> > +		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
> >   }
> >   static void
Kumar Valsan, Prathap Sept. 21, 2022, 4:58 p.m. UTC | #3
On Fri, Sep 16, 2022 at 07:53:40AM -0700, Matt Roper wrote:
> On Fri, Sep 16, 2022 at 10:02:32AM +0100, Tvrtko Ursulin wrote:
> > 
> > On 16/09/2022 02:43, Matt Roper wrote:
> > > Although the bspec lists several MMIO ranges as "MSLICE," it turns out
> > > that a subset of these are of a "GAM" subclass that has unique rules and
> > > doesn't followed regular mslice steering behavior.
> > > 
> > >   * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
> > >     registers share the regular steering control register (0xFDC) with
> > >     other steering types
> > > 
> > >   * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
> > >     dedicated steering control register (0xFE0) so we can set the value
> > >     once at startup and rely on implicit steering.  Technically the
> > >     hardware default should already be set to 1,0 properly, but it never
> > >     hurts to ensure that in the driver.
> > 
> > Do you have any data on whether the "technically should" holds in practice?
> > What would be the consequences of some platform/machine surprising us here?
> 
> The bspec indicates the hardware default value is already the necessary
> 1,0 value; I'm mostly paranoid about some kind of boot firmware wiping
> it to 0,0 by accident.  I don't have any evidence that has ever actually
> happened, but explicitly re-programming it to 1,0 in the patch here is a
> defensive measure just to be safe.
> 
> If we didn't have this patch _and_ some firmware screwed up the GAM
> steering target, then presumably we might read back garbage or 0 from
> GAM registers in places where we should have received a real value.
Will firmware ever touch the steering target registers. As i was going
through the respective hsd. The software driver impact is marked as none
so wondering if this change is really required ?

Thanks,
Prathap
> 
> 
> Matt
> 
> > 
> > Regards,
> > 
> > Tvrtko
> > 
> > > 
> > > Bspec: 66534
> > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > > ---
> > >   drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
> > >   drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
> > >   drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
> > >   drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
> > >   4 files changed, 34 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > index e79405a45312..a2047a68ea7a 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > @@ -40,6 +40,7 @@ static const char * const intel_steering_types[] = {
> > >   	"L3BANK",
> > >   	"MSLICE",
> > >   	"LNCF",
> > > +	"GAM",
> > >   	"INSTANCE 0",
> > >   };
> > > @@ -48,14 +49,23 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = {
> > >   	{},
> > >   };
> > > +/*
> > > + * Although the bspec lists more "MSLICE" ranges than shown here, some of those
> > > + * are of a "GAM" subclass that has special rules.  Thus we use a separate
> > > + * GAM table farther down for those.
> > > + */
> > >   static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
> > > -	{ 0x004000, 0x004AFF },
> > > -	{ 0x00C800, 0x00CFFF },
> > >   	{ 0x00DD00, 0x00DDFF },
> > >   	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
> > >   	{},
> > >   };
> > > +static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
> > > +	{ 0x004000, 0x004AFF },
> > > +	{ 0x00C800, 0x00CFFF },
> > > +	{},
> > > +};
> > > +
> > >   static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
> > >   	{ 0x00B000, 0x00B0FF },
> > >   	{ 0x00D800, 0x00D8FF },
> > > @@ -114,9 +124,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
> > >   	} else if (IS_DG2(i915)) {
> > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > >   		gt->steering_table[LNCF] = dg2_lncf_steering_table;
> > > +		/*
> > > +		 * No need to hook up the GAM table since it has a dedicated
> > > +		 * steering control register on DG2 and can use implicit
> > > +		 * steering.
> > > +		 */
> > >   	} else if (IS_XEHPSDV(i915)) {
> > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > >   		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
> > > +		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
> > >   	} else if (GRAPHICS_VER(i915) >= 11 &&
> > >   		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
> > >   		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
> > > @@ -351,6 +367,10 @@ static void get_nonterminated_steering(struct intel_gt *gt,
> > >   		*group = __ffs(gt->info.mslice_mask) << 1;
> > >   		*instance = 0;	/* unused */
> > >   		break;
> > > +	case GAM:
> > > +		*group = IS_DG2(gt->i915) ? 1 : 0;
> > > +		*instance = 0;
> > > +		break;
> > >   	case INSTANCE0:
> > >   		/*
> > >   		 * There are a lot of MCR types for which instance (0, 0)
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > index 2275ee47da95..2343b26e0e21 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > @@ -42,6 +42,7 @@
> > >   #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
> > >   #define SF_MCR_SELECTOR				_MMIO(0xfd8)
> > >   #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
> > > +#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
> > >   #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
> > >   #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
> > >   #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > index f19c2de77ff6..30003d68fd51 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > @@ -59,6 +59,7 @@ enum intel_steering_type {
> > >   	L3BANK,
> > >   	MSLICE,
> > >   	LNCF,
> > > +	GAM,
> > >   	/*
> > >   	 * On some platforms there are multiple types of MCR registers that
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > index 6d2003d598e6..d04652a3b4e5 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > @@ -1181,6 +1181,9 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > >   		gt->steering_table[MSLICE] = NULL;
> > >   	}
> > > +	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
> > > +		gt->steering_table[GAM] = NULL;
> > > +
> > >   	slice = __ffs(slice_mask);
> > >   	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
> > >   		GEN_DSS_PER_GSLICE;
> > > @@ -1198,6 +1201,13 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > >   	 */
> > >   	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
> > >   	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
> > > +
> > > +	/*
> > > +	 * On DG2, GAM registers have a dedicated steering control register
> > > +	 * and must always be programmed to a hardcoded groupid of "1."
> > > +	 */
> > > +	if (IS_DG2(gt->i915))
> > > +		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
> > >   }
> > >   static void
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
Matt Roper Sept. 21, 2022, 7:26 p.m. UTC | #4
On Wed, Sep 21, 2022 at 12:58:08PM -0400, Kumar Valsan, Prathap wrote:
> On Fri, Sep 16, 2022 at 07:53:40AM -0700, Matt Roper wrote:
> > On Fri, Sep 16, 2022 at 10:02:32AM +0100, Tvrtko Ursulin wrote:
> > > 
> > > On 16/09/2022 02:43, Matt Roper wrote:
> > > > Although the bspec lists several MMIO ranges as "MSLICE," it turns out
> > > > that a subset of these are of a "GAM" subclass that has unique rules and
> > > > doesn't followed regular mslice steering behavior.
> > > > 
> > > >   * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
> > > >     registers share the regular steering control register (0xFDC) with
> > > >     other steering types
> > > > 
> > > >   * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
> > > >     dedicated steering control register (0xFE0) so we can set the value
> > > >     once at startup and rely on implicit steering.  Technically the
> > > >     hardware default should already be set to 1,0 properly, but it never
> > > >     hurts to ensure that in the driver.
> > > 
> > > Do you have any data on whether the "technically should" holds in practice?
> > > What would be the consequences of some platform/machine surprising us here?
> > 
> > The bspec indicates the hardware default value is already the necessary
> > 1,0 value; I'm mostly paranoid about some kind of boot firmware wiping
> > it to 0,0 by accident.  I don't have any evidence that has ever actually
> > happened, but explicitly re-programming it to 1,0 in the patch here is a
> > defensive measure just to be safe.
> > 
> > If we didn't have this patch _and_ some firmware screwed up the GAM
> > steering target, then presumably we might read back garbage or 0 from
> > GAM registers in places where we should have received a real value.
> Will firmware ever touch the steering target registers. As i was going
> through the respective hsd. The software driver impact is marked as none
> so wondering if this change is really required ?

The GAM only has a dedicated steering register on DG2; on XEHPSDV it
shares 0xFDC with all the other kinds of steering, so it is important to
handle this range independently of the MSLICE range and make sure we
properly re-steer GAM accesses to the primary instance (and not just any
random MSLICE) there.

On DG2, if we assume firmware behaves properly, the dedicated steering
register is initialized properly and we don't need to explicitly
re-steer.  However this patch will ensure that we don't needlessly
re-program 0xFDC according to MSLICE rules when accessing a GAM
register.

There's also the worry that firmware may try to "sanitize" the registers
at startup by programming them to what it thinks are appropriate default
values.  Given that DG2's primary GAM is unusual (instance 1, instead of
instance 0 as on other platforms), this feels like a place where
firmware bugs could creep in.  They hopefully/probably won't, but
ensuring we forcefully initialize 0xFE0 to the proper value just ensures
that we don't even have to worry about it.

Finally, splitting the GAM from MSLICE ensures we get more accurate
debug messages from the drm_printer in dmesg and debugfs.


Matt

> 
> Thanks,
> Prathap
> > 
> > 
> > Matt
> > 
> > > 
> > > Regards,
> > > 
> > > Tvrtko
> > > 
> > > > 
> > > > Bspec: 66534
> > > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > > > ---
> > > >   drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
> > > >   drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
> > > >   drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
> > > >   drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
> > > >   4 files changed, 34 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > index e79405a45312..a2047a68ea7a 100644
> > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > @@ -40,6 +40,7 @@ static const char * const intel_steering_types[] = {
> > > >   	"L3BANK",
> > > >   	"MSLICE",
> > > >   	"LNCF",
> > > > +	"GAM",
> > > >   	"INSTANCE 0",
> > > >   };
> > > > @@ -48,14 +49,23 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = {
> > > >   	{},
> > > >   };
> > > > +/*
> > > > + * Although the bspec lists more "MSLICE" ranges than shown here, some of those
> > > > + * are of a "GAM" subclass that has special rules.  Thus we use a separate
> > > > + * GAM table farther down for those.
> > > > + */
> > > >   static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
> > > > -	{ 0x004000, 0x004AFF },
> > > > -	{ 0x00C800, 0x00CFFF },
> > > >   	{ 0x00DD00, 0x00DDFF },
> > > >   	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
> > > >   	{},
> > > >   };
> > > > +static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
> > > > +	{ 0x004000, 0x004AFF },
> > > > +	{ 0x00C800, 0x00CFFF },
> > > > +	{},
> > > > +};
> > > > +
> > > >   static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
> > > >   	{ 0x00B000, 0x00B0FF },
> > > >   	{ 0x00D800, 0x00D8FF },
> > > > @@ -114,9 +124,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
> > > >   	} else if (IS_DG2(i915)) {
> > > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > > >   		gt->steering_table[LNCF] = dg2_lncf_steering_table;
> > > > +		/*
> > > > +		 * No need to hook up the GAM table since it has a dedicated
> > > > +		 * steering control register on DG2 and can use implicit
> > > > +		 * steering.
> > > > +		 */
> > > >   	} else if (IS_XEHPSDV(i915)) {
> > > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > > >   		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
> > > > +		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
> > > >   	} else if (GRAPHICS_VER(i915) >= 11 &&
> > > >   		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
> > > >   		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
> > > > @@ -351,6 +367,10 @@ static void get_nonterminated_steering(struct intel_gt *gt,
> > > >   		*group = __ffs(gt->info.mslice_mask) << 1;
> > > >   		*instance = 0;	/* unused */
> > > >   		break;
> > > > +	case GAM:
> > > > +		*group = IS_DG2(gt->i915) ? 1 : 0;
> > > > +		*instance = 0;
> > > > +		break;
> > > >   	case INSTANCE0:
> > > >   		/*
> > > >   		 * There are a lot of MCR types for which instance (0, 0)
> > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > index 2275ee47da95..2343b26e0e21 100644
> > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > @@ -42,6 +42,7 @@
> > > >   #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
> > > >   #define SF_MCR_SELECTOR				_MMIO(0xfd8)
> > > >   #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
> > > > +#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
> > > >   #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
> > > >   #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
> > > >   #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
> > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > index f19c2de77ff6..30003d68fd51 100644
> > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > @@ -59,6 +59,7 @@ enum intel_steering_type {
> > > >   	L3BANK,
> > > >   	MSLICE,
> > > >   	LNCF,
> > > > +	GAM,
> > > >   	/*
> > > >   	 * On some platforms there are multiple types of MCR registers that
> > > > diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > index 6d2003d598e6..d04652a3b4e5 100644
> > > > --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > @@ -1181,6 +1181,9 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > > >   		gt->steering_table[MSLICE] = NULL;
> > > >   	}
> > > > +	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
> > > > +		gt->steering_table[GAM] = NULL;
> > > > +
> > > >   	slice = __ffs(slice_mask);
> > > >   	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
> > > >   		GEN_DSS_PER_GSLICE;
> > > > @@ -1198,6 +1201,13 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > > >   	 */
> > > >   	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
> > > >   	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
> > > > +
> > > > +	/*
> > > > +	 * On DG2, GAM registers have a dedicated steering control register
> > > > +	 * and must always be programmed to a hardcoded groupid of "1."
> > > > +	 */
> > > > +	if (IS_DG2(gt->i915))
> > > > +		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
> > > >   }
> > > >   static void
> > 
> > -- 
> > Matt Roper
> > Graphics Software Engineer
> > VTT-OSGC Platform Enablement
> > Intel Corporation
Kumar Valsan, Prathap Sept. 21, 2022, 7:46 p.m. UTC | #5
On Wed, Sep 21, 2022 at 12:26:17PM -0700, Matt Roper wrote:
> On Wed, Sep 21, 2022 at 12:58:08PM -0400, Kumar Valsan, Prathap wrote:
> > On Fri, Sep 16, 2022 at 07:53:40AM -0700, Matt Roper wrote:
> > > On Fri, Sep 16, 2022 at 10:02:32AM +0100, Tvrtko Ursulin wrote:
> > > > 
> > > > On 16/09/2022 02:43, Matt Roper wrote:
> > > > > Although the bspec lists several MMIO ranges as "MSLICE," it turns out
> > > > > that a subset of these are of a "GAM" subclass that has unique rules and
> > > > > doesn't followed regular mslice steering behavior.
> > > > > 
> > > > >   * Xe_HP SDV:  GAM ranges must always be steered to 0,0.  These
> > > > >     registers share the regular steering control register (0xFDC) with
> > > > >     other steering types
> > > > > 
> > > > >   * DG2:  GAM ranges must always be steered to 1,0.  GAM registers have a
> > > > >     dedicated steering control register (0xFE0) so we can set the value
> > > > >     once at startup and rely on implicit steering.  Technically the
> > > > >     hardware default should already be set to 1,0 properly, but it never
> > > > >     hurts to ensure that in the driver.
> > > > 
> > > > Do you have any data on whether the "technically should" holds in practice?
> > > > What would be the consequences of some platform/machine surprising us here?
> > > 
> > > The bspec indicates the hardware default value is already the necessary
> > > 1,0 value; I'm mostly paranoid about some kind of boot firmware wiping
> > > it to 0,0 by accident.  I don't have any evidence that has ever actually
> > > happened, but explicitly re-programming it to 1,0 in the patch here is a
> > > defensive measure just to be safe.
> > > 
> > > If we didn't have this patch _and_ some firmware screwed up the GAM
> > > steering target, then presumably we might read back garbage or 0 from
> > > GAM registers in places where we should have received a real value.
> > Will firmware ever touch the steering target registers. As i was going
> > through the respective hsd. The software driver impact is marked as none
> > so wondering if this change is really required ?
> 
> The GAM only has a dedicated steering register on DG2; on XEHPSDV it
> shares 0xFDC with all the other kinds of steering, so it is important to
> handle this range independently of the MSLICE range and make sure we
> properly re-steer GAM accesses to the primary instance (and not just any
> random MSLICE) there.
Ok. I missed that part.
> 
> On DG2, if we assume firmware behaves properly, the dedicated steering
> register is initialized properly and we don't need to explicitly
> re-steer.  However this patch will ensure that we don't needlessly
> re-program 0xFDC according to MSLICE rules when accessing a GAM
> register.
> 
> There's also the worry that firmware may try to "sanitize" the registers
> at startup by programming them to what it thinks are appropriate default
> values.  Given that DG2's primary GAM is unusual (instance 1, instead of
> instance 0 as on other platforms), this feels like a place where
> firmware bugs could creep in.  They hopefully/probably won't, but
> ensuring we forcefully initialize 0xFE0 to the proper value just ensures
> that we don't even have to worry about it.
Got it.
> 
> Finally, splitting the GAM from MSLICE ensures we get more accurate
> debug messages from the drm_printer in dmesg and debugfs.
> 
Looks good to me.

Reviewed-by: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>
> 
> Matt
> 
> > 
> > Thanks,
> > Prathap
> > > 
> > > 
> > > Matt
> > > 
> > > > 
> > > > Regards,
> > > > 
> > > > Tvrtko
> > > > 
> > > > > 
> > > > > Bspec: 66534
> > > > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > > > > ---
> > > > >   drivers/gpu/drm/i915/gt/intel_gt_mcr.c      | 24 +++++++++++++++++++--
> > > > >   drivers/gpu/drm/i915/gt/intel_gt_regs.h     |  1 +
> > > > >   drivers/gpu/drm/i915/gt/intel_gt_types.h    |  1 +
> > > > >   drivers/gpu/drm/i915/gt/intel_workarounds.c | 10 +++++++++
> > > > >   4 files changed, 34 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > > index e79405a45312..a2047a68ea7a 100644
> > > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
> > > > > @@ -40,6 +40,7 @@ static const char * const intel_steering_types[] = {
> > > > >   	"L3BANK",
> > > > >   	"MSLICE",
> > > > >   	"LNCF",
> > > > > +	"GAM",
> > > > >   	"INSTANCE 0",
> > > > >   };
> > > > > @@ -48,14 +49,23 @@ static const struct intel_mmio_range icl_l3bank_steering_table[] = {
> > > > >   	{},
> > > > >   };
> > > > > +/*
> > > > > + * Although the bspec lists more "MSLICE" ranges than shown here, some of those
> > > > > + * are of a "GAM" subclass that has special rules.  Thus we use a separate
> > > > > + * GAM table farther down for those.
> > > > > + */
> > > > >   static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
> > > > > -	{ 0x004000, 0x004AFF },
> > > > > -	{ 0x00C800, 0x00CFFF },
> > > > >   	{ 0x00DD00, 0x00DDFF },
> > > > >   	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
> > > > >   	{},
> > > > >   };
> > > > > +static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
> > > > > +	{ 0x004000, 0x004AFF },
> > > > > +	{ 0x00C800, 0x00CFFF },
> > > > > +	{},
> > > > > +};
> > > > > +
> > > > >   static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
> > > > >   	{ 0x00B000, 0x00B0FF },
> > > > >   	{ 0x00D800, 0x00D8FF },
> > > > > @@ -114,9 +124,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
> > > > >   	} else if (IS_DG2(i915)) {
> > > > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > > > >   		gt->steering_table[LNCF] = dg2_lncf_steering_table;
> > > > > +		/*
> > > > > +		 * No need to hook up the GAM table since it has a dedicated
> > > > > +		 * steering control register on DG2 and can use implicit
> > > > > +		 * steering.
> > > > > +		 */
> > > > >   	} else if (IS_XEHPSDV(i915)) {
> > > > >   		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
> > > > >   		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
> > > > > +		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
> > > > >   	} else if (GRAPHICS_VER(i915) >= 11 &&
> > > > >   		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
> > > > >   		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
> > > > > @@ -351,6 +367,10 @@ static void get_nonterminated_steering(struct intel_gt *gt,
> > > > >   		*group = __ffs(gt->info.mslice_mask) << 1;
> > > > >   		*instance = 0;	/* unused */
> > > > >   		break;
> > > > > +	case GAM:
> > > > > +		*group = IS_DG2(gt->i915) ? 1 : 0;
> > > > > +		*instance = 0;
> > > > > +		break;
> > > > >   	case INSTANCE0:
> > > > >   		/*
> > > > >   		 * There are a lot of MCR types for which instance (0, 0)
> > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > > index 2275ee47da95..2343b26e0e21 100644
> > > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > > > > @@ -42,6 +42,7 @@
> > > > >   #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
> > > > >   #define SF_MCR_SELECTOR				_MMIO(0xfd8)
> > > > >   #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
> > > > > +#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
> > > > >   #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
> > > > >   #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
> > > > >   #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
> > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > > index f19c2de77ff6..30003d68fd51 100644
> > > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> > > > > @@ -59,6 +59,7 @@ enum intel_steering_type {
> > > > >   	L3BANK,
> > > > >   	MSLICE,
> > > > >   	LNCF,
> > > > > +	GAM,
> > > > >   	/*
> > > > >   	 * On some platforms there are multiple types of MCR registers that
> > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > > index 6d2003d598e6..d04652a3b4e5 100644
> > > > > --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > > +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> > > > > @@ -1181,6 +1181,9 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > > > >   		gt->steering_table[MSLICE] = NULL;
> > > > >   	}
> > > > > +	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
> > > > > +		gt->steering_table[GAM] = NULL;
> > > > > +
> > > > >   	slice = __ffs(slice_mask);
> > > > >   	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
> > > > >   		GEN_DSS_PER_GSLICE;
> > > > > @@ -1198,6 +1201,13 @@ xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
> > > > >   	 */
> > > > >   	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
> > > > >   	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
> > > > > +
> > > > > +	/*
> > > > > +	 * On DG2, GAM registers have a dedicated steering control register
> > > > > +	 * and must always be programmed to a hardcoded groupid of "1."
> > > > > +	 */
> > > > > +	if (IS_DG2(gt->i915))
> > > > > +		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
> > > > >   }
> > > > >   static void
> > > 
> > > -- 
> > > Matt Roper
> > > Graphics Software Engineer
> > > VTT-OSGC Platform Enablement
> > > Intel Corporation
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
Matt Roper Sept. 21, 2022, 8:07 p.m. UTC | #6
On Fri, Sep 16, 2022 at 08:41:54AM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Split GAM and MSLICE steering
> URL   : https://patchwork.freedesktop.org/series/108627/
> State : success
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_12144_full -> Patchwork_108627v1_full
> ====================================================
> 
> Summary
> -------
> 
>   **SUCCESS**
> 
>   No regressions found.
> 

Applied to drm-intel-gt-next.  Thanks Prathap for the review.


Matt

>   
> 
> Participating hosts (11 -> 11)
> ------------------------------
> 
>   No changes in participating hosts
> 
> Known issues
> ------------
> 
>   Here are the changes found in Patchwork_108627v1_full that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@gem_eio@unwedge-stress:
>     - shard-iclb:         [PASS][1] -> [TIMEOUT][2] ([i915#3070])
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-iclb7/igt@gem_eio@unwedge-stress.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb5/igt@gem_eio@unwedge-stress.html
> 
>   * igt@gem_exec_balancer@parallel-keep-in-fence:
>     - shard-iclb:         [PASS][3] -> [SKIP][4] ([i915#4525]) +2 similar issues
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-iclb1/igt@gem_exec_balancer@parallel-keep-in-fence.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb3/igt@gem_exec_balancer@parallel-keep-in-fence.html
> 
>   * igt@gem_exec_fair@basic-flow@rcs0:
>     - shard-tglb:         [PASS][5] -> [FAIL][6] ([i915#2842])
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-tglb1/igt@gem_exec_fair@basic-flow@rcs0.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-tglb7/igt@gem_exec_fair@basic-flow@rcs0.html
> 
>   * igt@gem_exec_fair@basic-none@vcs1:
>     - shard-iclb:         NOTRUN -> [FAIL][7] ([i915#2842])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb1/igt@gem_exec_fair@basic-none@vcs1.html
> 
>   * igt@gem_exec_fair@basic-none@vecs0:
>     - shard-glk:          [PASS][8] -> [FAIL][9] ([i915#2842])
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-glk2/igt@gem_exec_fair@basic-none@vecs0.html
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk3/igt@gem_exec_fair@basic-none@vecs0.html
> 
>   * igt@gem_exec_fair@basic-pace-share@rcs0:
>     - shard-apl:          [PASS][10] -> [FAIL][11] ([i915#2842])
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl4/igt@gem_exec_fair@basic-pace-share@rcs0.html
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl8/igt@gem_exec_fair@basic-pace-share@rcs0.html
> 
>   * igt@gem_huc_copy@huc-copy:
>     - shard-tglb:         [PASS][12] -> [SKIP][13] ([i915#2190])
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-tglb3/igt@gem_huc_copy@huc-copy.html
>    [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-tglb7/igt@gem_huc_copy@huc-copy.html
> 
>   * igt@gem_lmem_swapping@verify-random:
>     - shard-apl:          NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#4613])
>    [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@gem_lmem_swapping@verify-random.html
> 
>   * igt@gem_pxp@reject-modify-context-protection-off-3:
>     - shard-apl:          NOTRUN -> [SKIP][15] ([fdo#109271]) +44 similar issues
>    [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@gem_pxp@reject-modify-context-protection-off-3.html
> 
>   * igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs:
>     - shard-apl:          NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#3886]) +2 similar issues
>    [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html
> 
>   * igt@kms_chamelium@dp-hpd-with-enabled-mode:
>     - shard-apl:          NOTRUN -> [SKIP][17] ([fdo#109271] / [fdo#111827])
>    [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@kms_chamelium@dp-hpd-with-enabled-mode.html
> 
>   * igt@kms_flip@2x-flip-vs-absolute-wf_vblank@ab-hdmi-a1-hdmi-a2:
>     - shard-glk:          [PASS][18] -> [FAIL][19] ([i915#2122])
>    [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-glk9/igt@kms_flip@2x-flip-vs-absolute-wf_vblank@ab-hdmi-a1-hdmi-a2.html
>    [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk9/igt@kms_flip@2x-flip-vs-absolute-wf_vblank@ab-hdmi-a1-hdmi-a2.html
> 
>   * igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode:
>     - shard-iclb:         NOTRUN -> [SKIP][20] ([i915#2587] / [i915#2672]) +3 similar issues
>    [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb7/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode.html
> 
>   * igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling@pipe-a-default-mode:
>     - shard-iclb:         NOTRUN -> [SKIP][21] ([i915#2672]) +2 similar issues
>    [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb3/igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling@pipe-a-default-mode.html
> 
>   * igt@kms_psr2_su@frontbuffer-xrgb8888:
>     - shard-apl:          NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#658])
>    [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@kms_psr2_su@frontbuffer-xrgb8888.html
> 
>   * igt@nouveau_crc@pipe-b-ctx-flip-detection:
>     - shard-glk:          NOTRUN -> [SKIP][23] ([fdo#109271]) +1 similar issue
>    [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk6/igt@nouveau_crc@pipe-b-ctx-flip-detection.html
> 
>   * igt@perf_pmu@rc6-suspend:
>     - shard-apl:          [PASS][24] -> [DMESG-WARN][25] ([i915#180])
>    [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl3/igt@perf_pmu@rc6-suspend.html
>    [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl1/igt@perf_pmu@rc6-suspend.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@gem_busy@close-race:
>     - shard-glk:          [TIMEOUT][26] ([i915#6016]) -> [PASS][27]
>    [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-glk2/igt@gem_busy@close-race.html
>    [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk6/igt@gem_busy@close-race.html
> 
>   * igt@gem_exec_balancer@parallel:
>     - shard-iclb:         [SKIP][28] ([i915#4525]) -> [PASS][29]
>    [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-iclb5/igt@gem_exec_balancer@parallel.html
>    [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb4/igt@gem_exec_balancer@parallel.html
> 
>   * igt@gem_exec_fair@basic-none-vip@rcs0:
>     - shard-glk:          [FAIL][30] ([i915#2842]) -> [PASS][31]
>    [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-glk3/igt@gem_exec_fair@basic-none-vip@rcs0.html
>    [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk5/igt@gem_exec_fair@basic-none-vip@rcs0.html
> 
>   * igt@gem_exec_schedule@wide@rcs0:
>     - {shard-tglu}:       [INCOMPLETE][32] ([i915#6772]) -> [PASS][33]
>    [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-tglu-1/igt@gem_exec_schedule@wide@rcs0.html
>    [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-tglu-4/igt@gem_exec_schedule@wide@rcs0.html
> 
>   * igt@i915_pm_dc@dc9-dpms:
>     - shard-iclb:         [SKIP][34] ([i915#4281]) -> [PASS][35]
>    [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-iclb3/igt@i915_pm_dc@dc9-dpms.html
>    [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-iclb7/igt@i915_pm_dc@dc9-dpms.html
> 
>   * igt@i915_pm_rps@engine-order:
>     - shard-apl:          [FAIL][36] ([i915#6537]) -> [PASS][37]
>    [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl4/igt@i915_pm_rps@engine-order.html
>    [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl8/igt@i915_pm_rps@engine-order.html
> 
>   * igt@kms_flip@flip-vs-suspend-interruptible@b-dp1:
>     - shard-apl:          [DMESG-WARN][38] ([i915#180]) -> [PASS][39] +1 similar issue
>    [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl8/igt@kms_flip@flip-vs-suspend-interruptible@b-dp1.html
>    [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl7/igt@kms_flip@flip-vs-suspend-interruptible@b-dp1.html
> 
>   * igt@kms_plane_lowres@tiling-y@pipe-c-hdmi-a-2:
>     - shard-glk:          [FAIL][40] ([i915#1036] / [i915#1888]) -> [PASS][41]
>    [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-glk3/igt@kms_plane_lowres@tiling-y@pipe-c-hdmi-a-2.html
>    [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-glk5/igt@kms_plane_lowres@tiling-y@pipe-c-hdmi-a-2.html
> 
>   * igt@perf@polling-parameterized:
>     - shard-apl:          [FAIL][42] ([i915#5639]) -> [PASS][43]
>    [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl6/igt@perf@polling-parameterized.html
>    [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl3/igt@perf@polling-parameterized.html
> 
>   
> #### Warnings ####
> 
>   * igt@gem_exec_fair@basic-pace@bcs0:
>     - shard-tglb:         [FAIL][44] ([i915#2876]) -> [FAIL][45] ([i915#2842])
>    [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-tglb6/igt@gem_exec_fair@basic-pace@bcs0.html
>    [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-tglb3/igt@gem_exec_fair@basic-pace@bcs0.html
> 
>   * igt@runner@aborted:
>     - shard-apl:          ([FAIL][46], [FAIL][47], [FAIL][48], [FAIL][49]) ([i915#180] / [i915#3002] / [i915#4312] / [i915#5257] / [i915#6599]) -> ([FAIL][50], [FAIL][51]) ([i915#3002] / [i915#4312] / [i915#5257] / [i915#6599])
>    [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl6/igt@runner@aborted.html
>    [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl1/igt@runner@aborted.html
>    [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl3/igt@runner@aborted.html
>    [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12144/shard-apl8/igt@runner@aborted.html
>    [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl2/igt@runner@aborted.html
>    [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/shard-apl1/igt@runner@aborted.html
> 
>   
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
>   [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
>   [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
>   [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
>   [fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
>   [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
>   [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
>   [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
>   [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
>   [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
>   [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
>   [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
>   [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
>   [i915#1036]: https://gitlab.freedesktop.org/drm/intel/issues/1036
>   [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
>   [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
>   [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
>   [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
>   [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
>   [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
>   [i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
>   [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
>   [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
>   [i915#2530]: https://gitlab.freedesktop.org/drm/intel/issues/2530
>   [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
>   [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
>   [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
>   [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
>   [i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
>   [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
>   [i915#2876]: https://gitlab.freedesktop.org/drm/intel/issues/2876
>   [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
>   [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
>   [i915#3070]: https://gitlab.freedesktop.org/drm/intel/issues/3070
>   [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
>   [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
>   [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
>   [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
>   [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
>   [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
>   [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
>   [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
>   [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
>   [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
>   [i915#3826]: https://gitlab.freedesktop.org/drm/intel/issues/3826
>   [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
>   [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
>   [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
>   [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
>   [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
>   [i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
>   [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
>   [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
>   [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
>   [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
>   [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
>   [i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
>   [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
>   [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
>   [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
>   [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
>   [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
>   [i915#5639]: https://gitlab.freedesktop.org/drm/intel/issues/5639
>   [i915#6016]: https://gitlab.freedesktop.org/drm/intel/issues/6016
>   [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
>   [i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
>   [i915#6474]: https://gitlab.freedesktop.org/drm/intel/issues/6474
>   [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
>   [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
>   [i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
>   [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
>   [i915#6599]: https://gitlab.freedesktop.org/drm/intel/issues/6599
>   [i915#6772]: https://gitlab.freedesktop.org/drm/intel/issues/6772
> 
> 
> Build changes
> -------------
> 
>   * Linux: CI_DRM_12144 -> Patchwork_108627v1
> 
>   CI-20190529: 20190529
>   CI_DRM_12144: 55937d402fd885fe101cdd028dcc48df6d7f6b35 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_6656: 24100c4e181c50e3678aeca9c641b8a43555ad73 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
>   Patchwork_108627v1: 55937d402fd885fe101cdd028dcc48df6d7f6b35 @ git://anongit.freedesktop.org/gfx-ci/linux
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_108627v1/index.html
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
index e79405a45312..a2047a68ea7a 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
@@ -40,6 +40,7 @@  static const char * const intel_steering_types[] = {
 	"L3BANK",
 	"MSLICE",
 	"LNCF",
+	"GAM",
 	"INSTANCE 0",
 };
 
@@ -48,14 +49,23 @@  static const struct intel_mmio_range icl_l3bank_steering_table[] = {
 	{},
 };
 
+/*
+ * Although the bspec lists more "MSLICE" ranges than shown here, some of those
+ * are of a "GAM" subclass that has special rules.  Thus we use a separate
+ * GAM table farther down for those.
+ */
 static const struct intel_mmio_range xehpsdv_mslice_steering_table[] = {
-	{ 0x004000, 0x004AFF },
-	{ 0x00C800, 0x00CFFF },
 	{ 0x00DD00, 0x00DDFF },
 	{ 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
 	{},
 };
 
+static const struct intel_mmio_range xehpsdv_gam_steering_table[] = {
+	{ 0x004000, 0x004AFF },
+	{ 0x00C800, 0x00CFFF },
+	{},
+};
+
 static const struct intel_mmio_range xehpsdv_lncf_steering_table[] = {
 	{ 0x00B000, 0x00B0FF },
 	{ 0x00D800, 0x00D8FF },
@@ -114,9 +124,15 @@  void intel_gt_mcr_init(struct intel_gt *gt)
 	} else if (IS_DG2(i915)) {
 		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
 		gt->steering_table[LNCF] = dg2_lncf_steering_table;
+		/*
+		 * No need to hook up the GAM table since it has a dedicated
+		 * steering control register on DG2 and can use implicit
+		 * steering.
+		 */
 	} else if (IS_XEHPSDV(i915)) {
 		gt->steering_table[MSLICE] = xehpsdv_mslice_steering_table;
 		gt->steering_table[LNCF] = xehpsdv_lncf_steering_table;
+		gt->steering_table[GAM] = xehpsdv_gam_steering_table;
 	} else if (GRAPHICS_VER(i915) >= 11 &&
 		   GRAPHICS_VER_FULL(i915) < IP_VER(12, 50)) {
 		gt->steering_table[L3BANK] = icl_l3bank_steering_table;
@@ -351,6 +367,10 @@  static void get_nonterminated_steering(struct intel_gt *gt,
 		*group = __ffs(gt->info.mslice_mask) << 1;
 		*instance = 0;	/* unused */
 		break;
+	case GAM:
+		*group = IS_DG2(gt->i915) ? 1 : 0;
+		*instance = 0;
+		break;
 	case INSTANCE0:
 		/*
 		 * There are a lot of MCR types for which instance (0, 0)
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
index 2275ee47da95..2343b26e0e21 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
@@ -42,6 +42,7 @@ 
 #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
 #define SF_MCR_SELECTOR				_MMIO(0xfd8)
 #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
+#define GAM_MCR_SELECTOR			_MMIO(0xfe0)
 #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
 #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
 #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
index f19c2de77ff6..30003d68fd51 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
@@ -59,6 +59,7 @@  enum intel_steering_type {
 	L3BANK,
 	MSLICE,
 	LNCF,
+	GAM,
 
 	/*
 	 * On some platforms there are multiple types of MCR registers that
diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
index 6d2003d598e6..d04652a3b4e5 100644
--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
@@ -1181,6 +1181,9 @@  xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
 		gt->steering_table[MSLICE] = NULL;
 	}
 
+	if (IS_XEHPSDV(gt->i915) && slice_mask & BIT(0))
+		gt->steering_table[GAM] = NULL;
+
 	slice = __ffs(slice_mask);
 	subslice = intel_sseu_find_first_xehp_dss(sseu, GEN_DSS_PER_GSLICE, slice) %
 		GEN_DSS_PER_GSLICE;
@@ -1198,6 +1201,13 @@  xehp_init_mcr(struct intel_gt *gt, struct i915_wa_list *wal)
 	 */
 	__set_mcr_steering(wal, MCFG_MCR_SELECTOR, 0, 2);
 	__set_mcr_steering(wal, SF_MCR_SELECTOR, 0, 2);
+
+	/*
+	 * On DG2, GAM registers have a dedicated steering control register
+	 * and must always be programmed to a hardcoded groupid of "1."
+	 */
+	if (IS_DG2(gt->i915))
+		__set_mcr_steering(wal, GAM_MCR_SELECTOR, 1, 0);
 }
 
 static void