mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND] drm/amd/display: fix audio playing speed up on POLARIS12
@ 2025-12-05  7:43 yaolu
  2026-09-18 10:49 ` Igor Paunovic
  0 siblings, 1 reply; 2+ messages in thread
From: yaolu @ 2025-12-05  7:43 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig
  Cc: amd-gfx, dri-devel, linux-kernel, Lu Yao

From: Lu Yao <yaolu@kylinos.cn>

Playing audio/video will speed up when color space is NV12.
For POLARIS12, audio request clock has to be same as
'stream->timing.pix_clk_100hz', so double clock now for it
has been halved in the 'get_pixel_clock_parameters' function.

Signed-off-by: Lu Yao <yaolu@kylinos.cn>
---
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c  | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
---
Test environment:
  Card: RX550  device id: 0X699F
  Display mode: 4K@60 clock:59400

A similar issue was reported in the community a long time ago,
but it was not dealt with, link as follow:
https://gitlab.freedesktop.org/drm/amd/-/issues/556

Discovered through logs audio_output requested&calculated is half
of stream->timing.pix_clk_100hz before, so I double it.
I'm not sure if this patch modification has correctly solved the
root cause and whether all DCE_VERSION_11_2 have problem or POLARIS12
only, but it's working properly on my machine now.
---

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index 24184b4eb352..a93313248db3 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -1440,13 +1440,21 @@ void build_audio_output(
 
 /*for HDMI, audio ACR is with deep color ratio factor*/
 	if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) &&
-		audio_output->crtc_info.requested_pixel_clock_100Hz ==
-				(stream->timing.pix_clk_100hz)) {
-		if (pipe_ctx->stream_res.pix_clk_params.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
+		pipe_ctx->stream_res.pix_clk_params.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
+		struct hw_asic_id asic_id = stream->link->ctx->asic_id;
+
+		if (asic_id.chip_family == FAMILY_VI &&
+		    ASIC_REV_IS_POLARIS12_V(asic_id.hw_internal_rev)) {
+			audio_output->crtc_info.requested_pixel_clock_100Hz =
+				audio_output->crtc_info.requested_pixel_clock_100Hz*2;
+			audio_output->crtc_info.calculated_pixel_clock_100Hz =
+				pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz*2;
+		} else if (audio_output->crtc_info.requested_pixel_clock_100Hz ==
+			   (stream->timing.pix_clk_100hz)) {
 			audio_output->crtc_info.requested_pixel_clock_100Hz =
-					audio_output->crtc_info.requested_pixel_clock_100Hz/2;
+				audio_output->crtc_info.requested_pixel_clock_100Hz/2;
 			audio_output->crtc_info.calculated_pixel_clock_100Hz =
-					pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz/2;
+				pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz/2;
 
 		}
 	}
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-18 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-05  7:43 [RESEND] drm/amd/display: fix audio playing speed up on POLARIS12 yaolu
2026-09-18 10:49 ` Igor Paunovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®