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

drm/i915/dp: Fix the enabling/disabling of audio SDP splitting

Adjust the enabling/disabling steps of the DP audio SDP splitting
according to a recent Bspec update. This moves the enabling to the audio
codec enable sequence after the transcoder is enabled and disables SDP
splitting explicitly during the audio disable sequence.

Bspec requires waiting for a vblank event after the transcoder is
enabled and before SDP splitting is enabled. There is no need for an
explicit wait for this, since after the transcoder is enabled this
vblank event is guaranteed to have happened via a flip done wait (see
intel_atomic_commit_tail() -> drm_atomic_helper_wait_for_flip_done()).

The bspec update is for LNL+ only, but the HW team clarified that this
has been always the intended sequence on all platforms and bspec will be
updated everywhere accordingly.

The way SDP splitting was originally enabled matched the version of
bspec at that time. Adding here the Fixes: line still, since this
change fixes a FIFO underrun on PTL during output enabling when DSC is
enabled.

Bspec: 49283, 68943
Fixes: 8853750dbad8 ("drm/i915: Enable SDP split for DP2.0")
Cc: Vinod Govindapillai <vinod.govindapillai@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250520142219.1688401-1-imre.deak@intel.com
(cherry picked from commit 56764c845aa5be14cd53702fc9f2da23e25857de)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

authored by

Imre Deak and committed by
Joonas Lahtinen
7d476f18 f4c7baa0

+17 -16
+17 -10
drivers/gpu/drm/i915/display/intel_audio.c
··· 397 397 hsw_hdmi_audio_config_update(encoder, crtc_state); 398 398 } 399 399 400 + static void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state, 401 + bool enable) 402 + { 403 + struct intel_display *display = to_intel_display(crtc_state); 404 + enum transcoder trans = crtc_state->cpu_transcoder; 405 + 406 + if (!HAS_DP20(display)) 407 + return; 408 + 409 + intel_de_rmw(display, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT, 410 + enable && crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0); 411 + } 412 + 400 413 static void hsw_audio_codec_disable(struct intel_encoder *encoder, 401 414 const struct intel_crtc_state *old_crtc_state, 402 415 const struct drm_connector_state *old_conn_state) ··· 442 429 443 430 if (needs_wa_14020863754(display)) 444 431 intel_de_rmw(display, AUD_CHICKENBIT_REG3, DACBE_DISABLE_MIN_HBLANK_FIX, 0); 432 + 433 + intel_audio_sdp_split_update(old_crtc_state, false); 445 434 446 435 mutex_unlock(&display->audio.mutex); 447 436 } ··· 570 555 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP)) 571 556 enable_audio_dsc_wa(encoder, crtc_state); 572 557 558 + intel_audio_sdp_split_update(crtc_state, true); 559 + 573 560 if (needs_wa_14020863754(display)) 574 561 intel_de_rmw(display, AUD_CHICKENBIT_REG3, 0, DACBE_DISABLE_MIN_HBLANK_FIX); 575 562 ··· 696 679 audio_config_hdmi_pixel_clock(crtc_state))); 697 680 698 681 mutex_unlock(&display->audio.mutex); 699 - } 700 - 701 - void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state) 702 - { 703 - struct intel_display *display = to_intel_display(crtc_state); 704 - enum transcoder trans = crtc_state->cpu_transcoder; 705 - 706 - if (HAS_DP20(display)) 707 - intel_de_rmw(display, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT, 708 - crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0); 709 682 } 710 683 711 684 bool intel_audio_compute_config(struct intel_encoder *encoder,
-1
drivers/gpu/drm/i915/display/intel_audio.h
··· 31 31 void intel_audio_init(struct intel_display *display); 32 32 void intel_audio_register(struct intel_display *display); 33 33 void intel_audio_deinit(struct intel_display *display); 34 - void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state); 35 34 36 35 #endif /* __INTEL_AUDIO_H__ */
-3
drivers/gpu/drm/i915/display/intel_ddi.c
··· 3507 3507 3508 3508 intel_vrr_transcoder_enable(crtc_state); 3509 3509 3510 - /* Enable/Disable DP2.0 SDP split config before transcoder */ 3511 - intel_audio_sdp_split_update(crtc_state); 3512 - 3513 3510 /* 128b/132b SST */ 3514 3511 if (!is_hdmi && intel_dp_is_uhbr(crtc_state)) { 3515 3512 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
-2
drivers/gpu/drm/i915/display/intel_dp_mst.c
··· 1328 1328 FECSTALL_DIS_DPTSTREAM_DPTTG, 1329 1329 pipe_config->fec_enable ? FECSTALL_DIS_DPTSTREAM_DPTTG : 0); 1330 1330 1331 - intel_audio_sdp_split_update(pipe_config); 1332 - 1333 1331 intel_enable_transcoder(pipe_config); 1334 1332 1335 1333 for_each_pipe_crtc_modeset_enable(display, pipe_crtc, pipe_config, i) {