Commit cf27a6d1 authored by Eric Yang's avatar Eric Yang Committed by Alex Deucher

drm/amd/display: update chroma viewport wa

[Why]
Need previously implemented chroma vp wa to work for rotation cases.

[How]
Implement rotation specific wa.
Signed-off-by: default avatarEric Yang <Eric.Yang2@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0120e8b8
...@@ -810,8 +810,7 @@ static void hubp1_set_vm_context0_settings(struct hubp *hubp, ...@@ -810,8 +810,7 @@ static void hubp1_set_vm_context0_settings(struct hubp *hubp,
void min_set_viewport( void min_set_viewport(
struct hubp *hubp, struct hubp *hubp,
const struct rect *viewport, const struct rect *viewport,
const struct rect *viewport_c, const struct rect *viewport_c)
enum dc_rotation_angle rotation)
{ {
struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp); struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
......
...@@ -749,9 +749,7 @@ void hubp1_set_blank(struct hubp *hubp, bool blank); ...@@ -749,9 +749,7 @@ void hubp1_set_blank(struct hubp *hubp, bool blank);
void min_set_viewport(struct hubp *hubp, void min_set_viewport(struct hubp *hubp,
const struct rect *viewport, const struct rect *viewport,
const struct rect *viewport_c, const struct rect *viewport_c);
enum dc_rotation_angle rotation);
/* rotation angle added for use by hubp21_set_viewport */
void hubp1_clk_cntl(struct hubp *hubp, bool enable); void hubp1_clk_cntl(struct hubp *hubp, bool enable);
void hubp1_vtg_sel(struct hubp *hubp, uint32_t otg_inst); void hubp1_vtg_sel(struct hubp *hubp, uint32_t otg_inst);
......
...@@ -2291,8 +2291,7 @@ static void dcn10_update_dchubp_dpp( ...@@ -2291,8 +2291,7 @@ static void dcn10_update_dchubp_dpp(
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);
plane_state->rotation);
} }
if (pipe_ctx->stream->cursor_attributes.address.quad_part != 0) { if (pipe_ctx->stream->cursor_attributes.address.quad_part != 0) {
......
...@@ -1305,6 +1305,7 @@ static void dcn20_update_dchubp_dpp( ...@@ -1305,6 +1305,7 @@ static void dcn20_update_dchubp_dpp(
struct hubp *hubp = pipe_ctx->plane_res.hubp; struct hubp *hubp = pipe_ctx->plane_res.hubp;
struct dpp *dpp = pipe_ctx->plane_res.dpp; struct dpp *dpp = pipe_ctx->plane_res.dpp;
struct dc_plane_state *plane_state = pipe_ctx->plane_state; struct dc_plane_state *plane_state = pipe_ctx->plane_state;
bool viewport_changed = false;
if (pipe_ctx->update_flags.bits.dppclk) if (pipe_ctx->update_flags.bits.dppclk)
dpp->funcs->dpp_dppclk_control(dpp, false, true); dpp->funcs->dpp_dppclk_control(dpp, false, true);
...@@ -1383,12 +1384,14 @@ static void dcn20_update_dchubp_dpp( ...@@ -1383,12 +1384,14 @@ static void dcn20_update_dchubp_dpp(
if (pipe_ctx->update_flags.bits.viewport || if (pipe_ctx->update_flags.bits.viewport ||
(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);
plane_state->rotation); viewport_changed = true;
}
/* Any updates are handled in dc interface, just need to apply existing for plane enable */ /* Any updates are handled in dc interface, just need to apply existing for plane enable */
if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed) if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed)
...@@ -1441,9 +1444,14 @@ static void dcn20_update_dchubp_dpp( ...@@ -1441,9 +1444,14 @@ static void dcn20_update_dchubp_dpp(
hubp->power_gated = false; hubp->power_gated = false;
} }
if (hubp->funcs->apply_PLAT_54186_wa && viewport_changed)
hubp->funcs->apply_PLAT_54186_wa(hubp, &plane_state->address);
if (pipe_ctx->update_flags.bits.enable || plane_state->update_flags.bits.addr_update) if (pipe_ctx->update_flags.bits.enable || plane_state->update_flags.bits.addr_update)
hws->funcs.update_plane_addr(dc, pipe_ctx); hws->funcs.update_plane_addr(dc, pipe_ctx);
if (pipe_ctx->update_flags.bits.enable) if (pipe_ctx->update_flags.bits.enable)
hubp->funcs->set_blank(hubp, false); hubp->funcs->set_blank(hubp, false);
} }
......
...@@ -108,6 +108,7 @@ struct dcn21_hubp { ...@@ -108,6 +108,7 @@ struct dcn21_hubp {
const struct dcn_hubp2_registers *hubp_regs; const struct dcn_hubp2_registers *hubp_regs;
const struct dcn_hubp2_shift *hubp_shift; const struct dcn_hubp2_shift *hubp_shift;
const struct dcn_hubp2_mask *hubp_mask; const struct dcn_hubp2_mask *hubp_mask;
int PLAT_54186_wa_chroma_addr_offset;
}; };
bool hubp21_construct( bool hubp21_construct(
......
...@@ -82,9 +82,10 @@ struct hubp_funcs { ...@@ -82,9 +82,10 @@ struct hubp_funcs {
void (*mem_program_viewport)( void (*mem_program_viewport)(
struct hubp *hubp, struct hubp *hubp,
const struct rect *viewport, const struct rect *viewport,
const struct rect *viewport_c, const struct rect *viewport_c);
enum dc_rotation_angle rotation);
/* rotation needed for Renoir workaround */ void (*apply_PLAT_54186_wa)(struct hubp *hubp,
const struct dc_plane_address *address);
bool (*hubp_program_surface_flip_and_addr)( bool (*hubp_program_surface_flip_and_addr)(
struct hubp *hubp, struct hubp *hubp,
......
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