[PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START,END}

Xi Ruoyao posted 1 patch 1 month ago
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START,END}
Posted by Xi Ruoyao 1 month ago
[Why]
The dcn32_override_min_req_memclk function is in dcn32_fpu.c, which is
compiled with CC_FLAGS_FPU into FP instructions.  So when we call it we
must use DC_FP_{START,END} to save and restore the FP context, and
prepare the FP unit on architectures like LoongArch where the FP unit
isn't always on.

Reported-by: LiarOnce <liaronce@hotmail.com>
Fixes: ee7be8f3de1c ("drm/amd/display: Limit DCN32 8 channel or less parts to DPM1 for FPO")
Cc: stable@vger.kernel.org
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
index 7ebb7d1193af..c7fd604024d6 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
@@ -1785,7 +1785,10 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, enum dc_valid
 
 	dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
 
+	DC_FP_START();
 	dcn32_override_min_req_memclk(dc, context);
+	DC_FP_END();
+
 	dcn32_override_min_req_dcfclk(dc, context);
 
 	BW_VAL_TRACE_END_WATERMARKS();
-- 
2.53.0
Re: [PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START,END}
Posted by Alex Hung 3 weeks, 6 days ago
Reviewed-by: Alex Hung <alex.hung@amd.com>

On 3/5/26 23:28, Xi Ruoyao wrote:
> [Why]
> The dcn32_override_min_req_memclk function is in dcn32_fpu.c, which is
> compiled with CC_FLAGS_FPU into FP instructions.  So when we call it we
> must use DC_FP_{START,END} to save and restore the FP context, and
> prepare the FP unit on architectures like LoongArch where the FP unit
> isn't always on.
> 
> Reported-by: LiarOnce <liaronce@hotmail.com>
> Fixes: ee7be8f3de1c ("drm/amd/display: Limit DCN32 8 channel or less parts to DPM1 for FPO")
> Cc: stable@vger.kernel.org
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
>   drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> index 7ebb7d1193af..c7fd604024d6 100644
> --- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> @@ -1785,7 +1785,10 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, enum dc_valid
>   
>   	dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
>   
> +	DC_FP_START();
>   	dcn32_override_min_req_memclk(dc, context);
> +	DC_FP_END();
> +
>   	dcn32_override_min_req_dcfclk(dc, context);
>   
>   	BW_VAL_TRACE_END_WATERMARKS();