Skip to content

Commit da5e149

Browse files
Aurabindo Pillaialexdeucher
authored andcommitted
drm/amd/display: Fix hang when skipping modeset
[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. Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 3fb7efd commit da5e149

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7972,6 +7972,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
79727972
continue;
79737973

79747974
dc_plane = dm_new_plane_state->dc_state;
7975+
if (!dc_plane)
7976+
continue;
79757977

79767978
bundle->surface_updates[planes_count].surface = dc_plane;
79777979
if (new_pcrtc_state->color_mgmt_changed) {
@@ -9620,8 +9622,9 @@ static int dm_update_plane_state(struct dc *dc,
96209622
return -EINVAL;
96219623
}
96229624

9625+
if (dm_old_plane_state->dc_state)
9626+
dc_plane_state_release(dm_old_plane_state->dc_state);
96239627

9624-
dc_plane_state_release(dm_old_plane_state->dc_state);
96259628
dm_new_plane_state->dc_state = NULL;
96269629

96279630
*lock_and_validation_needed = true;

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,9 @@ bool dc_remove_plane_from_context(
17071707
struct dc_stream_status *stream_status = NULL;
17081708
struct resource_pool *pool = dc->res_pool;
17091709

1710+
if (!plane_state)
1711+
return true;
1712+
17101713
for (i = 0; i < context->stream_count; i++)
17111714
if (context->streams[i] == stream) {
17121715
stream_status = &context->stream_status[i];

0 commit comments

Comments
 (0)