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

drm/i915: Implement Audio WA_14020863754

WA_14020863754: Corner case with Min Hblank Fix can cause
audio hang

Issue: Previously a fix was made to avoid issues with extremely
small hblanks, called the "Min Hblank Fix". However, this can
potentially cause an audio hang.

Workaround :
During "Audio Programming Sequence" Audio Enabling -
When DP mode is enabled Set mmio offset 0x65F1C bit 18 = 1b,
before step #1 "Enable audio Presence Detect"

During "Audio Programming Sequence" Audio Disabling -
When DP mode is enabled Clear mmio offset 0x65F1C bit 18 = 0b,
after step #6 "Disable Audio PD (Presence Detect)"
If not clearing PD bit, must also not clear 0x65F1C bit 18 (leave = 1b)

v2: Update the platform checks (Jani Nikula)

v3: Limited the WA to LNL and BMG, added a helper (Matt Roper)

v4: Updated the bit naming, fixed redundant if statement

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240509053508.2807834-1-uma.shankar@intel.com

+18
+15
drivers/gpu/drm/i915/display/intel_audio.c
··· 183 183 { 192000, TMDS_445_5M, 20480, 371250 }, 184 184 }; 185 185 186 + /* 187 + * WA_14020863754: Implement Audio Workaround 188 + * Corner case with Min Hblank Fix can cause audio hang 189 + */ 190 + static bool needs_wa_14020863754(struct drm_i915_private *i915) 191 + { 192 + return (DISPLAY_VER(i915) == 20 || IS_BATTLEMAGE(i915)); 193 + } 194 + 186 195 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */ 187 196 static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state *crtc_state) 188 197 { ··· 424 415 intel_de_rmw(i915, HSW_AUD_PIN_ELD_CP_VLD, 425 416 AUDIO_OUTPUT_ENABLE(cpu_transcoder), 0); 426 417 418 + if (needs_wa_14020863754(i915)) 419 + intel_de_rmw(i915, AUD_CHICKENBIT_REG3, DACBE_DISABLE_MIN_HBLANK_FIX, 0); 420 + 427 421 mutex_unlock(&i915->display.audio.mutex); 428 422 } 429 423 ··· 551 539 /* Enable Audio WA for 4k DSC usecases */ 552 540 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP)) 553 541 enable_audio_dsc_wa(encoder, crtc_state); 542 + 543 + if (needs_wa_14020863754(i915)) 544 + intel_de_rmw(i915, AUD_CHICKENBIT_REG3, 0, DACBE_DISABLE_MIN_HBLANK_FIX); 554 545 555 546 /* Enable audio presence detect */ 556 547 intel_de_rmw(i915, HSW_AUD_PIN_ELD_CP_VLD,
+3
drivers/gpu/drm/i915/display/intel_audio_regs.h
··· 164 164 _VLV_AUD_PORT_EN_D_DBG) 165 165 #define VLV_AMP_MUTE (1 << 1) 166 166 167 + #define AUD_CHICKENBIT_REG3 _MMIO(0x65F1C) 168 + #define DACBE_DISABLE_MIN_HBLANK_FIX REG_BIT(18) 169 + 167 170 #endif /* __INTEL_AUDIO_REGS_H__ */