Skip to content

Commit 19e85e0

Browse files
superm1gregkh
authored andcommitted
drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
commit acbf16a6ae775b4db86f537448cc466288aa307e upstream. [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 <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Hung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit ed569e1279a3045d6b974226c814e071fa0193a6) Cc: [email protected] [superm1: Adjust for missing replay support bfeefe6ea5f1, Adjust for dc_get_edp_links not being renamed from get_edp_links()] Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9c4e202 commit 19e85e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,17 @@ bool should_use_dmub_lock(struct dc_link *link)
6767
{
6868
if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
6969
return true;
70+
71+
/* only use HW lock for PSR1 on single eDP */
72+
if (link->psr_settings.psr_version == DC_PSR_VERSION_1) {
73+
struct dc_link *edp_links[MAX_NUM_EDP];
74+
int edp_num;
75+
76+
get_edp_links(link->dc, edp_links, &edp_num);
77+
78+
if (edp_num == 1)
79+
return true;
80+
}
81+
7082
return false;
7183
}

0 commit comments

Comments
 (0)