Commit 73ec5680 authored by Isabel Zhang's avatar Isabel Zhang Committed by Alex Deucher
Browse files

drm/amd/display: Revert check for flip pending before locking pipes



[Why]
Causes underflow regression

[How]
This reverts commit 99d1437a

Signed-off-by: default avatarIsabel Zhang <isabel.zhang@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 74d021b5
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2376,6 +2376,7 @@ static void commit_planes_for_stream(struct dc *dc,
		enum surface_update_type update_type,
		struct dc_state *context)
{
	bool mpcc_disconnected = false;
	int i, j;
	struct pipe_ctx *top_pipe_to_program = NULL;

@@ -2406,8 +2407,14 @@ static void commit_planes_for_stream(struct dc *dc,
		context_clock_trace(dc, context);
	}

	if (update_type != UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock && dc->hwss.wait_for_pending_cleared)
		dc->hwss.disconnect_pipes(dc, context);
	if (update_type != UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock &&
		dc->hwss.disconnect_pipes && dc->hwss.wait_for_pending_cleared){
		dc->hwss.interdependent_update_lock(dc, context, true);
		mpcc_disconnected = dc->hwss.disconnect_pipes(dc, context);
		dc->hwss.interdependent_update_lock(dc, context, false);
		if (mpcc_disconnected)
			dc->hwss.wait_for_pending_cleared(dc, context);
	}

	for (j = 0; j < dc->res_pool->pipe_count; j++) {
		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
+72 −84
Original line number Diff line number Diff line
@@ -2775,19 +2775,17 @@ static struct pipe_ctx *dcn10_find_top_pipe_for_stream(
	return NULL;
}

void dcn10_disconnect_pipes(
bool dcn10_disconnect_pipes(
		struct dc *dc,
		struct dc_state *context)
{
	bool disconnect_pipes[MAX_PIPES] = {0};
		bool found_pipe = false;
		int i, j;
		struct dce_hwseq *hws = dc->hwseq;
		struct dc_state *old_ctx = dc->current_state;
	bool plane_disabled = false;
		bool mpcc_disconnected = false;
		struct pipe_ctx *old_pipe;
		struct pipe_ctx *new_pipe;

		DC_LOGGER_INIT(dc->ctx->logger);

		/* Set pipe update flags and lock pipes */
@@ -2835,21 +2833,18 @@ void dcn10_disconnect_pipes(
						}
					}

				plane_disabled = true;

					// Disconnect if the top pipe lost it's pipe split
					if (found_pipe && !context->res_ctx.pipe_ctx[j].bottom_pipe) {
					disconnect_pipes[i] = true;
						hws->funcs.plane_atomic_disconnect(dc, &dc->current_state->res_ctx.pipe_ctx[i]);
						DC_LOG_DC("Reset mpcc for pipe %d\n", dc->current_state->res_ctx.pipe_ctx[i].pipe_idx);
						mpcc_disconnected = true;
					}
				}
				found_pipe = false;
			}
		}

	if (plane_disabled) {
		dc->hwss.wait_for_pending_cleared(dc, context);
		dc->hwss.interdependent_update_lock(dc, context, true);

		if (mpcc_disconnected) {
			for (i = 0; i < dc->res_pool->pipe_count; i++) {
				struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
				struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
@@ -2859,11 +2854,6 @@ void dcn10_disconnect_pipes(
				if (!pipe_ctx || !plane_state || !pipe_ctx->stream)
					continue;

			if (disconnect_pipes[i]) {
				hws->funcs.plane_atomic_disconnect(dc, &dc->current_state->res_ctx.pipe_ctx[i]);
				DC_LOG_DC("Reset mpcc for pipe %d\n", dc->current_state->res_ctx.pipe_ctx[i].pipe_idx);
			}

				// Only update scaler and viewport here if we lose a pipe split.
				// This is to prevent half the screen from being black when we
				// unlock after disconnecting MPCC.
@@ -2897,10 +2887,8 @@ void dcn10_disconnect_pipes(
					}
				}
			}

		dc->hwss.interdependent_update_lock(dc, context, false);
		dc->hwss.wait_for_pending_cleared(dc, context);
		}
	return mpcc_disconnected;
}

void dcn10_wait_for_pending_cleared(struct dc *dc,
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ void dcn10_get_surface_visual_confirm_color(
void dcn10_get_hdr_visual_confirm_color(
		struct pipe_ctx *pipe_ctx,
		struct tg_color *color);
void dcn10_disconnect_pipes(
bool dcn10_disconnect_pipes(
		struct dc *dc,
		struct dc_state *context);

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ struct hw_sequencer_funcs {
			int num_planes, struct dc_state *context);
	void (*program_front_end_for_ctx)(struct dc *dc,
			struct dc_state *context);
	void (*disconnect_pipes)(struct dc *dc,
	bool (*disconnect_pipes)(struct dc *dc,
			struct dc_state *context);
	void (*wait_for_pending_cleared)(struct dc *dc,
			struct dc_state *context);