Skip to content

Commit f10cde8

Browse files
committed
Reprogram audio clock with correct FRL rate
1 parent 941ef8c commit f10cde8

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

drivers/gpu/drm/amd/display/dc/link/link_dpms.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,16 @@ static enum dc_status enable_link_hdmi(struct pipe_ctx *pipe_ctx)
19441944
DC_LOG_HW_LINK_TRAINING("HDMI FRL: training failed\n");
19451945
return DC_ERROR_UNEXPECTED;
19461946
}
1947+
1948+
/* Sync the trained rate back so the audio setup in
1949+
* dce110_apply_single_controller_ctx_to_hw uses the correct
1950+
* FRL rate after any rate fallback during training.
1951+
*/
1952+
pipe_ctx->link_config.dp_link_settings.frl_rate =
1953+
link->cur_link_settings.frl_rate;
1954+
pipe_ctx->link_config.dp_link_settings.lane_count =
1955+
link->cur_link_settings.lane_count;
1956+
19471957
return DC_OK;
19481958
}
19491959

0 commit comments

Comments
 (0)