Skip to contentSkip to conversation

drm/xe: Add fake workaround to maintain backward compatible in MI_BATCH_BUFFER_START

PATCH New José Roberto de Souza 1 participant 1 message Jan 30, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/xe: Add fake workaround to maintain backward compatible in MI_BATCH_BUFFER_START

i915 has the same fake workaround to return MI_BATCH_BUFFER_START nested batch buffer behavior in DG2 and newer platforms to the same behavior as older platforms.

So here cleaning up TGL_NESTED_BB_EN in MI_MODE to disable third level chained batch buffer level.

v2:
- replace IP_VERSION_FOREVER by XE_RTP_END_VERSION_UNDEFINED
- move fake workaround to lrc_additional_programming table

v3:
- drop xe_wa_process_lrc_additional_programming()

Bspec: 45974, 45718

---
 drivers/gpu/drm/xe/xe_wa.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/xe/xe_wa.c +16 -0
index 3325de3edf691..03fb7208c164d 100644
@@ -288,6 +288,21 @@ static const struct xe_rtp_entry lrc_was[] = {
 	{}
 };
 
+static const struct xe_rtp_entry lrc_additional_programming[] = {
+	{ XE_RTP_NAME("FakeWaDisableNestedBBMode"),
+	  /*
+	   * This is a "fake" workaround defined by software to ensure we
+	   * maintain reliable, backward-compatible behavior for userspace with
+	   * regards to how nested MI_BATCH_BUFFER_START commands are handled.
+	   */
+	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1255, XE_RTP_END_VERSION_UNDEFINED)),
+	  XE_RTP_CLR(RING_MI_MODE(0),
+		     TGL_NESTED_BB_EN,
+		     XE_RTP_FLAG(MASKED_REG, ENGINE_BASE))
+	},
+	{}
+};
+
 static const struct xe_rtp_entry register_whitelist[] = {
 	{ XE_RTP_NAME("WaAllowPMDepthAndInvocationCountAccessFromUMD, 1408556865"),
 	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1210), ENGINE_CLASS(RENDER)),
@@ -360,6 +375,7 @@ void xe_wa_process_engine(struct xe_hw_engine *hwe)
 void xe_wa_process_lrc(struct xe_hw_engine *hwe)
 {
 	xe_rtp_process(lrc_was, &hwe->reg_lrc, hwe->gt, hwe);
+	xe_rtp_process(lrc_additional_programming, &hwe->reg_lrc, hwe->gt, hwe);
 }
 
 /**
Signature · 1 line
2.39.1