Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dg2: Add Wa_22011450934

An indirect ctx wabb is implemented as per Wa_22011450934 to avoid rcs
restore hang during context restore of a preempted context in GPGPU mode

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
cc: Chris Wilson <chris.p.wilson@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220128185209.18077-2-ramalingam.c@intel.com

+32
+28
drivers/gpu/drm/i915/gt/intel_lrc.c
··· 1164 1164 return cs; 1165 1165 } 1166 1166 1167 + /* 1168 + * On DG2 during context restore of a preempted context in GPGPU mode, 1169 + * RCS restore hang is detected. This is extremely timing dependent. 1170 + * To address this below sw wabb is implemented for DG2 A steppings. 1171 + */ 1172 + static u32 * 1173 + dg2_emit_rcs_hang_wabb(const struct intel_context *ce, u32 *cs) 1174 + { 1175 + *cs++ = MI_LOAD_REGISTER_IMM(1); 1176 + *cs++ = i915_mmio_reg_offset(GEN12_STATE_ACK_DEBUG); 1177 + *cs++ = 0x21; 1178 + 1179 + *cs++ = MI_LOAD_REGISTER_REG; 1180 + *cs++ = i915_mmio_reg_offset(RING_NOPID(ce->engine->mmio_base)); 1181 + *cs++ = i915_mmio_reg_offset(GEN12_CULLBIT1); 1182 + 1183 + *cs++ = MI_LOAD_REGISTER_REG; 1184 + *cs++ = i915_mmio_reg_offset(RING_NOPID(ce->engine->mmio_base)); 1185 + *cs++ = i915_mmio_reg_offset(GEN12_CULLBIT2); 1186 + 1187 + return cs; 1188 + } 1189 + 1167 1190 static u32 * 1168 1191 gen12_emit_indirect_ctx_rcs(const struct intel_context *ce, u32 *cs) 1169 1192 { 1170 1193 cs = gen12_emit_timestamp_wa(ce, cs); 1171 1194 cs = gen12_emit_cmd_buf_wa(ce, cs); 1172 1195 cs = gen12_emit_restore_scratch(ce, cs); 1196 + 1197 + /* Wa_22011450934:dg2 */ 1198 + if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_A0, STEP_B0) || 1199 + IS_DG2_GRAPHICS_STEP(ce->engine->i915, G11, STEP_A0, STEP_B0)) 1200 + cs = dg2_emit_rcs_hang_wabb(ce, cs); 1173 1201 1174 1202 /* Wa_16013000631:dg2 */ 1175 1203 if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_B0, STEP_C0) ||
+4
drivers/gpu/drm/i915/i915_reg.h
··· 13024 13024 #define SLICE_COMMON_ECO_CHICKEN1 _MMIO(0x731C) 13025 13025 #define MSC_MSAA_REODER_BUF_BYPASS_DISABLE REG_BIT(14) 13026 13026 13027 + #define GEN12_CULLBIT1 _MMIO(0x6100) 13028 + #define GEN12_CULLBIT2 _MMIO(0x7030) 13029 + #define GEN12_STATE_ACK_DEBUG _MMIO(0x20BC) 13030 + 13027 13031 #endif /* _I915_REG_H_ */