summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-12-10 02:45:46 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-12-10 02:45:46 +0000
commit4b4d0905810e6c8901025207896739bd230148fe (patch)
tree51ae7b9ea5244539b95bb98609f7b52ba4fd9374
parent49b3e26bc6c89d4b1a3f90ec2f29150b350da105 (diff)
drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw
From Srinivasan Shanmugam ec1be3c527b4a5fc85bcc1b0be7cec08bf60c796 in linux-6.6.y/6.6.64 c395fd47d1565bd67671f45cca281b3acc2c31ef in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index a9d59789beb..c55c0534899 100644
--- a/sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/sys/dev/pci/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -773,7 +773,7 @@ void dcn32_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
@@ -950,10 +950,11 @@ void dcn32_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 (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)