Commit d98e5cc2 authored by Tony Cheng's avatar Tony Cheng Committed by Alex Deucher

drm/amd/display: clean up and simply locking logic

always take update lock instead of using HW built in update
lock trigger with write to primary_addr_lo.

we will be a little more inefficient with the extra registers
write to lock, but this simplify code and make it always correct.

Will revisit locking optimization once update sequence mature
Signed-off-by: default avatarTony Cheng <tony.cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2d60ded1
...@@ -1321,22 +1321,22 @@ void dc_update_surfaces_for_stream(struct dc *dc, ...@@ -1321,22 +1321,22 @@ void dc_update_surfaces_for_stream(struct dc *dc,
if (pipe_ctx->surface != surface) if (pipe_ctx->surface != surface)
continue; continue;
/*lock all the MCPP if blnd is enable for DRR*/
if ((update_type == UPDATE_TYPE_FAST && if (update_type == UPDATE_TYPE_FULL) {
(dc_stream->freesync_ctx.enabled == true && /* only apply for top pipe */
surface_count != context->res_ctx.pool->pipe_count)) && if (!pipe_ctx->top_pipe) {
!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) { core_dc->hwss.apply_ctx_for_surface(core_dc,
lock_mask = PIPE_LOCK_CONTROL_MPCC_ADDR; surface, context);
context_timing_trace(dc, &context->res_ctx);
}
} }
if (update_type != UPDATE_TYPE_FAST && if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
lock_mask = PIPE_LOCK_CONTROL_GRAPHICS | lock_mask = PIPE_LOCK_CONTROL_GRAPHICS |
PIPE_LOCK_CONTROL_SCL | PIPE_LOCK_CONTROL_SCL |
PIPE_LOCK_CONTROL_BLENDER | PIPE_LOCK_CONTROL_BLENDER |
PIPE_LOCK_CONTROL_MODE; PIPE_LOCK_CONTROL_MODE;
}
if (lock_mask != 0) {
core_dc->hwss.pipe_control_lock( core_dc->hwss.pipe_control_lock(
core_dc, core_dc,
pipe_ctx, pipe_ctx,
...@@ -1344,15 +1344,6 @@ void dc_update_surfaces_for_stream(struct dc *dc, ...@@ -1344,15 +1344,6 @@ void dc_update_surfaces_for_stream(struct dc *dc,
true); true);
} }
if (update_type == UPDATE_TYPE_FULL) {
/* only apply for top pipe */
if (!pipe_ctx->top_pipe) {
core_dc->hwss.apply_ctx_for_surface(core_dc,
surface, context);
context_timing_trace(dc, &context->res_ctx);
}
}
if (updates[i].flip_addr) if (updates[i].flip_addr)
core_dc->hwss.update_plane_addr(core_dc, pipe_ctx); core_dc->hwss.update_plane_addr(core_dc, pipe_ctx);
...@@ -1382,9 +1373,6 @@ void dc_update_surfaces_for_stream(struct dc *dc, ...@@ -1382,9 +1373,6 @@ void dc_update_surfaces_for_stream(struct dc *dc,
} }
} }
if ((update_type == UPDATE_TYPE_FAST) && lock_mask == 0)
return;
for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) { for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
......
...@@ -52,8 +52,7 @@ void dce_pipe_control_lock(struct core_dc *dc, ...@@ -52,8 +52,7 @@ void dce_pipe_control_lock(struct core_dc *dc,
uint32_t lock_val = lock ? 1 : 0; uint32_t lock_val = lock ? 1 : 0;
uint32_t dcp_grph, scl, blnd, update_lock_mode, val; uint32_t dcp_grph, scl, blnd, update_lock_mode, val;
struct dce_hwseq *hws = dc->hwseq; struct dce_hwseq *hws = dc->hwseq;
if (control_mask & PIPE_LOCK_CONTROL_MPCC_ADDR)
return;
val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx], val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx],
BLND_DCP_GRPH_V_UPDATE_LOCK, &dcp_grph, BLND_DCP_GRPH_V_UPDATE_LOCK, &dcp_grph,
BLND_SCL_V_UPDATE_LOCK, &scl, BLND_SCL_V_UPDATE_LOCK, &scl,
......
...@@ -39,7 +39,6 @@ enum pipe_lock_control { ...@@ -39,7 +39,6 @@ enum pipe_lock_control {
PIPE_LOCK_CONTROL_BLENDER = 1 << 1, PIPE_LOCK_CONTROL_BLENDER = 1 << 1,
PIPE_LOCK_CONTROL_SCL = 1 << 2, PIPE_LOCK_CONTROL_SCL = 1 << 2,
PIPE_LOCK_CONTROL_MODE = 1 << 3, PIPE_LOCK_CONTROL_MODE = 1 << 3,
PIPE_LOCK_CONTROL_MPCC_ADDR = 1 << 4
}; };
struct dce_hwseq_wa { struct dce_hwseq_wa {
......
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