From: Muhammad Ahmed <ahmed.ah...@amd.com>

[HOW]
Add debug key to allow disabling dtbclk

Reviewed-by: Charlene Liu <charlene....@amd.com>
Acked-by: Alex Hung <alex.h...@amd.com>
Signed-off-by: Muhammad Ahmed <ahmed.ah...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dc.h                          | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index c378b879c76d..c6030bed95a0 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -244,7 +244,8 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
                }
 
                if (clk_mgr_base->clks.dtbclk_en && !new_clocks->dtbclk_en) {
-                       dcn35_smu_set_dtbclk(clk_mgr, false);
+                       if (clk_mgr->base.ctx->dc->config.allow_0_dtb_clk)
+                               dcn35_smu_set_dtbclk(clk_mgr, false);
                        clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en;
                }
                /* check that we're not already in lower */
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index ee8453bf958f..c1d8288a08b3 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -435,6 +435,7 @@ struct dc_config {
        unsigned int disable_ips;
        unsigned int disable_ips_in_vpb;
        bool usb4_bw_alloc_support;
+       bool allow_0_dtb_clk;
 };
 
 enum visual_confirm {
-- 
2.34.1

Reply via email to