@@ -1600,7 +1600,13 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw(
16001600 hws -> funcs .disable_stream_gating (dc , pipe_ctx );
16011601 }
16021602
1603- if (pipe_ctx -> stream_res .audio != NULL ) {
1603+ /* For HDMI FRL, the FRL rate may change during link training (rate
1604+ * fallback). Defer audio setup until after set_dpms_on so that
1605+ * pipe_ctx->link_config.dp_link_settings.frl_rate reflects the
1606+ * actually-trained rate when hdmi_audio_setup is called.
1607+ */
1608+ if (pipe_ctx -> stream_res .audio != NULL &&
1609+ !dc_is_hdmi_frl_signal (pipe_ctx -> stream -> signal )) {
16041610 struct audio_output audio_output = {0 };
16051611
16061612 build_audio_output (context , pipe_ctx , & audio_output );
@@ -1703,6 +1709,26 @@ enum dc_status dce110_apply_single_controller_ctx_to_hw(
17031709 if (!stream -> dpms_off )
17041710 dc -> link_srv -> set_dpms_on (context , pipe_ctx );
17051711
1712+ /* HDMI FRL audio setup deferred from above: pipe_ctx->link_config now
1713+ * holds the actually-trained FRL rate after any rate fallback.
1714+ */
1715+ if (pipe_ctx -> stream_res .audio != NULL &&
1716+ dc_is_hdmi_frl_signal (pipe_ctx -> stream -> signal )) {
1717+ struct audio_output audio_output = {0 };
1718+
1719+ build_audio_output (context , pipe_ctx , & audio_output );
1720+
1721+ link_hwss -> setup_audio_output (pipe_ctx , & audio_output ,
1722+ pipe_ctx -> stream_res .audio -> inst );
1723+
1724+ pipe_ctx -> stream_res .audio -> funcs -> az_configure (
1725+ pipe_ctx -> stream_res .audio ,
1726+ pipe_ctx -> stream -> signal ,
1727+ & audio_output .crtc_info ,
1728+ & pipe_ctx -> stream -> audio_info ,
1729+ & audio_output .dp_link_info );
1730+ }
1731+
17061732 /* DCN3.1 FPGA Workaround
17071733 * Need to enable HPO DP Stream Encoder before setting OTG master enable.
17081734 * To do so, move calling function enable_stream_timing to only be done AFTER calling
0 commit comments