Skip to content

Commit e8f7df1

Browse files
author
Lucas De Marchi
committed
drm/i915/gt: Clear all bits from GEN12_FF_MODE2
Right now context workarounds don't do a rmw and instead only write to the register. Since 2 separate programmings to the same register are coalesced into a single write, this is not problematic for GEN12_FF_MODE2 since both TDS and GS timer are going to be written together and the other remaining bits be zeroed. However in order to fix other workarounds that may want to preserve the unrelated bits in the same register, context workarounds need to be changed to a rmw. To prepare for that, move the programming of GEN12_FF_MODE2 to a single place so the value passed for "clear" can be all the bits. Otherwise the second workaround would be dropped as it'd be detected as overwriting a previously programmed workaround. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230630203509.1635216-3-lucas.demarchi@intel.com
1 parent f567947 commit e8f7df1

1 file changed

Lines changed: 17 additions & 34 deletions

File tree

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

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -693,40 +693,11 @@ static void dg2_ctx_gt_tuning_init(struct intel_engine_cs *engine,
693693
0, false);
694694
}
695695

696-
/*
697-
* These settings aren't actually workarounds, but general tuning settings that
698-
* need to be programmed on several platforms.
699-
*/
700-
static void gen12_ctx_gt_tuning_init(struct intel_engine_cs *engine,
701-
struct i915_wa_list *wal)
702-
{
703-
/*
704-
* Although some platforms refer to it as Wa_1604555607, we need to
705-
* program it even on those that don't explicitly list that
706-
* workaround.
707-
*
708-
* Note that the programming of this register is further modified
709-
* according to the FF_MODE2 guidance given by Wa_1608008084:gen12.
710-
* Wa_1608008084 tells us the FF_MODE2 register will return the wrong
711-
* value when read. The default value for this register is zero for all
712-
* fields and there are no bit masks. So instead of doing a RMW we
713-
* should just write TDS timer value. For the same reason read
714-
* verification is ignored.
715-
*/
716-
wa_add(wal,
717-
GEN12_FF_MODE2,
718-
FF_MODE2_TDS_TIMER_MASK,
719-
FF_MODE2_TDS_TIMER_128,
720-
0, false);
721-
}
722-
723696
static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine,
724697
struct i915_wa_list *wal)
725698
{
726699
struct drm_i915_private *i915 = engine->i915;
727700

728-
gen12_ctx_gt_tuning_init(engine, wal);
729-
730701
/*
731702
* Wa_1409142259:tgl,dg1,adl-p
732703
* Wa_1409347922:tgl,dg1,adl-p
@@ -748,15 +719,27 @@ static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine,
748719
GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL);
749720

750721
/*
751-
* Wa_16011163337
722+
* Wa_16011163337 - GS_TIMER
723+
*
724+
* TDS_TIMER: Although some platforms refer to it as Wa_1604555607, we
725+
* need to program it even on those that don't explicitly list that
726+
* workaround.
727+
*
728+
* Note that the programming of GEN12_FF_MODE2 is further modified
729+
* according to the FF_MODE2 guidance given by Wa_1608008084.
730+
* Wa_1608008084 tells us the FF_MODE2 register will return the wrong
731+
* value when read from the CPU.
752732
*
753-
* Like in gen12_ctx_gt_tuning_init(), read verification is ignored due
754-
* to Wa_1608008084.
733+
* The default value for this register is zero for all fields.
734+
* So instead of doing a RMW we should just write the desired values
735+
* for TDS and GS timers. Note that since the readback can't be trusted,
736+
* the clear mask is just set to ~0 to make sure other bits are not
737+
* inadvertently set. For the same reason read verification is ignored.
755738
*/
756739
wa_add(wal,
757740
GEN12_FF_MODE2,
758-
FF_MODE2_GS_TIMER_MASK,
759-
FF_MODE2_GS_TIMER_224,
741+
~0,
742+
FF_MODE2_TDS_TIMER_128 | FF_MODE2_GS_TIMER_224,
760743
0, false);
761744

762745
if (!IS_DG1(i915)) {

0 commit comments

Comments
 (0)