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: Michael Strauss <michael.strauss@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Michael Strauss 2019-11-10 15:22:15 -05:00 committed by Alex Deucher
parent 460adc6b69
commit 1ba2a48305
6 changed files with 17 additions and 7 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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)

View File

@ -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;

View File

@ -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,