FAILED: patch "[PATCH] drm/amd/display: set allow_freesync before validating a new stream" failed to apply to 6.18-stable tree
Sasha Levin
maintainerThe patch below does not apply to the 6.18-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 <[email protected]>.
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.18.y
git checkout FETCH_HEAD
git cherry-pick -x ab18dd3061eb2d92e60c8bbf9a435c25962e449f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From ab18dd3061eb2d92e60c8bbf9a435c25962e449f Mon Sep 17 00:00:00 2001
From: Mikhail Gavrilov <[email protected]>
Date: Mon, 26 Oct 2026 12:33:45 +0500
Subject: [PATCH] drm/amd/display: set allow_freesync before validating a new
stream
After resume from S3, DC enables SubVP on a single FreeSync display at a high refresh rate, although dcn32_allow_subvp_high_refresh_rate() is meant to keep SubVP off that configuration ("For single display cases, freesync must be disabled"). On an RX 7900 XTX driving a FreeSync TV at 3840x2160@120, amdgpu_dm_capabilities reports sub-viewport disabled after boot and enabled after "rtcwake -m mem", and the memory clock starts switching. It stays that way until a later commit re-validates the state; a CRTC gamma change (toggling Night Light) turns SubVP off again.
The policy reads dc_stream_state::allow_freesync while the new state is validated, but amdgpu_dm sets that field only in amdgpu_dm_update_freesync_state_on_stream(), on the first flip after the commit. A stream created by a modeset is therefore validated as if FreeSync were off. On resume, dm_destroy_cached_state() drops the streams and forces a modeset, so the resumed state is validated without FreeSync.
Set allow_freesync in amdgpu_dm_get_freesync_config_for_crtc(), which atomic check calls for every active CRTC and which already writes ignore_msa_timing_param to the stream. It uses vrr_supported, the condition the flip-time value is derived from. With this change the same TV keeps SubVP disabled across "rtcwake -m mem".
On this machine SubVP is also what exposes the single-frame scanout corruption reported in the thread linked below, so the FreeSync setting stopped working as a workaround after every suspend.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +8 -0
@@ -131,6 +131,14 @@ void amdgpu_dm_get_freesync_config_for_crtc( vrefresh >= aconnector->min_vfreq && vrefresh <= aconnector->max_vfreq; +/* +* DC reads allow_freesync while validating the new state, for example +* to keep SubVP off a single FreeSync display, but it is otherwise set +* only on the first flip after the commit. Set it here, so that a +* stream created by this commit is not validated without it. +*/ + new_crtc_state->stream->allow_freesync = new_crtc_state->vrr_supported; +if (new_crtc_state->vrr_supported) { new_crtc_state->stream->ignore_msa_timing_param = true; fs_vid_mode = new_crtc_state->freesync_config.state ==VRR_STATE_ACTIVE_FIXED ;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 drm/amd/display: set allow_freesync before validating a new stream
From: Mikhail Gavrilov <[email protected]>
[ Upstream commit ab18dd3061eb2d92e60c8bbf9a435c25962e449f ]
After resume from S3, DC enables SubVP on a single FreeSync display at a high refresh rate, although dcn32_allow_subvp_high_refresh_rate() is meant to keep SubVP off that configuration ("For single display cases, freesync must be disabled"). On an RX 7900 XTX driving a FreeSync TV at 3840x2160@120, amdgpu_dm_capabilities reports sub-viewport disabled after boot and enabled after "rtcwake -m mem", and the memory clock starts switching. It stays that way until a later commit re-validates the state; a CRTC gamma change (toggling Night Light) turns SubVP off again.
The policy reads dc_stream_state::allow_freesync while the new state is validated, but amdgpu_dm sets that field only in amdgpu_dm_update_freesync_state_on_stream(), on the first flip after the commit. A stream created by a modeset is therefore validated as if FreeSync were off. On resume, dm_destroy_cached_state() drops the streams and forces a modeset, so the resumed state is validated without FreeSync.
Set allow_freesync in amdgpu_dm_get_freesync_config_for_crtc(), which atomic check calls for every active CRTC and which already writes ignore_msa_timing_param to the stream. It uses vrr_supported, the condition the flip-time value is derived from. With this change the same TV keeps SubVP disabled across "rtcwake -m mem".
On this machine SubVP is also what exposes the single-frame scanout corruption reported in the thread linked below, so the FreeSync setting stopped working as a workaround after every suspend.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -0
@@ -11350,6 +11350,14 @@ static void get_freesync_config_for_crtc( vrefresh >= aconnector->min_vfreq && vrefresh <= aconnector->max_vfreq; +/* +* DC reads allow_freesync while validating the new state, for example +* to keep SubVP off a single FreeSync display, but it is otherwise set +* only on the first flip after the commit. Set it here, so that a +* stream created by this commit is not validated without it. +*/ + new_crtc_state->stream->allow_freesync = new_crtc_state->vrr_supported; +if (new_crtc_state->vrr_supported) { new_crtc_state->stream->ignore_msa_timing_param = true; fs_vid_mode = new_crtc_state->freesync_config.state ==VRR_STATE_ACTIVE_FIXED ;
Signature · 1 line
2.53.0