Skip to contentSkip to conversation

drm/amd/display: Fix hang when skipping modeset

PATCH In review Alex Deucher 2 participants 2 messages May 15, 2023

Subsystems (4)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: Fix hang when skipping modeset

From: Aurabindo Pillai <[email protected]>

[Why&How]

When skipping full modeset since the only state change was a front porch change, the DC commit sequence requires extra checks to handle non existant plane states being asked to be removed from context.

(cherry picked from commit da5e14909776edea4462672fb4a3007802d262e7)

---

Fixes a hang with freesync video enabled.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index 62af874f26e0..a1ac06eca37a 100644
@@ -7950,6 +7950,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 			continue;
 
 		dc_plane = dm_new_plane_state->dc_state;
+		if (!dc_plane)
+			continue;
 
 		bundle->surface_updates[planes_count].surface = dc_plane;
 		if (new_pcrtc_state->color_mgmt_changed) {
@@ -9601,8 +9603,9 @@ static int dm_update_plane_state(struct dc *dc,
 			return -EINVAL;
 		}
 
+		if (dm_old_plane_state->dc_state)
+			dc_plane_state_release(dm_old_plane_state->dc_state);
 
-		dc_plane_state_release(dm_old_plane_state->dc_state);
 		dm_new_plane_state->dc_state = NULL;
 
 		*lock_and_validation_needed = true;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
index d9f2ef242b0f..0ae6dcc403a4 100644
@@ -1707,6 +1707,9 @@ bool dc_remove_plane_from_context(
 	struct dc_stream_status *stream_status = NULL;
 	struct resource_pool *pool = dc->res_pool;
 
+	if (!plane_state)
+		return true;
+
 	for (i = 0; i < context->stream_count; i++)
 		if (context->streams[i] == stream) {
 			stream_status = &context->stream_status[i];
Signature · 1 line
2.40.1
maintainer
#1 lore raw
Quoted 15 lines · Alex Deucher

From: Aurabindo Pillai <[email protected]>

[Why&How]

When skipping full modeset since the only state change was a front porch change, the DC commit sequence requires extra checks to handle non existant plane states being asked to be removed from context.

(cherry picked from commit da5e14909776edea4462672fb4a3007802d262e7)
Quoted 3 lines

---

Fixes a hang with freesync video enabled.

I just guessed at what trees you wanted this applied to, next time it might be good to give us a hint :)

thanks,

greg k-h