lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_2F3D865C2D4C1960CBBE360187953F0B6907@qq.com>
Date: Fri, 24 Oct 2025 15:29:56 +0800
From: 724364708@...com
To: harry.wentland@....com,
	sunpeng.li@....com,
	siqueira@...lia.com,
	alexander.deucher@....com,
	christian.koenig@....com
Cc: amd-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org,
	Lu Yao <yaolu@...inos.cn>
Subject: [PATCH] drm/amd/display: fix audio playing speed up on POLARIS12

From: Lu Yao <yaolu@...inos.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@...inos.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ