Commit f19d5f35 authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: do full fe reprogram on full update

Fixes MPO entry in 2x4k scenario on raven
Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7950f0f9
...@@ -1404,15 +1404,18 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1404,15 +1404,18 @@ void dc_update_surfaces_and_stream(struct dc *dc,
if (!surface_count) /* reset */ if (!surface_count) /* reset */
core_dc->hwss.apply_ctx_for_surface(core_dc, NULL, context); core_dc->hwss.apply_ctx_for_surface(core_dc, NULL, context);
/* Lock pipes for provided surfaces */ /* Lock pipes for provided surfaces, or all active if full update*/
for (i = 0; i < surface_count; i++) { for (i = 0; i < surface_count; i++) {
struct core_surface *surface = DC_SURFACE_TO_CORE(srf_updates[i].surface); struct core_surface *surface = DC_SURFACE_TO_CORE(srf_updates[i].surface);
for (j = 0; j < core_dc->res_pool->pipe_count; j++) { for (j = 0; j < core_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];
if (pipe_ctx->surface != surface) if (update_type != UPDATE_TYPE_FULL && pipe_ctx->surface != surface)
continue;
if (!pipe_ctx->surface || pipe_ctx->top_pipe)
continue; continue;
if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) { if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
core_dc->hwss.pipe_control_lock( core_dc->hwss.pipe_control_lock(
core_dc, core_dc,
...@@ -1420,22 +1423,49 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1420,22 +1423,49 @@ void dc_update_surfaces_and_stream(struct dc *dc,
true); true);
} }
} }
if (update_type == UPDATE_TYPE_FULL)
break;
} }
/* Full fe update*/
for (j = 0; j < core_dc->res_pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
struct pipe_ctx *cur_pipe_ctx = &core_dc->current_context->res_ctx.pipe_ctx[j];
bool is_new_pipe_surface = cur_pipe_ctx->surface != pipe_ctx->surface;
struct dc_cursor_position position = { 0 };
if (update_type != UPDATE_TYPE_FULL || !pipe_ctx->surface)
continue;
if (!pipe_ctx->top_pipe)
core_dc->hwss.apply_ctx_for_surface(
core_dc, pipe_ctx->surface, context);
/* TODO: this is a hack w/a for switching from mpo to pipe split */
dc_stream_set_cursor_position(&pipe_ctx->stream->public, &position);
if (is_new_pipe_surface) {
core_dc->hwss.update_plane_addr(core_dc, pipe_ctx);
core_dc->hwss.set_input_transfer_func(
pipe_ctx, pipe_ctx->surface);
core_dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx->stream);
}
}
if (update_type > UPDATE_TYPE_FAST)
context_timing_trace(dc, &context->res_ctx);
/* Perform requested Updates */ /* Perform requested Updates */
for (i = 0; i < surface_count; i++) { for (i = 0; i < surface_count; i++) {
struct core_surface *surface = DC_SURFACE_TO_CORE(srf_updates[i].surface); struct core_surface *surface = DC_SURFACE_TO_CORE(srf_updates[i].surface);
if (update_type >= UPDATE_TYPE_MED) { if (update_type == UPDATE_TYPE_MED)
core_dc->hwss.apply_ctx_for_surface( core_dc->hwss.apply_ctx_for_surface(
core_dc, surface, context); core_dc, surface, context);
context_timing_trace(dc, &context->res_ctx);
}
for (j = 0; j < core_dc->res_pool->pipe_count; j++) { for (j = 0; j < core_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];
struct pipe_ctx *cur_pipe_ctx;
bool is_new_pipe_surface = true;
if (pipe_ctx->surface != surface) if (pipe_ctx->surface != surface)
continue; continue;
...@@ -1446,19 +1476,12 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1446,19 +1476,12 @@ void dc_update_surfaces_and_stream(struct dc *dc,
if (update_type == UPDATE_TYPE_FAST) if (update_type == UPDATE_TYPE_FAST)
continue; continue;
cur_pipe_ctx = &core_dc->current_context->res_ctx.pipe_ctx[j]; if (srf_updates[i].in_transfer_func)
if (cur_pipe_ctx->surface == pipe_ctx->surface)
is_new_pipe_surface = false;
if (is_new_pipe_surface ||
srf_updates[i].in_transfer_func)
core_dc->hwss.set_input_transfer_func( core_dc->hwss.set_input_transfer_func(
pipe_ctx, pipe_ctx->surface); pipe_ctx, pipe_ctx->surface);
if (is_new_pipe_surface || if (stream_update != NULL &&
(stream_update != NULL && stream_update->out_transfer_func != NULL) {
stream_update->out_transfer_func !=
NULL)) {
core_dc->hwss.set_output_transfer_func( core_dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx->stream); pipe_ctx, pipe_ctx->stream);
} }
...@@ -1475,15 +1498,19 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1475,15 +1498,19 @@ void dc_update_surfaces_and_stream(struct dc *dc,
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
for (j = 0; j < surface_count; j++) { for (j = 0; j < surface_count; j++) {
if (srf_updates[j].surface == &pipe_ctx->surface->public) { if (update_type != UPDATE_TYPE_FULL &&
if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) { srf_updates[j].surface != &pipe_ctx->surface->public)
core_dc->hwss.pipe_control_lock( continue;
core_dc, if (!pipe_ctx->surface || pipe_ctx->top_pipe)
pipe_ctx, continue;
false);
} if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
break; core_dc->hwss.pipe_control_lock(
core_dc,
pipe_ctx,
false);
} }
break;
} }
} }
......
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