Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [V3] drm/xe/nvl-p: Add Wa_14028564128
@ 2026-11-27 13:26 Tejas Upadhyay
  2026-11-27 14:51 ` Gustavo Sousa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tejas Upadhyay @ 2026-11-27 13:26 UTC (permalink / raw)
  To: intel-xe; +Cc: nitin.r.gote, gustavo.sousa, Tejas Upadhyay

Wa_14028564128 requires all 2-way coherent PAT entries to be programmed
as non-promotable 1-way coherent entries with L3:UC. It applies to all
steppings of graphics version 35.10.

On Xe3p LPG this affects PAT indices 2, 7, 23, 27 and 31.

V3:
- Apply Wa_14028564128 before Wa_14026539277 and document the ordering
- Drop xe_pat_wa_14028564128_safe_userptr_index()

V2:
- Add missing pat indexes to no_promote as asked by WA

Co-authored-by: Nitin Gote <nitin.r.gote@intel.com>
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 drivers/gpu/drm/xe/xe_pat.c        | 29 ++++++++++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_wa_oob.rules |  1 +
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
index 5938fef22579..29062672bf2d 100644
--- a/drivers/gpu/drm/xe/xe_pat.c
+++ b/drivers/gpu/drm/xe/xe_pat.c
@@ -337,6 +337,11 @@ bool xe_pat_wa_14026539277_reserved(struct xe_device *xe, u16 pat_index)
 		}
 	}
 
+	/* Wa_14028564128 also sets NO_PROMOTE, so MOCS can't promote these */
+	for_each_gt(gt, xe, id)
+		if (XE_GT_WA(gt, 14028564128))
+			return false;
+
 	/*
 	 * Disallow 2-way coherency for any L3 cache policy because
 	 * XE_L3_POLICY_UC could still be promoted to a cached policy
@@ -358,6 +363,19 @@ static u32 wa_14026539277_fixup_pat_value(struct xe_gt *gt, u32 value)
 	return value;
 }
 
+static u32 wa_14028564128_fixup_pat_value(struct xe_gt *gt, u32 value)
+{
+	if (XE_GT_WA(gt, 14028564128) &&
+	    REG_FIELD_GET(XE2_COH_MODE, value) == XE_COH_2WAY) {
+		value &= ~(XE2_L3_POLICY | XE2_COH_MODE);
+		value |= XE2_NO_PROMOTE |
+			 REG_FIELD_PREP(XE2_L3_POLICY, XE_L3_POLICY_UC) |
+			 REG_FIELD_PREP(XE2_COH_MODE, XE_COH_1WAY);
+	}
+
+	return value;
+}
+
 static const struct xe_pat_table_entry *gt_pta_entry(struct xe_gt *gt)
 {
 	struct xe_device *xe = gt_to_xe(gt);
@@ -418,7 +436,15 @@ static void program_pat_mcr(struct xe_gt *gt, const struct xe_pat_table_entry ta
 
 	for (int i = 0; i < n_entries; i++) {
 		struct xe_reg_mcr reg_mcr = XE_REG_MCR(_PAT_INDEX(i));
-		u32 pat = wa_14026539277_fixup_pat_value(gt, table[i].value);
+		u32 pat = table[i].value;
+
+		/*
+		 * Both WAs only act on 2-way coherent entries and turn them
+		 * 1-way, so whichever runs first disables the other. Wa_14028564128
+		 * is a superset of Wa_14026539277 and must be applied first.
+		 */
+		pat = wa_14028564128_fixup_pat_value(gt, pat);
+		pat = wa_14026539277_fixup_pat_value(gt, pat);
 
 		xe_gt_mcr_multicast_write(gt, reg_mcr, pat);
 	}
@@ -809,6 +835,7 @@ int xe_pat_dump_sw_config(struct xe_gt *gt, struct drm_printer *p)
 	for (u32 i = 0; i < xe->pat.n_entries; i++) {
 		u32 pat = xe->pat.table[i].value;
 
+		pat = wa_14028564128_fixup_pat_value(gt, pat);
 		pat = wa_14026539277_fixup_pat_value(gt, pat);
 
 		if (GRAPHICS_VER(xe) >= 20) {
diff --git a/drivers/gpu/drm/xe/xe_wa_oob.rules b/drivers/gpu/drm/xe/xe_wa_oob.rules
index 03b713f55dfb..908091dd72ab 100644
--- a/drivers/gpu/drm/xe/xe_wa_oob.rules
+++ b/drivers/gpu/drm/xe/xe_wa_oob.rules
@@ -74,6 +74,7 @@
 16029897822	MEDIA_VERSION(3500)
 		GRAPHICS_VERSION(3510)
 14026539277	GRAPHICS_VERSION(3510), GRAPHICS_STEP(A0, B0)
+14028564128	GRAPHICS_VERSION(3510)
 14027054324	GRAPHICS_VERSION(3511)
 14025941587	GRAPHICS_VERSION_RANGE(2001, 3511)
 		MEDIA_VERSION_RANGE(1301, 3503)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-27 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 13:26 [V3] drm/xe/nvl-p: Add Wa_14028564128 Tejas Upadhyay
2026-11-27 14:51 ` Gustavo Sousa
2026-11-27 16:17 ` ✗ CI.checkpatch: warning for drm/xe/nvl-p: Add Wa_14028564128 (rev3) Patchwork
2026-11-27 16:19 ` ✓ CI.KUnit: success " Patchwork
2026-11-27 16:57 ` ✓ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox