drm/amd/display: Fix HUBP secondary viewport programming
authorIlya Bakoulin <Ilya.Bakoulin@amd.com>
Fri, 23 Aug 2019 16:45:34 +0000 (12:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2019 13:06:54 +0000 (08:06 -0500)
[Why]
Secondary viewport dimension/position registers are not programmed,
which can cause issues in some stereo configurations.

[How]
Add register definitions and register programming.

Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@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

index 001db49e4bb237deb6f9c7fc6cd807a62853b048..14d1be6c66e631d57583954189b3e74838b3764b 100644 (file)
@@ -841,6 +841,14 @@ void min_set_viewport(
        REG_SET_2(DCSURF_PRI_VIEWPORT_START_C, 0,
                  PRI_VIEWPORT_X_START_C, viewport_c->x,
                  PRI_VIEWPORT_Y_START_C, viewport_c->y);
+
+       REG_SET_2(DCSURF_SEC_VIEWPORT_DIMENSION_C, 0,
+                 SEC_VIEWPORT_WIDTH_C, viewport_c->width,
+                 SEC_VIEWPORT_HEIGHT_C, viewport_c->height);
+
+       REG_SET_2(DCSURF_SEC_VIEWPORT_START_C, 0,
+                 SEC_VIEWPORT_X_START_C, viewport_c->x,
+                 SEC_VIEWPORT_Y_START_C, viewport_c->y);
 }
 
 void hubp1_read_state_common(struct hubp *hubp)
index f8e82ef24c09fa197f2681e6909bc0c932f022a2..ae70d9c0aa1d467bc4514c3351ee38934119298b 100644 (file)
@@ -47,6 +47,8 @@
        SRI(DCSURF_SEC_VIEWPORT_START, HUBP, id), \
        SRI(DCSURF_PRI_VIEWPORT_DIMENSION_C, HUBP, id), \
        SRI(DCSURF_PRI_VIEWPORT_START_C, HUBP, id), \
+       SRI(DCSURF_SEC_VIEWPORT_DIMENSION_C, HUBP, id), \
+       SRI(DCSURF_SEC_VIEWPORT_START_C, HUBP, id), \
        SRI(DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH, HUBPREQ, id),\
        SRI(DCSURF_PRIMARY_SURFACE_ADDRESS, HUBPREQ, id),\
        SRI(DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH, HUBPREQ, id),\
        uint32_t DCSURF_SEC_VIEWPORT_START; \
        uint32_t DCSURF_PRI_VIEWPORT_DIMENSION_C; \
        uint32_t DCSURF_PRI_VIEWPORT_START_C; \
+       uint32_t DCSURF_SEC_VIEWPORT_DIMENSION_C; \
+       uint32_t DCSURF_SEC_VIEWPORT_START_C; \
        uint32_t DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH; \
        uint32_t DCSURF_PRIMARY_SURFACE_ADDRESS; \
        uint32_t DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH; \
        HUBP_SF(HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_C, PRI_VIEWPORT_HEIGHT_C, mask_sh),\
        HUBP_SF(HUBP0_DCSURF_PRI_VIEWPORT_START_C, PRI_VIEWPORT_X_START_C, mask_sh),\
        HUBP_SF(HUBP0_DCSURF_PRI_VIEWPORT_START_C, PRI_VIEWPORT_Y_START_C, mask_sh),\
+       HUBP_SF(HUBP0_DCSURF_SEC_VIEWPORT_DIMENSION_C, SEC_VIEWPORT_WIDTH_C, mask_sh),\
+       HUBP_SF(HUBP0_DCSURF_SEC_VIEWPORT_DIMENSION_C, SEC_VIEWPORT_HEIGHT_C, mask_sh),\
+       HUBP_SF(HUBP0_DCSURF_SEC_VIEWPORT_START_C, SEC_VIEWPORT_X_START_C, mask_sh),\
+       HUBP_SF(HUBP0_DCSURF_SEC_VIEWPORT_START_C, SEC_VIEWPORT_Y_START_C, mask_sh),\
        HUBP_SF(HUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH, PRIMARY_SURFACE_ADDRESS_HIGH, mask_sh),\
        HUBP_SF(HUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS, PRIMARY_SURFACE_ADDRESS, mask_sh),\
        HUBP_SF(HUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH, SECONDARY_SURFACE_ADDRESS_HIGH, mask_sh),\
        type PRI_VIEWPORT_HEIGHT_C; \
        type PRI_VIEWPORT_X_START_C; \
        type PRI_VIEWPORT_Y_START_C; \
+       type SEC_VIEWPORT_WIDTH_C; \
+       type SEC_VIEWPORT_HEIGHT_C; \
+       type SEC_VIEWPORT_X_START_C; \
+       type SEC_VIEWPORT_Y_START_C; \
        type PRIMARY_SURFACE_ADDRESS_HIGH;\
        type PRIMARY_SURFACE_ADDRESS;\
        type SECONDARY_SURFACE_ADDRESS_HIGH;\