Skip to content

Commit

Permalink
drm/amd/display: Fix hang when skipping modeset
Browse files Browse the repository at this point in the history
commit da5e149 upstream.

[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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Aurabindo Pillai authored and gregkh committed May 17, 2023
1 parent 7f6738e commit 49f63bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7673,6 +7673,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) {
Expand Down Expand Up @@ -9217,8 +9219,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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/display/dc/core/dc_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 49f63bd

Please sign in to comment.