]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix PSR-SU not support but still call the amdgpu_dm_psr_enable
authorTom Chung <chiahsuan.chung@amd.com>
Thu, 5 Dec 2024 15:08:28 +0000 (23:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 6 Jan 2025 19:44:27 +0000 (14:44 -0500)
[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 <sunpeng.li@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index a8933612966b7a2461bd7adccd0def7cd8028cad..0bbe8c454922776c04f68e0dfb67407072e768e2 100644 (file)
@@ -8931,7 +8931,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
                    (current_ts - psr->psr_dirty_rects_change_timestamp_ns) > 500000000) {
                        if (pr->replay_feature_enabled && !pr->replay_allow_active)
                                amdgpu_dm_replay_enable(acrtc_state->stream, true);
-                       if (psr->psr_version >= DC_PSR_VERSION_SU_1 &&
+                       if (psr->psr_version == DC_PSR_VERSION_SU_1 &&
                            !psr->psr_allow_active && !aconn->disallow_edp_enter_psr)
                                amdgpu_dm_psr_enable(acrtc_state->stream);
                }