drm/amd/display: Disable MALL when SMU not present
authorChris Park <Chris.Park@amd.com>
Fri, 19 Mar 2021 18:55:12 +0000 (14:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:49:03 +0000 (16:49 -0400)
[Why]
Bring-up purpose code to disable DMUB calling into
SMU and timeout for MALL when SMU is not present.

[How]
Disable MALL when SMU is not present.

Signed-off-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Anson Jacob <Anson.Jacob@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h

index 81ea5d3a1947bba1f0806cb456ad6fd699a86b99..577e7f97045efb31758e8940ef80a0afb5089a89 100644 (file)
@@ -432,6 +432,12 @@ static void dcn3_get_memclk_states_from_smu(struct clk_mgr *clk_mgr_base)
                        clk_mgr->base.ctx->dc, clk_mgr_base->bw_params);
 }
 
+static bool dcn3_is_smu_prsent(struct clk_mgr *clk_mgr_base)
+{
+       struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
+       return clk_mgr->smu_present;
+}
+
 static bool dcn3_are_clock_states_equal(struct dc_clocks *a,
                                        struct dc_clocks *b)
 {
@@ -494,6 +500,7 @@ static struct clk_mgr_funcs dcn3_funcs = {
                .are_clock_states_equal = dcn3_are_clock_states_equal,
                .enable_pme_wa = dcn3_enable_pme_wa,
                .notify_link_rate_change = dcn30_notify_link_rate_change,
+               .is_smu_present = dcn3_is_smu_prsent
 };
 
 static void dcn3_init_clocks_fpga(struct clk_mgr *clk_mgr)
index 91784bba5264cd2df41bbffb0f6fbfd7198e83cd..a270879cbabace389edc911f6eb89c3e4065af0a 100644 (file)
@@ -3257,6 +3257,10 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow)
        if (dc->debug.disable_idle_power_optimizations)
                return;
 
+       if (dc->clk_mgr->funcs->is_smu_present)
+               if (!dc->clk_mgr->funcs->is_smu_present(dc->clk_mgr))
+                       return;
+
        if (allow == dc->idle_optimizations_allowed)
                return;
 
index 4e94f2dec5723a78c54b1f8f2b7c05da472e04de..5dc8d02b40c3c18b5a813f1775d2c2029d5a7253 100644 (file)
@@ -262,6 +262,9 @@ struct clk_mgr_funcs {
 
        /* Get current memclk states from PMFW, update relevant structures */
        void (*get_memclk_states_from_smu)(struct clk_mgr *clk_mgr);
+
+       /* Get SMU present */
+       bool (*is_smu_present)(struct clk_mgr *clk_mgr);
 };
 
 struct clk_mgr {