]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: fixed dcn30+ underflow issue
authorAyush Gupta <ayugupta@amd.com>
Thu, 16 Mar 2023 19:57:30 +0000 (15:57 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:37:54 +0000 (11:37 +0200)
BugLink: https://bugs.launchpad.net/bugs/2028808
[ Upstream commit 37403ced9f2873fab7f39ab4ac963bbb33fb0bc0 ]

[Why]
Observing underflow on dcn30+ system config at 4k144hz

[How]
We set the UCLK hardmax on AC/DC switch if softmax is enabled
and also on boot. While booting up the UCLK Hardmax is set
to softmax before the init sequence and the init sequence
resets the hardmax to UCLK max which enables P-state switching.
Just added a conditional check to avoid setting hardmax on init.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Ayush Gupta <ayugupta@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c

index c20e9f76f0213fccf33d468d6d67ed954145f307..a1b312483d7f19a21adfbd51aaee72ca0d0e5fae 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 4226a051df414b10979079e40ae104145457e069..37d76012c0ec106607322bac4063c06bdec16360 100644 (file)
@@ -286,7 +286,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 578a715040ac390ef4866dfe1de1eaf334bf9ed8..aca0f302357d90819ac19a88433c551cddaa5a77 100644 (file)
@@ -975,7 +975,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)