From 328600cd0001dbbfc5ad93e7a30194139b2d363c Mon Sep 17 00:00:00 2001 From: Tom Chung Date: Thu, 5 Dec 2024 23:08:28 +0800 Subject: [PATCH] drm/amd/display: Fix PSR-SU not support but still call the amdgpu_dm_psr_enable BugLink: https://bugs.launchpad.net/bugs/2107449 commit b0a3e840ad287c33a86b5515d606451b7df86ad4 upstream. [Why] The enum DC_PSR_VERSION_SU_1 of psr_version is 1 and DC_PSR_VERSION_UNSUPPORTED is 0xFFFFFFFF. The original code may has chance trigger the amdgpu_dm_psr_enable() while psr version is set to DC_PSR_VERSION_UNSUPPORTED. [How] Modify the condition to psr->psr_version == DC_PSR_VERSION_SU_1 Reviewed-by: Sun peng Li Signed-off-by: Tom Chung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher (cherry picked from commit f765e7ce0417f8dc38479b4b495047c397c16902) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman [koichiroden: adjusted context due to the missing commit: ca628f0eddd7 ("drm/amd/display: Fix Panel Replay not update screen correctly"), which fixes changes not in-tree] Signed-off-by: Koichiro Den Signed-off-by: Stefan Bader --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 9d0a2becac37..74fb7e16716a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8763,7 +8763,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, * adequate number of fast atomic commits to notify KMD * of update events. See `vblank_control_worker()`. */ - if (acrtc_state->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 && + if (acrtc_state->stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1 && acrtc_attach->dm_irq_params.allow_sr_entry && #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY !amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&