linux-loongson/drivers/gpu/drm/amd/display/dc
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
..
basics drm/amd/display: fix typo in comments 2025-05-22 12:01:53 -04:00
bios drm/amd/display: Fix fractional fb divider in set_pixel_clock_v3 2025-08-18 18:00:34 -04:00
clk_mgr drm/amd/display: Fix DP audio DTO1 clock source on DCE 6. 2025-08-18 18:00:56 -04:00
core drm/amd/display: Don't print errors for nonexistent connectors 2025-08-18 18:00:20 -04:00
dccg drm/amd/display: Add num_slices_h to set_dto_dscclk signature 2025-06-24 09:58:17 -04:00
dce drm/amd/display: Don't warn when missing DCE encoder caps 2025-08-18 18:00:11 -04:00
dce60 drm/amd/display/dc: reclassify DCE6 resources and hw sequencer 2025-04-08 16:48:14 -04:00
dce80 drm/amd/display: Rename program_timing function for better debugging 2025-04-30 18:18:59 -04:00
dce110 drm/amd/display: Remove unused get_max_support_fbc_buffersize 2025-02-12 21:03:03 -05:00
dce112
dce120 drm/amd/display: Add support to configure CRC window on specific CRC instance 2025-01-10 12:03:45 -05:00
dcn10 drm/amd/display: log destination of vertical interrupt 2025-02-12 21:02:57 -05:00
dcn20 drm/amd/display: Refactoring MPC 2024-07-23 17:07:11 -04:00
dcn21
dcn30 drm/amd/display: Remove unused cm3_helper_translate_curve_to_degamma_hw_format 2024-11-04 11:26:20 -05:00
dcn31 drm/amd/display: Refactor dcn31_panel_construct to avoid assert 2024-12-10 10:31:24 -05:00
dcn201
dcn301 drm/amd/display: Refactor for dio 2024-07-27 17:31:26 -04:00
dio drm/amd/display: misc for dio encoder refactor 2025-03-05 10:39:20 -05:00
dml drm/amd/display: Remove dml/dcn401 files and references 2025-06-18 12:19:16 -04:00
dml2 drm/amd/display: Refactor DML21 Initialization and Configuration 2025-06-30 11:58:50 -04:00
dpp drm/amd/display: Removing Unused DPP Functions 2025-06-18 12:19:20 -04:00
dsc drm/amd/display: Fix divide by zero when calculating min ODM factor 2025-07-28 16:24:05 -04:00
dwb drm/amd/display: Remove unused dwb3_set_host_read_rate_control 2024-12-10 10:38:19 -05:00
gpio drm/amd/display: Adjust set_value function with prefix to help in ftrace 2025-05-22 12:01:47 -04:00
hdcp
hpo drm/amd/display: Refactor DCN4x and related code 2025-02-25 11:44:02 -05:00
hubbub drm/amd/display: Add skip rIOMMU dc config option 2025-05-05 12:58:17 -04:00
hubp drm/amd/display: MPC basic allocation logic and TMZ 2025-07-15 14:07:51 -04:00
hwss drm/amd/display: Revert "Add DPP & HUBP reset if power gate enabled on DCN314" 2025-07-15 14:07:53 -04:00
inc drm/amd/display: Initial support for SmartMux 2025-07-15 14:07:53 -04:00
irq drm/amd/display/dc/irq: Remove duplications of hpd_ack function from IRQ 2025-05-13 09:37:09 -04:00
link drm/amd/display: Revert Add HPO encoder support to Replay 2025-08-18 17:41:43 -04:00
mmhubbub drm/amd/display: Allow reuse of of DCN4x code 2025-02-12 21:03:01 -05:00
mpc drm/amd/display: Initialize mode_select to 0 2025-06-24 09:55:43 -04:00
opp drm/amd/display: Refactoring OPP 2024-07-23 17:07:10 -04:00
optc drm/amd/display: Constify struct timing_generator_funcs 2025-05-29 10:57:31 -04:00
pg
resource drm fixes for 6.17-rc1 2025-08-08 06:48:14 +03:00
sspl drm/amd/display: Add custom segmentation support 2025-06-18 12:19:16 -04:00
virtual
dc_bios_types.h
dc_ddc_types.h
dc_dmub_srv.c drm/amd/display: New Behavior for debug option disable_ips_in_vpb 2025-07-15 14:07:52 -04:00
dc_dmub_srv.h drm/amd/display: Notify DMUB on HW Release 2025-07-15 14:07:52 -04:00
dc_dp_types.h drm/amd/display: Add new DP tunnel bandwidth validation 2025-06-24 09:55:35 -04:00
dc_dsc.h drm/amd/display: Add Interface to Dump DSC Caps from dm 2025-01-06 14:44:27 -05:00
dc_edid_parser.c
dc_edid_parser.h
dc_fused_io.c drm/amd/display: Prepare for Fused I2C-over-AUX 2025-05-05 12:55:30 -04:00
dc_fused_io.h drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
dc_hdmi_types.h
dc_helper.c drm/amdgpu: add missing DCE6 to dce_version_to_string() 2025-04-21 10:54:41 -04:00
dc_hw_types.h drm/amd/display: Added case for when RR equals panel's max RR using freesync 2025-06-30 14:00:51 -04:00
dc_plane_priv.h
dc_plane.h drm/amd/display: Extend dc_plane_get_status with flags 2025-05-16 13:38:25 -04:00
dc_spl_translate.c drm/amd/display: Add support for 2nd sharpening range 2025-06-03 15:35:56 -04:00
dc_spl_translate.h drm/amd/display: add back quality EASF and ISHARP and dc dependency changes 2024-08-27 17:53:58 -04:00
dc_stat.h
dc_state_priv.h drm/amd/display: Refactor SubVP cursor limiting logic 2025-05-05 12:58:49 -04:00
dc_state.h drm/amd/display: Eliminate recursive header inclusion 2024-10-01 17:37:50 -04:00
dc_stream_priv.h
dc_stream.h drm/amd/display: MPC basic allocation logic and TMZ 2025-07-15 14:07:51 -04:00
dc_trace.h
dc_types.h drm/amd/display: Monitor patch to ignore EDID audio SAB check 2025-07-15 14:07:51 -04:00
dc.h drm/amd/display: Initial support for SmartMux 2025-07-15 14:07:53 -04:00
dm_cp_psp.h
dm_event_log.h
dm_helpers.h drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
dm_pp_smu.h
dm_services_types.h drm/amd/display: ACPI Re-timer Programming 2025-02-25 11:44:36 -05:00
dm_services.h drm/amd/display: ACPI Re-timer Programming 2025-02-25 11:44:36 -05:00
irq_types.h drm/amd/display: Implement HDMI Read Request 2025-04-21 11:27:25 -04:00
Makefile drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
os_types.h drm/amd/display: Move vmalloc include to header file 2025-06-03 15:35:59 -04:00