OSDN Git Service

drm/amd/display: Disable chroma viewport w/a when rotated 180 degrees
authorMichael Strauss <michael.strauss@amd.com>
Sun, 10 Nov 2019 20:22:15 +0000 (15:22 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Dec 2019 21:29:38 +0000 (16:29 -0500)
[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>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h

index 31b6473..4d1301e 100644 (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);
 
index 780af5b..e44eaae 100644 (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);
index 2b3081e..2440e28 100644 (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) {
index 619af3b..392542f 100644 (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)
index 4408aed..38661b9 100644 (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;
 
index 9793da0..85a34dd 100644 (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,