Commit 1ba2a483 authored by Michael Strauss's avatar Michael Strauss Committed by Alex Deucher

drm/amd/display: Disable chroma viewport w/a when rotated 180 degrees

[WHY]
Previous Renoir chroma viewport workaround fixed an MPO flicker by
increasing the chroma viewport size. However, when the MPO plane is
rotated 180 degrees, the viewport is read in reverse. Since the workaround
increases viewport size, when reading in reverse it causes a vertical
chroma offset.

[HOW]
Pass rotation value to viewport set functions
Temporarily disable the chroma viewport w/a when hubp is rotated 180 degrees
Signed-off-by: default avatarMichael Strauss <michael.strauss@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 460adc6b
......@@ -810,7 +810,8 @@ static void hubp1_set_vm_context0_settings(struct hubp *hubp,
void min_set_viewport(
struct hubp *hubp,
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);
......
......@@ -749,7 +749,9 @@ void hubp1_set_blank(struct hubp *hubp, bool blank);
void min_set_viewport(struct hubp *hubp,
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_vtg_sel(struct hubp *hubp, uint32_t otg_inst);
......
......@@ -2286,7 +2286,8 @@ static void dcn10_update_dchubp_dpp(
hubp->funcs->mem_program_viewport(
hubp,
&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) {
......
......@@ -1382,7 +1382,8 @@ static void dcn20_update_dchubp_dpp(
hubp->funcs->mem_program_viewport(
hubp,
&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);
/* 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)
......
......@@ -169,7 +169,8 @@ static void hubp21_setup(
void hubp21_set_viewport(
struct hubp *hubp,
const struct rect *viewport,
const struct rect *viewport_c)
const struct rect *viewport_c,
enum dc_rotation_angle rotation)
{
struct dcn21_hubp *hubp21 = TO_DCN21_HUBP(hubp);
int patched_viewport_height = 0;
......@@ -196,9 +197,11 @@ void hubp21_set_viewport(
* Work around for underflow issue with NV12 + rIOMMU translation
* + immediate flip. This will cause hubp underflow, but will not
* be user visible since underflow is in blank region
* Disable w/a when rotated 180 degrees, causes vertical chroma offset
*/
patched_viewport_height = viewport_c->height;
if (viewport_c->height != 0 && debug->nv12_iflip_vm_wa) {
if (viewport_c->height != 0 && debug->nv12_iflip_vm_wa &&
rotation != ROTATION_ANGLE_180) {
int pte_row_height = 0;
int pte_rows = 0;
......
......@@ -82,7 +82,9 @@ struct hubp_funcs {
void (*mem_program_viewport)(
struct hubp *hubp,
const struct rect *viewport,
const struct rect *viewport_c);
const struct rect *viewport_c,
enum dc_rotation_angle rotation);
/* rotation needed for Renoir workaround */
bool (*hubp_program_surface_flip_and_addr)(
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