linux-loongson/drivers/gpu/drm/amd/display
Timur Kristóf 297a4833a6 drm/amd/display: Fix DP audio DTO1 clock source on DCE 6.
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 <alexander.deucher@amd.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 645cc7863da5de700547d236697dffd6760cf051)
Cc: stable@vger.kernel.org
2025-08-18 18:00:56 -04:00
..
amdgpu_dm drm/amd/display: Fix Xorg desktop unresponsive on Replay panel 2025-08-18 17:56:53 -04:00
dc drm/amd/display: Fix DP audio DTO1 clock source on DCE 6. 2025-08-18 18:00:56 -04:00
dmub drm/amd/display: Revert Add HPO encoder support to Replay 2025-08-18 17:41:43 -04:00
include drm/amdgpu: fixing typo in macro name 2025-05-22 12:01:57 -04:00
modules drm/amd/display: Add null pointer check in mod_hdcp_hdcp1_create_session() 2025-08-18 17:57:12 -04:00
Kconfig drm/amd/display: add CEC notifier to amdgpu driver 2025-01-10 11:58:57 -05:00
Makefile drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00