1 From 69a46ce1f15b4391c128d581f6936750f9bfa052 Mon Sep 17 00:00:00 2001
2 From: Tom Chung <chiahsuan.chung@amd.com>
3 Date: Wed, 19 Mar 2025 16:31:31 +0800
4 Subject: drm/amd/display: Do not enable Replay and PSR while VRR is on in amdgpu_dm_commit_planes()
6 From: Tom Chung <chiahsuan.chung@amd.com>
8 commit 69a46ce1f15b4391c128d581f6936750f9bfa052 upstream.
11 Replay and PSR will cause some video corruption while VRR is enabled.
14 Do not enable the Replay and PSR while VRR is active in
15 amdgpu_dm_enable_self_refresh().
17 Fixes: 67edb81d6e9a ("drm/amd/display: Disable replay and psr while VRR is enabled")
18 Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
19 Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
20 Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
21 Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
22 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
23 Cc: stable@vger.kernel.org
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 6 ++++--
27 1 file changed, 4 insertions(+), 2 deletions(-)
29 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
30 +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
31 @@ -113,6 +113,7 @@ bool amdgpu_dm_crtc_vrr_active(const str
33 * Panel Replay and PSR SU
36 * - vblank counter is disabled
37 * - entry is allowed: usermode demonstrates an adequate number of fast
39 @@ -131,19 +132,20 @@ static void amdgpu_dm_crtc_set_panel_sr_
40 bool is_sr_active = (link->replay_settings.replay_allow_active ||
41 link->psr_settings.psr_allow_active);
42 bool is_crc_window_active = false;
43 + bool vrr_active = amdgpu_dm_crtc_vrr_active_irq(vblank_work->acrtc);
45 #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
46 is_crc_window_active =
47 amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base);
50 - if (link->replay_settings.replay_feature_enabled &&
51 + if (link->replay_settings.replay_feature_enabled && !vrr_active &&
52 allow_sr_entry && !is_sr_active && !is_crc_window_active) {
53 amdgpu_dm_replay_enable(vblank_work->stream, true);
54 } else if (vblank_enabled) {
55 if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 && is_sr_active)
56 amdgpu_dm_psr_disable(vblank_work->stream, false);
57 - } else if (link->psr_settings.psr_feature_enabled &&
58 + } else if (link->psr_settings.psr_feature_enabled && !vrr_active &&
59 allow_sr_entry && !is_sr_active && !is_crc_window_active) {
61 struct amdgpu_dm_connector *aconn =