Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d60f1568 authored by Aurabindo Pillai's avatar Aurabindo Pillai Committed by Greg Kroah-Hartman
Browse files

drm/amd/display: Fix hang when skipping modeset



commit da5e14909776edea4462672fb4a3007802d262e7 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: default avatarAlvin Lee <Alvin.Lee2@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 93ca0d7b
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -5776,6 +5776,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
			continue;
			continue;


		dc_plane = dm_new_plane_state->dc_state;
		dc_plane = dm_new_plane_state->dc_state;
		if (!dc_plane)
			continue;


		bundle->surface_updates[planes_count].surface = dc_plane;
		bundle->surface_updates[planes_count].surface = dc_plane;
		if (new_pcrtc_state->color_mgmt_changed) {
		if (new_pcrtc_state->color_mgmt_changed) {
@@ -7029,8 +7031,9 @@ static int dm_update_plane_state(struct dc *dc,
			return -EINVAL;
			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;
		dm_new_plane_state->dc_state = NULL;


		*lock_and_validation_needed = true;
		*lock_and_validation_needed = true;
+3 −0
Original line number Original line Diff line number Diff line
@@ -1315,6 +1315,9 @@ bool dc_remove_plane_from_context(
	struct dc_stream_status *stream_status = NULL;
	struct dc_stream_status *stream_status = NULL;
	struct resource_pool *pool = dc->res_pool;
	struct resource_pool *pool = dc->res_pool;


	if (!plane_state)
		return true;

	for (i = 0; i < context->stream_count; i++)
	for (i = 0; i < context->stream_count; i++)
		if (context->streams[i] == stream) {
		if (context->streams[i] == stream) {
			stream_status = &context->stream_status[i];
			stream_status = &context->stream_status[i];