]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 7 Mar 2025 21:55:20 +0000 (15:55 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Mar 2025 18:03:46 +0000 (14:03 -0400)
[WHY]
DMUB locking is important to make sure that registers aren't accessed
while in PSR.  Previously it was enabled but caused a deadlock in
situations with multiple eDP panels.

[HOW]
Detect if multiple eDP panels are in use to decide whether to use
lock. Refactor the function so that the first check is for PSR-SU
and then replay is in use to prevent having to look up number
of eDP panels for those configurations.

Fixes: f245b400a223 ("Revert "drm/amd/display: Use HW lock mgr for PSR1"")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3965
Reviewed-by: ChiaHsuan Chung <chiahsuan.chung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c

index a262598aa6766aca5379d59b698b23ea80dc076b..d37ecfdde4f1bc06d833b8be09853420dee1181b 100644 (file)
@@ -73,5 +73,16 @@ bool should_use_dmub_lock(struct dc_link *link)
        if (link->replay_settings.replay_feature_enabled)
                return true;
 
+       /* only use HW lock for PSR1 on single eDP */
+       if (link->psr_settings.psr_version == DC_PSR_VERSION_1) {
+               struct dc_link *edp_links[MAX_NUM_EDP];
+               int edp_num;
+
+               dc_get_edp_links(link->dc, edp_links, &edp_num);
+
+               if (edp_num == 1)
+                       return true;
+       }
+
        return false;
 }