Skip to contentSkip to conversation

drm/amd/display: Fail atomic_check early on normalize_zpos error

PATCH In review [email protected] 2 participants 2 messages Feb 13, 2023

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: Fail atomic_check early on normalize_zpos error

From: Leo Li <[email protected]>

[Why]

drm_atomic_normalize_zpos() can return an error code when there's modeset lock contention. This was being ignored.

[How]

Bail out of atomic check if normalize_zpos() returns an error.

Fixes b261509952bc ("drm/amd/display: Fix double cursor on non-video RGB MPO")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
index c10982f841f98..cb2a57503000d 100644
@@ -9889,7 +9889,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 	 * `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in
 	 * atomic state, so call drm helper to normalize zpos.
 	 */
-	drm_atomic_normalize_zpos(dev, state);
+	ret = drm_atomic_normalize_zpos(dev, state);
+	if (ret) {
+		drm_dbg(dev, "drm_atomic_normalize_zpos() failed\n");
+		goto fail;
+	}
 
 	/* Remove exiting planes if they are modified */
 	for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 2/13/23 10:51, [email protected] wrote:

From: Leo Li <[email protected]>

[Why]

drm_atomic_normalize_zpos() can return an error code when there's modeset lock contention. This was being ignored.

Quoted 7 lines

[How]

Bail out of atomic check if normalize_zpos() returns an error.

Fixes b261509952bc ("drm/amd/display: Fix double cursor on non-video RGB MPO")
Quoted 21 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
index c10982f841f98..cb2a57503000d 100644
@@ -9889,7 +9889,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
  	 * `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in
  	 * atomic state, so call drm helper to normalize zpos.
  	 */
-	drm_atomic_normalize_zpos(dev, state);
+	ret = drm_atomic_normalize_zpos(dev, state);
+	if (ret) {
+		drm_dbg(dev, "drm_atomic_normalize_zpos() failed\n");
+		goto fail;
+	}
 
  	/* Remove exiting planes if they are modified */
  	for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {
Signature · 1 line
Hamza