From 2c1d1f2834f525028f278f00e99d25bb50b8b971 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 2 Mar 2022 12:48:18 +0000 Subject: [PATCH] drm/amd/display: Protect update_bw_bounding_box FPU code. From Bas Nieuwenhuizen 211b67fb5a49c9f6e6a63d9b94ea96bf2e39341a in linux 5.15.y/5.15.26 1432108d00e42ffa383240bcac8d58f89ae19104 in mainline linux --- .../pci/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 2 ++ sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c b/sys/dev/pci/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c index 1861a147a7f..5c5cbeb59c4 100644 --- a/sys/dev/pci/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +++ b/sys/dev/pci/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c @@ -437,8 +437,10 @@ static void dcn3_get_memclk_states_from_smu(struct clk_mgr *clk_mgr_base) clk_mgr_base->bw_params->clk_table.num_entries = num_levels ? num_levels : 1; /* Refresh bounding box */ + DC_FP_START(); clk_mgr_base->ctx->dc->res_pool->funcs->update_bw_bounding_box( clk_mgr->base.ctx->dc, clk_mgr_base->bw_params); + DC_FP_END(); } static bool dcn3_is_smu_present(struct clk_mgr *clk_mgr_base) diff --git a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c index 4fae7347884..b37c4d2e7a1 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c +++ b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c @@ -891,10 +891,13 @@ static bool dc_construct(struct dc *dc, goto fail; #ifdef CONFIG_DRM_AMD_DC_DCN dc->clk_mgr->force_smu_not_present = init_params->force_smu_not_present; -#endif - if (dc->res_pool->funcs->update_bw_bounding_box) + if (dc->res_pool->funcs->update_bw_bounding_box) { + DC_FP_START(); dc->res_pool->funcs->update_bw_bounding_box(dc, dc->clk_mgr->bw_params); + DC_FP_END(); + } +#endif /* Creation of current_state must occur after dc->dml * is initialized in dc_create_resource_pool because -- 2.20.1