drm/amd/display: fixed dcn30+ underflow issue
authorjsg <jsg@openbsd.org>
Thu, 15 Jun 2023 02:56:43 +0000 (02:56 +0000)
committerjsg <jsg@openbsd.org>
Thu, 15 Jun 2023 02:56:43 +0000 (02:56 +0000)
From Ayush Gupta
3dc61a19c924632b0bc8ec83593e072739b70645 in linux-6.1.y/6.1.30
37403ced9f2873fab7f39ab4ac963bbb33fb0bc0 in mainline linux

sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_hwseq.c
sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c

index c20e9f7..a1b3124 100644 (file)
@@ -629,7 +629,8 @@ void dcn30_init_hw(struct dc *dc)
        if (dc->clk_mgr->funcs->notify_wm_ranges)
                dc->clk_mgr->funcs->notify_wm_ranges(dc->clk_mgr);
 
-       if (dc->clk_mgr->funcs->set_hard_max_memclk)
+       //if softmax is enabled then hardmax will be set by a different call
+       if (dc->clk_mgr->funcs->set_hard_max_memclk && !dc->clk_mgr->dc_mode_softmax_enabled)
                dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
 
        if (dc->res_pool->hubbub->funcs->force_pstate_change_control)
index bdf1015..d4ee533 100644 (file)
@@ -284,7 +284,7 @@ void dcn31_init_hw(struct dc *dc)
        if (dc->clk_mgr->funcs->notify_wm_ranges)
                dc->clk_mgr->funcs->notify_wm_ranges(dc->clk_mgr);
 
-       if (dc->clk_mgr->funcs->set_hard_max_memclk)
+       if (dc->clk_mgr->funcs->set_hard_max_memclk && !dc->clk_mgr->dc_mode_softmax_enabled)
                dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
 
        if (dc->res_pool->hubbub->funcs->force_pstate_change_control)
index 6ff88a8..74530e2 100644 (file)
@@ -970,7 +970,7 @@ void dcn32_init_hw(struct dc *dc)
        if (dc->clk_mgr->funcs->notify_wm_ranges)
                dc->clk_mgr->funcs->notify_wm_ranges(dc->clk_mgr);
 
-       if (dc->clk_mgr->funcs->set_hard_max_memclk)
+       if (dc->clk_mgr->funcs->set_hard_max_memclk && !dc->clk_mgr->dc_mode_softmax_enabled)
                dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
 
        if (dc->res_pool->hubbub->funcs->force_pstate_change_control)