Commit 4b28b76b authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: fix mpo blanking out on one of planes being set not visible

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 747be97f
...@@ -403,8 +403,7 @@ void dce_mem_input_program_surface_config(struct mem_input *mi, ...@@ -403,8 +403,7 @@ void dce_mem_input_program_surface_config(struct mem_input *mi,
union plane_size *plane_size, union plane_size *plane_size,
enum dc_rotation_angle rotation, enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, struct dc_plane_dcc_param *dcc,
bool horizontal_mirror, bool horizontal_mirror)
bool visible)
{ {
REG_UPDATE(GRPH_ENABLE, GRPH_ENABLE, 1); REG_UPDATE(GRPH_ENABLE, GRPH_ENABLE, 1);
......
...@@ -277,8 +277,7 @@ void dce_mem_input_program_surface_config(struct mem_input *mi, ...@@ -277,8 +277,7 @@ void dce_mem_input_program_surface_config(struct mem_input *mi,
union plane_size *plane_size, union plane_size *plane_size,
enum dc_rotation_angle rotation, enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, struct dc_plane_dcc_param *dcc,
bool horizontal_mirror, bool horizontal_mirror);
bool visible);
void dce_mem_input_allocate_dmif(struct mem_input *mi, void dce_mem_input_allocate_dmif(struct mem_input *mi,
uint32_t h_total, uint32_t h_total,
......
...@@ -1986,8 +1986,9 @@ static void set_plane_config( ...@@ -1986,8 +1986,9 @@ static void set_plane_config(
&surface->public.plane_size, &surface->public.plane_size,
surface->public.rotation, surface->public.rotation,
NULL, NULL,
false, false);
pipe_ctx->surface->public.visible); if (mi->funcs->set_blank)
mi->funcs->set_blank(mi, pipe_ctx->surface->public.visible);
if (dc->public.config.gpu_vm_support) if (dc->public.config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm( mi->funcs->mem_input_program_pte_vm(
...@@ -2432,8 +2433,9 @@ static void dce110_program_front_end_for_pipe( ...@@ -2432,8 +2433,9 @@ static void dce110_program_front_end_for_pipe(
&surface->public.plane_size, &surface->public.plane_size,
surface->public.rotation, surface->public.rotation,
NULL, NULL,
false, false);
pipe_ctx->surface->public.visible); if (mi->funcs->set_blank)
mi->funcs->set_blank(mi, pipe_ctx->surface->public.visible);
if (dc->public.config.gpu_vm_support) if (dc->public.config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm( mi->funcs->mem_input_program_pte_vm(
......
...@@ -664,8 +664,7 @@ void dce110_mem_input_v_program_surface_config( ...@@ -664,8 +664,7 @@ void dce110_mem_input_v_program_surface_config(
union plane_size *plane_size, union plane_size *plane_size,
enum dc_rotation_angle rotation, enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, struct dc_plane_dcc_param *dcc,
bool horizotal_mirror, bool horizotal_mirror)
bool visible)
{ {
struct dce110_mem_input *mem_input110 = TO_DCE110_MEM_INPUT(mem_input); struct dce110_mem_input *mem_input110 = TO_DCE110_MEM_INPUT(mem_input);
......
...@@ -848,7 +848,7 @@ static void reset_front_end_for_pipe( ...@@ -848,7 +848,7 @@ static void reset_front_end_for_pipe(
unlock_master_tg_and_wait(dc->ctx, pipe_ctx->tg->inst); unlock_master_tg_and_wait(dc->ctx, pipe_ctx->tg->inst);
pipe_ctx->mi->funcs->disable_request(pipe_ctx->mi); pipe_ctx->mi->funcs->set_blank(pipe_ctx->mi, true);
wait_no_outstanding_request(dc->ctx, pipe_ctx->pipe_idx); wait_no_outstanding_request(dc->ctx, pipe_ctx->pipe_idx);
...@@ -1513,6 +1513,35 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx) ...@@ -1513,6 +1513,35 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust); pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
} }
static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
{
if (pipe_ctx->surface->public.visible)
return true;
if (pipe_ctx->bottom_pipe && is_lower_pipe_tree_visible(pipe_ctx->bottom_pipe))
return true;
return false;
}
static bool is_upper_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
{
if (pipe_ctx->surface->public.visible)
return true;
if (pipe_ctx->top_pipe && is_upper_pipe_tree_visible(pipe_ctx->top_pipe))
return true;
return false;
}
static bool is_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
{
if (pipe_ctx->surface->public.visible)
return true;
if (pipe_ctx->top_pipe && is_upper_pipe_tree_visible(pipe_ctx->top_pipe))
return true;
if (pipe_ctx->bottom_pipe && is_lower_pipe_tree_visible(pipe_ctx->bottom_pipe))
return true;
return false;
}
static void update_dchubp_dpp( static void update_dchubp_dpp(
struct core_dc *dc, struct core_dc *dc,
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
...@@ -1633,12 +1662,9 @@ static void update_dchubp_dpp( ...@@ -1633,12 +1662,9 @@ static void update_dchubp_dpp(
&size, &size,
surface->public.rotation, surface->public.rotation,
&surface->public.dcc, &surface->public.dcc,
surface->public.horizontal_mirror, surface->public.horizontal_mirror);
surface->public.visible);
/* Only support one plane for now. */
pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, !surface->public.visible);
mi->funcs->set_blank(mi, !is_pipe_tree_visible(pipe_ctx));
} }
static void program_all_pipe_in_tree( static void program_all_pipe_in_tree(
...@@ -1669,10 +1695,13 @@ static void program_all_pipe_in_tree( ...@@ -1669,10 +1695,13 @@ static void program_all_pipe_in_tree(
pipe_ctx->tg->funcs->program_global_sync( pipe_ctx->tg->funcs->program_global_sync(
pipe_ctx->tg); pipe_ctx->tg);
pipe_ctx->tg->funcs->set_blank(pipe_ctx->tg, !is_pipe_tree_visible(pipe_ctx));
update_dchubp_dpp(dc, pipe_ctx, context); update_dchubp_dpp(dc, pipe_ctx, context);
/* Only support one plane for now. */
} }
if (pipe_ctx->bottom_pipe != NULL) if (pipe_ctx->bottom_pipe != NULL)
......
...@@ -38,8 +38,9 @@ ...@@ -38,8 +38,9 @@
#define FN(reg_name, field_name) \ #define FN(reg_name, field_name) \
mi->mi_shift->field_name, mi->mi_mask->field_name mi->mi_shift->field_name, mi->mi_mask->field_name
static void set_blank(struct dcn10_mem_input *mi, bool blank) static void dcn_mi_set_blank(struct mem_input *mem_input, bool blank)
{ {
struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
uint32_t blank_en = blank ? 1 : 0; uint32_t blank_en = blank ? 1 : 0;
REG_UPDATE_2(DCHUBP_CNTL, REG_UPDATE_2(DCHUBP_CNTL,
...@@ -47,15 +48,6 @@ static void set_blank(struct dcn10_mem_input *mi, bool blank) ...@@ -47,15 +48,6 @@ static void set_blank(struct dcn10_mem_input *mi, bool blank)
HUBP_TTU_DISABLE, blank_en); HUBP_TTU_DISABLE, blank_en);
} }
static void disable_request(struct mem_input *mem_input)
{
struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
/* To disable the requestors, set blank_en to 1 */
set_blank(mi, true);
}
static void vready_workaround(struct mem_input *mem_input, static void vready_workaround(struct mem_input *mem_input,
struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest) struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest)
{ {
...@@ -402,8 +394,7 @@ static void mem_input_program_surface_config( ...@@ -402,8 +394,7 @@ static void mem_input_program_surface_config(
union plane_size *plane_size, union plane_size *plane_size,
enum dc_rotation_angle rotation, enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, struct dc_plane_dcc_param *dcc,
bool horizontal_mirror, bool horizontal_mirror)
bool visible)
{ {
struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input); struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
...@@ -412,8 +403,6 @@ static void mem_input_program_surface_config( ...@@ -412,8 +403,6 @@ static void mem_input_program_surface_config(
program_size_and_rotation( program_size_and_rotation(
mi, rotation, format, plane_size, dcc, horizontal_mirror); mi, rotation, format, plane_size, dcc, horizontal_mirror);
program_pixel_format(mi, format); program_pixel_format(mi, format);
set_blank(mi, !visible);
} }
static void program_requestor( static void program_requestor(
...@@ -573,7 +562,6 @@ static void mem_input_setup( ...@@ -573,7 +562,6 @@ static void mem_input_setup(
/* otg is locked when this func is called. Register are double buffered. /* otg is locked when this func is called. Register are double buffered.
* disable the requestors is not needed * disable the requestors is not needed
*/ */
/* disable_request(mem_input); */
program_requestor(mem_input, rq_regs); program_requestor(mem_input, rq_regs);
program_deadline(mem_input, dlg_attr, ttu_attr); program_deadline(mem_input, dlg_attr, ttu_attr);
vready_workaround(mem_input, pipe_dest); vready_workaround(mem_input, pipe_dest);
...@@ -1065,7 +1053,6 @@ static struct mem_input_funcs dcn10_mem_input_funcs = { ...@@ -1065,7 +1053,6 @@ static struct mem_input_funcs dcn10_mem_input_funcs = {
.mem_input_program_display_marks = mem_input_program_display_marks, .mem_input_program_display_marks = mem_input_program_display_marks,
.allocate_mem_input = NULL, .allocate_mem_input = NULL,
.free_mem_input = NULL, .free_mem_input = NULL,
.disable_request = disable_request,
.mem_input_program_surface_flip_and_addr = .mem_input_program_surface_flip_and_addr =
mem_input_program_surface_flip_and_addr, mem_input_program_surface_flip_and_addr,
.mem_input_program_surface_config = .mem_input_program_surface_config =
...@@ -1075,6 +1062,7 @@ static struct mem_input_funcs dcn10_mem_input_funcs = { ...@@ -1075,6 +1062,7 @@ static struct mem_input_funcs dcn10_mem_input_funcs = {
.program_watermarks = program_watermarks, .program_watermarks = program_watermarks,
.mem_input_update_dchub = mem_input_update_dchub, .mem_input_update_dchub = mem_input_update_dchub,
.mem_input_program_pte_vm = dcn_mem_input_program_pte_vm, .mem_input_program_pte_vm = dcn_mem_input_program_pte_vm,
.set_blank = dcn_mi_set_blank,
}; };
......
...@@ -94,9 +94,6 @@ struct mem_input_funcs { ...@@ -94,9 +94,6 @@ struct mem_input_funcs {
struct _vcs_dpi_display_ttu_regs_st *ttu_regs, struct _vcs_dpi_display_ttu_regs_st *ttu_regs,
struct _vcs_dpi_display_rq_regs_st *rq_regs, struct _vcs_dpi_display_rq_regs_st *rq_regs,
struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest); struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest);
void (*disable_request)(struct mem_input *mem_input);
#endif #endif
void (*mem_input_program_display_marks)( void (*mem_input_program_display_marks)(
...@@ -142,13 +139,14 @@ struct mem_input_funcs { ...@@ -142,13 +139,14 @@ struct mem_input_funcs {
union plane_size *plane_size, union plane_size *plane_size,
enum dc_rotation_angle rotation, enum dc_rotation_angle rotation,
struct dc_plane_dcc_param *dcc, struct dc_plane_dcc_param *dcc,
bool horizontal_mirror, bool horizontal_mirror);
bool visible);
bool (*mem_input_is_flip_pending)(struct mem_input *mem_input); bool (*mem_input_is_flip_pending)(struct mem_input *mem_input);
void (*mem_input_update_dchub)(struct mem_input *mem_input, void (*mem_input_update_dchub)(struct mem_input *mem_input,
struct dchub_init_data *dh_data); struct dchub_init_data *dh_data);
void (*set_blank)(struct mem_input *mi, bool blank);
}; };
#endif #endif
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