Skip to content

Commit 75dc8da

Browse files
Timur KristófSasha Levin
authored andcommitted
drm/amd/display: Fix DP audio DTO1 clock source on DCE 6.
commit 297a483 upstream. On DCE 6, DP audio was not working. However, it worked when an HDMI monitor was also plugged in. Looking at dce_aud_wall_dto_setup it seems that the main difference is that we use DTO1 when only DP is plugged in. When programming DTO1, it uses audio_dto_source_clock_in_khz which is set from get_dp_ref_freq_khz The dce60_get_dp_ref_freq_khz implementation looks incorrect, because DENTIST_DISPCLK_CNTL seems to be always zero on DCE 6, so it isn't usable. I compared dce60_get_dp_ref_freq_khz to the legacy display code, specifically dce_v6_0_audio_set_dto, and it turns out that in case of DCE 6, it needs to use the display clock. With that, DP audio started working on Pitcairn, Oland and Cape Verde. However, it still didn't work on Tahiti. Despite having the same DCE version, Tahiti seems to have a different audio device. After some trial and error I realized that it works with the default display clock as reported by the VBIOS, not the current display clock. The patch was tested on all four SI GPUs: * Pitcairn (DCE 6.0) * Oland (DCE 6.4) * Cape Verde (DCE 6.0) * Tahiti (DCE 6.0 but different) The testing was done on Samsung Odyssey G7 LS28BG700EPXEN on each of the above GPUs, at the following settings: * 4K 60 Hz * 1080p 60 Hz * 1080p 144 Hz Acked-by: Alex Deucher <[email protected]> Reviewed-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Timur Kristóf <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 645cc7863da5de700547d236697dffd6760cf051) Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0b8bab2 commit 75dc8da

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

drivers/gpu/drm/amd/display/dc/clk_mgr/dce60/dce60_clk_mgr.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,13 @@ static const struct state_dependent_clocks dce60_max_clks_by_state[] = {
8383
static int dce60_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base)
8484
{
8585
struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
86-
int dprefclk_wdivider;
87-
int dp_ref_clk_khz;
88-
int target_div;
86+
struct dc_context *ctx = clk_mgr_base->ctx;
87+
int dp_ref_clk_khz = 0;
8988

90-
/* DCE6 has no DPREFCLK_CNTL to read DP Reference Clock source */
91-
92-
/* Read the mmDENTIST_DISPCLK_CNTL to get the currently
93-
* programmed DID DENTIST_DPREFCLK_WDIVIDER*/
94-
REG_GET(DENTIST_DISPCLK_CNTL, DENTIST_DPREFCLK_WDIVIDER, &dprefclk_wdivider);
95-
96-
/* Convert DENTIST_DPREFCLK_WDIVIDERto actual divider*/
97-
target_div = dentist_get_divider_from_did(dprefclk_wdivider);
98-
99-
/* Calculate the current DFS clock, in kHz.*/
100-
dp_ref_clk_khz = (DENTIST_DIVIDER_RANGE_SCALE_FACTOR
101-
* clk_mgr->base.dentist_vco_freq_khz) / target_div;
89+
if (ASIC_REV_IS_TAHITI_P(ctx->asic_id.hw_internal_rev))
90+
dp_ref_clk_khz = ctx->dc_bios->fw_info.default_display_engine_pll_frequency;
91+
else
92+
dp_ref_clk_khz = clk_mgr_base->clks.dispclk_khz;
10293

10394
return dce_adjust_dp_ref_freq_for_ss(clk_mgr, dp_ref_clk_khz);
10495
}

0 commit comments

Comments
 (0)