* [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
* Re: [RESEND] drm/amd/display: fix audio playing speed up on POLARIS12
2025-12-05 7:43 [RESEND] drm/amd/display: fix audio playing speed up on POLARIS12 yaolu
@ 2026-09-18 10:49 ` Igor Paunovic
0 siblings, 0 replies; 2+ messages in thread
From: Igor Paunovic @ 2026-09-18 10:49 UTC (permalink / raw)
To: Lu Yao
Cc: Igor Paunovic, harry.wentland, sunpeng.li, alexander.deucher,
christian.koenig, amd-gfx, dri-devel, linux-kernel
Hi Lu Yao,
I hit the same bug on a Polaris10 (RX 580) with a TV at 3840x2160@60
in YCbCr 4:2:0, and your patch was the only fix I could find, thank
you for posting it.
I have sent a patch that fixes the DTO0 module for HDMI 4:2:0 on
DCE 11.2, 11.22 and 12.x, which should cover POLARIS12 too, and
leaves ACR (N/CTS) as it is:
https://lore.kernel.org/r/20260918100443.23694-1-royalnet026@gmail.com
I could only test Polaris10. If you still have the RX550, a test of
that patch on a tree without yours would help a lot.
An LLM helped me draft this mail.
Thanks,
Igor
^ 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®