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

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

[Why]
Causes underflow regression

[How]
This reverts commit 99d1437aSigned-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
...@@ -2376,6 +2376,7 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2376,6 +2376,7 @@ static void commit_planes_for_stream(struct dc *dc,
enum surface_update_type update_type, enum surface_update_type update_type,
struct dc_state *context) struct dc_state *context)
{ {
bool mpcc_disconnected = false;
int i, j; int i, j;
struct pipe_ctx *top_pipe_to_program = NULL; struct pipe_ctx *top_pipe_to_program = NULL;
...@@ -2406,8 +2407,14 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2406,8 +2407,14 @@ static void commit_planes_for_stream(struct dc *dc,
context_clock_trace(dc, context); context_clock_trace(dc, context);
} }
if (update_type != UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock && dc->hwss.wait_for_pending_cleared) if (update_type != UPDATE_TYPE_FAST && dc->hwss.interdependent_update_lock &&
dc->hwss.disconnect_pipes(dc, context); 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++) { for (j = 0; j < dc->res_pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
......
...@@ -2775,132 +2775,120 @@ static struct pipe_ctx *dcn10_find_top_pipe_for_stream( ...@@ -2775,132 +2775,120 @@ static struct pipe_ctx *dcn10_find_top_pipe_for_stream(
return NULL; return NULL;
} }
void dcn10_disconnect_pipes( bool dcn10_disconnect_pipes(
struct dc *dc, struct dc *dc,
struct dc_state *context) struct dc_state *context)
{ {
bool disconnect_pipes[MAX_PIPES] = {0}; bool found_pipe = false;
bool found_pipe = false; int i, j;
int i, j; struct dce_hwseq *hws = dc->hwseq;
struct dce_hwseq *hws = dc->hwseq; struct dc_state *old_ctx = dc->current_state;
struct dc_state *old_ctx = dc->current_state; bool mpcc_disconnected = false;
bool plane_disabled = false; struct pipe_ctx *old_pipe;
struct pipe_ctx *old_pipe; struct pipe_ctx *new_pipe;
struct pipe_ctx *new_pipe; DC_LOGGER_INIT(dc->ctx->logger);
DC_LOGGER_INIT(dc->ctx->logger);
/* Set pipe update flags and lock pipes */ /* Set pipe update flags and lock pipes */
for (i = 0; i < dc->res_pool->pipe_count; i++) { for (i = 0; i < dc->res_pool->pipe_count; i++) {
old_pipe = &dc->current_state->res_ctx.pipe_ctx[i]; old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
new_pipe = &context->res_ctx.pipe_ctx[i]; new_pipe = &context->res_ctx.pipe_ctx[i];
new_pipe->update_flags.raw = 0; new_pipe->update_flags.raw = 0;
if (!old_pipe->plane_state && !new_pipe->plane_state) if (!old_pipe->plane_state && !new_pipe->plane_state)
continue; continue;
if (old_pipe->plane_state && !new_pipe->plane_state) if (old_pipe->plane_state && !new_pipe->plane_state)
new_pipe->update_flags.bits.disable = 1; new_pipe->update_flags.bits.disable = 1;
/* Check for scl update */ /* Check for scl update */
if (memcmp(&old_pipe->plane_res.scl_data, &new_pipe->plane_res.scl_data, sizeof(struct scaler_data))) if (memcmp(&old_pipe->plane_res.scl_data, &new_pipe->plane_res.scl_data, sizeof(struct scaler_data)))
new_pipe->update_flags.bits.scaler = 1; new_pipe->update_flags.bits.scaler = 1;
/* Check for vp update */ /* Check for vp update */
if (memcmp(&old_pipe->plane_res.scl_data.viewport, &new_pipe->plane_res.scl_data.viewport, sizeof(struct rect)) if (memcmp(&old_pipe->plane_res.scl_data.viewport, &new_pipe->plane_res.scl_data.viewport, sizeof(struct rect))
|| memcmp(&old_pipe->plane_res.scl_data.viewport_c, || memcmp(&old_pipe->plane_res.scl_data.viewport_c,
&new_pipe->plane_res.scl_data.viewport_c, sizeof(struct rect))) &new_pipe->plane_res.scl_data.viewport_c, sizeof(struct rect)))
new_pipe->update_flags.bits.viewport = 1; new_pipe->update_flags.bits.viewport = 1;
} }
if (!IS_DIAG_DC(dc->ctx->dce_environment)) { if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
/* Disconnect mpcc here only if losing pipe split*/ /* Disconnect mpcc here only if losing pipe split*/
for (i = 0; i < dc->res_pool->pipe_count; i++) { for (i = 0; i < dc->res_pool->pipe_count; i++) {
if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable && if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable &&
old_ctx->res_ctx.pipe_ctx[i].top_pipe) { old_ctx->res_ctx.pipe_ctx[i].top_pipe) {
/* Find the top pipe in the new ctx for the bottom pipe that we /* Find the top pipe in the new ctx for the bottom pipe that we
* want to remove by comparing the streams and planes. If both * want to remove by comparing the streams and planes. If both
* pipes are being disabled then do it in the regular pipe * pipes are being disabled then do it in the regular pipe
* programming sequence * programming sequence
*/ */
for (j = 0; j < dc->res_pool->pipe_count; j++) { for (j = 0; j < dc->res_pool->pipe_count; j++) {
if (old_ctx->res_ctx.pipe_ctx[i].top_pipe->stream == context->res_ctx.pipe_ctx[j].stream && if (old_ctx->res_ctx.pipe_ctx[i].top_pipe->stream == context->res_ctx.pipe_ctx[j].stream &&
old_ctx->res_ctx.pipe_ctx[i].top_pipe->plane_state == context->res_ctx.pipe_ctx[j].plane_state && old_ctx->res_ctx.pipe_ctx[i].top_pipe->plane_state == context->res_ctx.pipe_ctx[j].plane_state &&
!context->res_ctx.pipe_ctx[j].top_pipe && !context->res_ctx.pipe_ctx[j].top_pipe &&
!context->res_ctx.pipe_ctx[j].update_flags.bits.disable) { !context->res_ctx.pipe_ctx[j].update_flags.bits.disable) {
found_pipe = true; found_pipe = true;
break; break;
}
} }
}
plane_disabled = true;
// Disconnect if the top pipe lost it's pipe split // Disconnect if the top pipe lost it's pipe split
if (found_pipe && !context->res_ctx.pipe_ctx[j].bottom_pipe) { 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;
} }
found_pipe = false;
} }
}
if (plane_disabled) { if (mpcc_disconnected) {
dc->hwss.wait_for_pending_cleared(dc, context); for (i = 0; i < dc->res_pool->pipe_count; i++) {
dc->hwss.interdependent_update_lock(dc, context, true); struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; struct hubp *hubp = pipe_ctx->plane_res.hubp;
struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct hubp *hubp = pipe_ctx->plane_res.hubp;
if (!pipe_ctx || !plane_state || !pipe_ctx->stream)
continue;
if (disconnect_pipes[i]) { if (!pipe_ctx || !plane_state || !pipe_ctx->stream)
hws->funcs.plane_atomic_disconnect(dc, &dc->current_state->res_ctx.pipe_ctx[i]); continue;
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. // Only update scaler and viewport here if we lose a pipe split.
// This is to prevent half the screen from being black when we // This is to prevent half the screen from being black when we
// unlock after disconnecting MPCC. // unlock after disconnecting MPCC.
if (!(old_pipe && !pipe_ctx->top_pipe && if (!(old_pipe && !pipe_ctx->top_pipe &&
!pipe_ctx->bottom_pipe && old_pipe->bottom_pipe)) !pipe_ctx->bottom_pipe && old_pipe->bottom_pipe))
continue; continue;
if (pipe_ctx->update_flags.raw || pipe_ctx->plane_state->update_flags.raw || pipe_ctx->stream->update_flags.raw) { if (pipe_ctx->update_flags.raw || pipe_ctx->plane_state->update_flags.raw || pipe_ctx->stream->update_flags.raw) {
if (pipe_ctx->update_flags.bits.scaler || if (pipe_ctx->update_flags.bits.scaler ||
plane_state->update_flags.bits.scaling_change || plane_state->update_flags.bits.scaling_change ||
plane_state->update_flags.bits.position_change || plane_state->update_flags.bits.position_change ||
plane_state->update_flags.bits.per_pixel_alpha_change || plane_state->update_flags.bits.per_pixel_alpha_change ||
pipe_ctx->stream->update_flags.bits.scaling) { pipe_ctx->stream->update_flags.bits.scaling) {
pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->plane_state->per_pixel_alpha; pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->plane_state->per_pixel_alpha;
ASSERT(pipe_ctx->plane_res.scl_data.lb_params.depth == LB_PIXEL_DEPTH_30BPP); ASSERT(pipe_ctx->plane_res.scl_data.lb_params.depth == LB_PIXEL_DEPTH_30BPP);
/* scaler configuration */ /* scaler configuration */
pipe_ctx->plane_res.dpp->funcs->dpp_set_scaler( pipe_ctx->plane_res.dpp->funcs->dpp_set_scaler(
pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data); pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data);
} }
if (pipe_ctx->update_flags.bits.viewport || if (pipe_ctx->update_flags.bits.viewport ||
(context == dc->current_state && plane_state->update_flags.bits.position_change) || (context == dc->current_state && plane_state->update_flags.bits.position_change) ||
(context == dc->current_state && plane_state->update_flags.bits.scaling_change) || (context == dc->current_state && plane_state->update_flags.bits.scaling_change) ||
(context == dc->current_state && pipe_ctx->stream->update_flags.bits.scaling)) { (context == dc->current_state && pipe_ctx->stream->update_flags.bits.scaling)) {
hubp->funcs->mem_program_viewport( hubp->funcs->mem_program_viewport(
hubp, hubp,
&pipe_ctx->plane_res.scl_data.viewport, &pipe_ctx->plane_res.scl_data.viewport,
&pipe_ctx->plane_res.scl_data.viewport_c); &pipe_ctx->plane_res.scl_data.viewport_c);
}
} }
} }
} }
return mpcc_disconnected;
dc->hwss.interdependent_update_lock(dc, context, false);
dc->hwss.wait_for_pending_cleared(dc, context);
}
} }
void dcn10_wait_for_pending_cleared(struct dc *dc, void dcn10_wait_for_pending_cleared(struct dc *dc,
......
...@@ -194,7 +194,7 @@ void dcn10_get_surface_visual_confirm_color( ...@@ -194,7 +194,7 @@ void dcn10_get_surface_visual_confirm_color(
void dcn10_get_hdr_visual_confirm_color( void dcn10_get_hdr_visual_confirm_color(
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
struct tg_color *color); struct tg_color *color);
void dcn10_disconnect_pipes( bool dcn10_disconnect_pipes(
struct dc *dc, struct dc *dc,
struct dc_state *context); struct dc_state *context);
......
...@@ -70,7 +70,7 @@ struct hw_sequencer_funcs { ...@@ -70,7 +70,7 @@ struct hw_sequencer_funcs {
int num_planes, struct dc_state *context); int num_planes, struct dc_state *context);
void (*program_front_end_for_ctx)(struct dc *dc, void (*program_front_end_for_ctx)(struct dc *dc,
struct dc_state *context); struct dc_state *context);
void (*disconnect_pipes)(struct dc *dc, bool (*disconnect_pipes)(struct dc *dc,
struct dc_state *context); struct dc_state *context);
void (*wait_for_pending_cleared)(struct dc *dc, void (*wait_for_pending_cleared)(struct dc *dc,
struct dc_state *context); struct dc_state *context);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment