drm/amd/display: Interfaces for hubp blank and soft reset
authorWesley Chalmers <Wesley.Chalmers@amd.com>
Mon, 7 Dec 2020 16:46:08 +0000 (11:46 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Dec 2020 20:01:24 +0000 (15:01 -0500)
[WHY]
HUBP blanking sequence on DCN30 requires us to check if HUBP is in blank
and also toggle HUBP_DISABLE, which should instead be called
HUBP_SOFT_RESET for what it does in HW.

Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@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/dcn20/dcn20_hubp.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h

index 41679ad..9e796df 100644 (file)
@@ -1241,6 +1241,22 @@ void hubp1_vtg_sel(struct hubp *hubp, uint32_t otg_inst)
        REG_UPDATE(DCHUBP_CNTL, HUBP_VTG_SEL, otg_inst);
 }
 
+bool hubp1_in_blank(struct hubp *hubp)
+{
+       uint32_t in_blank;
+       struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
+
+       REG_GET(DCHUBP_CNTL, HUBP_IN_BLANK, &in_blank);
+       return in_blank ? true : false;
+}
+
+void hubp1_soft_reset(struct hubp *hubp, bool reset)
+{
+       struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
+
+       REG_UPDATE(DCHUBP_CNTL, HUBP_DISABLE, reset ? 1 : 0);
+}
+
 void hubp1_init(struct hubp *hubp)
 {
        //do nothing
@@ -1272,6 +1288,8 @@ static const struct hubp_funcs dcn10_hubp_funcs = {
 
        .dmdata_set_attributes = NULL,
        .dmdata_load = NULL,
+       .hubp_soft_reset = hubp1_soft_reset,
+       .hubp_in_blank = hubp1_in_blank,
 };
 
 /*****************************************/
index 780af5b..a9a6ed7 100644 (file)
        HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_NO_OUTSTANDING_REQ, mask_sh),\
        HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_VTG_SEL, mask_sh),\
        HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_DISABLE, mask_sh),\
+       HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_IN_BLANK, mask_sh),\
        HUBP_SF(HUBP0_DCSURF_ADDR_CONFIG, NUM_PIPES, mask_sh),\
        HUBP_SF(HUBP0_DCSURF_ADDR_CONFIG, NUM_BANKS, mask_sh),\
        HUBP_SF(HUBP0_DCSURF_ADDR_CONFIG, PIPE_INTERLEAVE, mask_sh),\
        type HUBP_VTG_SEL;\
        type HUBP_UNDERFLOW_STATUS;\
        type HUBP_UNDERFLOW_CLEAR;\
+       type HUBP_IN_BLANK;\
        type NUM_PIPES;\
        type NUM_BANKS;\
        type PIPE_INTERLEAVE;\
@@ -772,5 +774,7 @@ void hubp1_vready_workaround(struct hubp *hubp,
 
 void hubp1_init(struct hubp *hubp);
 void hubp1_read_state_common(struct hubp *hubp);
+bool hubp1_in_blank(struct hubp *hubp);
+void hubp1_soft_reset(struct hubp *hubp, bool reset);
 
 #endif
index b7e44e5..0df0da2 100644 (file)
@@ -1595,6 +1595,8 @@ static struct hubp_funcs dcn20_hubp_funcs = {
        .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl,
        .hubp_init = hubp1_init,
        .validate_dml_output = hubp2_validate_dml_output,
+       .hubp_in_blank = hubp1_in_blank,
+       .hubp_soft_reset = hubp1_soft_reset,
 };
 
 
index af462fe..88ffa9f 100644 (file)
@@ -509,6 +509,8 @@ static struct hubp_funcs dcn30_hubp_funcs = {
        .hubp_clear_underflow = hubp2_clear_underflow,
        .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl,
        .hubp_init = hubp3_init,
+       .hubp_in_blank = hubp1_in_blank,
+       .hubp_soft_reset = hubp1_soft_reset,
 };
 
 bool hubp3_construct(
index 315e306..22f3f64 100644 (file)
@@ -188,6 +188,8 @@ struct hubp_funcs {
        void (*set_unbounded_requesting)(
                struct hubp *hubp,
                bool enable);
+       bool (*hubp_in_blank)(struct hubp *hubp);
+       void (*hubp_soft_reset)(struct hubp *hubp, bool reset);
 
 };