From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220816; b=YyB1EFCWn6uXRWsCbgVVuxx3g036PMgrWX9nbpNhUNTYSmvvv9vZ+TLAudJEzqJXy279 CAf1I0XhEkRYWWDI1lJsPJ5TEgfOZvh44XvgP9q/hcEqO1R5x8cB677Xp5XUbUV3kgOKF JRZpr+D9nlEBpQbgfNvsDR6y3z9d170LmcoK6VDUUc3E/8IS3TmWWBPOonGL8NtMQWg6z HIkYA9HetgKp9ufYWGJ1NWxibOerWSK6E96HU0dovqtHS/PGpyPZWzRdljr+YR1Xfqfyv hc1AxQjIDuOWAwOwcnufdCljMnBHupE3IB9A6Be9qO9XZJ8kzto1loHPBBLNEh1CeUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220816; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=QBFK4/0Zvpzw/4Rj0uf5qFu5B3nkT4AqLnEJ9sBZUfc=; b=GyLnW4nmfDCq95UUpyFmMAXucvhfAr6qZVMB6aV4G9wsqWRVIh7Juduxp5eSg5x9ffEK P3JtxD1pLFrR6PrMm70Vi8pbQVc8NhBaHY4q5RScuUX96qczl0Cys6BOp7OfTMUNxkt5R vk4F0Of40c6bcuaWGLvRFR1lSfMMcaVGgwuElO5/0GTGtCnW/0+ry7/T9LD3IuovzAECS VomOtQyJVybUDnXkoEAzt0JE6nOKlk1Coz2Y2q6VKya6iXy3ENGHuS+UziYFUSYvj7ee1 SodOaHNX7MyO/FDzPIQ67nJrgeUxgsgP6zAl179b35B4xX8sW/6KbyTupVLeCS5m/5A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=myax3lbM; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51143606A31A for ; Wed, 2 Dec 2026 14:13:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=myax3lbM Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC6531F0089A; Wed, 2 Dec 2026 14:13:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796220815; bh=QBFK4/0Zvpzw/4Rj0uf5qFu5B3nkT4AqLnEJ9sBZUfc=; h=Subject:To:Cc:From:Date; b=myax3lbMhIJuDCmVjhCqhkzfmQG6cMuiA918Z9LAfVwffvfEfK08StR5i4RuJdtDZ qLQXPfQ5Y35+/SfCOayOjf3KV2wE4dVfwiBmQSSjJ1/EWlEEghimFC8g0pmmXCEYJJ TWcKDe7JfLcuUrIpxvdfoE3NEH/W0XjsBgCSyCnA= Subject: FAILED: patch "[PATCH] drm/amd/display: Use FreeSync v3 infopacket for sinks above" failed to apply to 6.6-stable tree To: ext-github@cwooper.dev,Wayne.Lin@amd.com,alexander.deucher@amd.com,harry.wentland@amd.com Cc: From: Date: Wed, 02 Dec 2026 13:39:09 +0100 Message-ID: <2026120209-trace-august-7f8b@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 6a9d5e2f06cd6f5c6aa0acb223a1c0a9dbadfce6 # git commit -s git send-email --to '' --in-reply-to '2026120209-trace-august-7f8b@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 6a9d5e2f06cd6f5c6aa0acb223a1c0a9dbadfce6 Mon Sep 17 00:00:00 2001 From: Cooper Morgan Date: Fri, 30 Oct 2026 21:18:26 -0700 Subject: [PATCH] drm/amd/display: Use FreeSync v3 infopacket for sinks above 255 Hz Native DP, eDP, and HDMI sinks get the v1 FreeSync infopacket unless they are a whitelisted PCON or support Replay. v1 holds each refresh rate in one byte, so a sink whose range goes above 255 Hz cannot be told its real maximum. The v3 packet carries the high bits in PB11/PB12. The AMD VSDB version is already stored for every DP, eDP, and HDMI sink. Send v3 when the sink advertises AMD VSDB v3 and its maximum refresh rate is above 255 Hz. The choice follows the sink's maximum rather than the current mode, so such a sink gets v3 at every mode and the packet version stays fixed per sink. Sinks whose maximum is 255 Hz or less are unchanged. Tested with this series backported to v7.2.13 on an MSI MAG 271QPX32 (AMD VSDB v3, 48-320 Hz) over DP 1.4 on an RX 9070 XT: 320 Hz shows a correct picture, and with VRR active the refresh rate tracks frame caps of 300, 270, and 100 Hz. At 240 Hz, where the sink now gets v3 instead of v1, the picture is correct and VRR tracks a 100 Hz cap. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/5988 Reviewed-by: Harry Wentland Signed-off-by: Cooper Morgan Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit e1c2682397f2f8f40eada17c817b5d3b300124b6) Cc: stable@vger.kernel.org diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c index 2255ee5f8341..f2539bcf824f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c @@ -251,6 +251,13 @@ void amdgpu_dm_update_freesync_state_on_stream( mod_build_adaptive_sync_infopacket(new_stream, aconn->as_type, NULL, &new_stream->adaptive_sync_infopacket); + } else if (aconn && aconn->vsdb_info.amd_vsdb_version == 3 && + aconn->max_vfreq > 255) { + /* + * v1 saturates at 255 Hz. Keyed on the sink's max, not the mode's + * rate, so the packet version stays fixed per sink. + */ + packet_type = PACKET_TYPE_FS_V3; } app_tf = dm_dp_in_hdr_mode(new_stream) ? diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c index bbd2b74f8eaa..8f219f08cd55 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c @@ -678,6 +678,61 @@ static void dm_test_update_freesync_state_dp_v2_saturates(struct kunit *test) KUNIT_EXPECT_EQ(test, p.sb[8], 255); } +/** + * dm_test_update_freesync_state_dp_v3_above_255 - Test v3 for a VSDB v3 sink above 255Hz + * @test: The KUnit test context + */ +static void dm_test_update_freesync_state_dp_v3_above_255(struct kunit *test) +{ + struct dc_info_packet p = + dm_test_freesync_packet(test, SIGNAL_TYPE_DISPLAY_PORT, 3, 320, 320); + + KUNIT_EXPECT_EQ(test, p.hb3, 3 << 2); + KUNIT_EXPECT_EQ(test, p.sb[8], 320 & 0xff); + KUNIT_EXPECT_EQ(test, p.sb[12], 320 >> 8); +} + +/** + * dm_test_update_freesync_state_dp_v3_mode_240 - Test v3 follows the sink max, not the mode + * @test: The KUnit test context + */ +static void dm_test_update_freesync_state_dp_v3_mode_240(struct kunit *test) +{ + struct dc_info_packet p = + dm_test_freesync_packet(test, SIGNAL_TYPE_DISPLAY_PORT, 3, 320, 240); + + KUNIT_EXPECT_EQ(test, p.hb3, 3 << 2); + KUNIT_EXPECT_EQ(test, p.sb[8], 240); + KUNIT_EXPECT_EQ(test, p.sb[12], 0); +} + +/** + * dm_test_update_freesync_state_dp_v3_at_255 - Test a VSDB v3 sink at 255Hz keeps v1 + * @test: The KUnit test context + */ +static void dm_test_update_freesync_state_dp_v3_at_255(struct kunit *test) +{ + struct dc_info_packet p = + dm_test_freesync_packet(test, SIGNAL_TYPE_DISPLAY_PORT, 3, 255, 255); + + KUNIT_EXPECT_EQ(test, p.hb3, 0x04); + KUNIT_EXPECT_EQ(test, p.sb[8], 255); +} + +/** + * dm_test_update_freesync_state_hdmi_v3_above_255 - Test v3 for a VSDB v3 HDMI sink + * @test: The KUnit test context + */ +static void dm_test_update_freesync_state_hdmi_v3_above_255(struct kunit *test) +{ + struct dc_info_packet p = + dm_test_freesync_packet(test, SIGNAL_TYPE_HDMI_TYPE_A, 3, 320, 320); + + KUNIT_EXPECT_EQ(test, p.hb1, 3); + KUNIT_EXPECT_EQ(test, p.sb[8], 320 & 0xff); + KUNIT_EXPECT_EQ(test, p.sb[12], 320 >> 8); +} + /* Tests for amdgpu_dm_update_stream_irq_parameters() */ /** @@ -1009,6 +1064,10 @@ static struct kunit_case amdgpu_dm_freesync_tests[] = { KUNIT_CASE(dm_test_update_freesync_state_pcon_v3), KUNIT_CASE(dm_test_update_freesync_state_pcon_default), KUNIT_CASE(dm_test_update_freesync_state_dp_v2_saturates), + KUNIT_CASE(dm_test_update_freesync_state_dp_v3_above_255), + KUNIT_CASE(dm_test_update_freesync_state_dp_v3_mode_240), + KUNIT_CASE(dm_test_update_freesync_state_dp_v3_at_255), + KUNIT_CASE(dm_test_update_freesync_state_hdmi_v3_above_255), /* amdgpu_dm_update_stream_irq_parameters */ KUNIT_CASE(dm_test_update_stream_irq_parameters_no_stream), KUNIT_CASE(dm_test_update_stream_irq_parameters_invalid_timing),