From: Alvin Lee <[email protected]>

[Description]
Add the POR setting for SDP_PORT_CONTROL into dc init sequence.
This is temporary until the initialization moves into pre-OS DMCUB.

Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Reviewed-by: Dillon Varone <[email protected]>
---
 .../gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c    | 8 ++++++++
 drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c   | 5 +++++
 drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h          | 2 ++
 3 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c 
b/drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c
index 639c71cf1123..843a0da4bdd7 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c
@@ -1905,6 +1905,13 @@ static void 
hubbub60_override_utm_client_qc_profile(struct hubbub *hubbub, uint8
        }
 }
 
+static void hubbub60_set_sdpif_port_control(struct hubbub *hubbub, bool 
ignore_cstate_req)
+{
+       struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
+
+       REG_UPDATE(DCHUBBUB_SDPIF_CFG0, SDPIF_PORT_CONTROL, ignore_cstate_req);
+}
+
 static const struct hubbub_funcs hubbub60_funcs = {
        .update_dchub = hubbub2_update_dchub,
        .init_dchub_sys_ctx = hubbub60_init_dchub_sys_ctx,
@@ -1970,6 +1977,7 @@ static const struct hubbub_funcs hubbub60_funcs = {
                .reset_display_qos_profile =
                        hubbub60_reset_display_qos_profile,
        },
+       .set_sdpif_port_control = hubbub60_set_sdpif_port_control,
 };
 
 void hubbub60_construct(struct dcn20_hubbub *hubbub2,
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c
index ef1c10bc9bfa..d515b9cbc934 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c
@@ -885,6 +885,11 @@ void dcn60_init_hw(struct dc *dc)
                
dc->res_pool->hubbub->funcs->override_utm_client_qc_profile(dc->res_pool->hubbub,
 dc->debug.utm_client_qc_profiles[1], 1);
                
dc->res_pool->hubbub->funcs->override_utm_client_qc_profile(dc->res_pool->hubbub,
 dc->debug.utm_client_qc_profiles[2], 2);
        }
+               /* Temporary init for SDP port control in driver.
+                * Remove once programming is in pre-OS DMU init.
+                */
+       if (dc->res_pool->hubbub->funcs->set_sdpif_port_control)
+               
dc->res_pool->hubbub->funcs->set_sdpif_port_control(dc->res_pool->hubbub, 
false);
 
        // Get DMCUB capabilities
        if (dc->ctx->dmub_srv) {
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h 
b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
index 8d1024a875a7..d68232f10f3e 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h
@@ -226,6 +226,8 @@ struct hubbub_funcs {
 
        void (*hubbub_read_reg_state)(struct hubbub *hubbub, struct 
dcn_hubbub_reg_state *hubbub_reg_state);
 
+       void (*set_sdpif_port_control)(struct hubbub *hubbub, bool 
ignore_cstate_req);
+
        /**
         * @program_det_size:
         *
-- 
2.53.0

Reply via email to