Skip to contentSkip to conversation

drm/amd/display: Use HW lock mgr for PSR1 when only one eDP

PATCH In review Mario Limonciello 2 participants 2 messages Mar 24, 2025 – Mar 25, 2025 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Use HW lock mgr for PSR1 when only one eDP

From: Mario Limonciello <[email protected]>

[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"")
(cherry picked from commit acbf16a6ae775b4db86f537448cc466288aa307e)

[superm1: Adjust for missing replay support bfeefe6ea5f1,
Adjust for dc_get_edp_links not being renamed from get_edp_links()]

---
 .../gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +12 -0
index 3f32e9c3fbaf..13995b6fb865 100644
@@ -67,5 +67,17 @@ bool should_use_dmub_lock(struct dc_link *link)
 {
 	if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
 		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;
+
+		get_edp_links(link->dc, edp_links, &edp_num);
+
+		if (edp_num == 1)
+			return true;
+	}
+
 	return false;
 }
Signature · 1 line
2.43.0
maintainer Reviewed-by ChiaHsuan Chung Tested-by Daniel Wheeler on v1 1/1
#1 lore raw

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
⚠️ Found matching upstream commit but patch is missing proper reference to it

Found matching upstream commit: acbf16a6ae775b4db86f537448cc466288aa307e

WARNING: Author mismatch between patch and found commit:
Backport author: Mario Limonciello<[email protected]> Commit author: Mario Limonciello<[email protected]>

Status in newer kernel trees:
6.13.y | Not found
6.12.y | Not found
6.6.y | Not found

Note: The patch differs from the upstream commit:
---
1: acbf16a6ae775 ! 1: 798c6bedbaa1a drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
@@ Commit message

Fixes f245b400a223 ("Revert "drm/amd/display: Use HW lock mgr for PSR1"")

- Signed-off-by: Mario Limonciello <[email protected]>

- (cherry picked from commit ed569e1279a3045d6b974226c814e071fa0193a6)
Cc: [email protected]
+ (cherry picked from commit acbf16a6ae775b4db86f537448cc466288aa307e)
+ [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]>

## drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c ##
@@ drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c: bool should_use_dmub_lock(struct dc_link *link)
- if (link->replay_settings.replay_feature_enabled)
+ {
+ if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
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);
++ get_edp_links(link->dc, edp_links, &edp_num);
+
+ if (edp_num == 1)
+ return true;
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |