summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/amd/display
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-12-10 02:43:52 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-12-10 02:43:52 +0000
commit49b3e26bc6c89d4b1a3f90ec2f29150b350da105 (patch)
treecd81f021bc545c6517a951f5f0ec9fca9409fdb2 /sys/dev/pci/drm/amd/display
parent669acf3b35e64f8d37bb237e3f56cc1e7028e4c7 (diff)
drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw
From Srinivasan Shanmugam 205e3b96cc9aa9211fd2c849a16245cf236b2d36 in linux-6.6.y/6.6.64 cba7fec864172dadd953daefdd26e01742b71a6a in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd/display')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index ba4a1e7f196..b8653bdfc40 100644
--- a/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -440,7 +440,7 @@ void dcn30_init_hw(struct dc *dc)
int edp_num;
uint32_t backlight = MAX_BACKLIGHT_LEVEL;
- if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks)
+ if (dc->clk_mgr && dc->clk_mgr->funcs && dc->clk_mgr->funcs->init_clocks)
dc->clk_mgr->funcs->init_clocks(dc->clk_mgr);
// Initialize the dccg
@@ -599,11 +599,12 @@ void dcn30_init_hw(struct dc *dc)
if (!dcb->funcs->is_accelerated_mode(dcb) && dc->res_pool->hubbub->funcs->init_watermarks)
dc->res_pool->hubbub->funcs->init_watermarks(dc->res_pool->hubbub);
- if (dc->clk_mgr->funcs->notify_wm_ranges)
+ if (dc->clk_mgr && dc->clk_mgr->funcs && dc->clk_mgr->funcs->notify_wm_ranges)
dc->clk_mgr->funcs->notify_wm_ranges(dc->clk_mgr);
//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)
+ if (dc->clk_mgr && dc->clk_mgr->funcs && 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)