* [PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END}
@ 2026-03-06 6:28 Xi Ruoyao
2026-03-08 23:08 ` Claude review: " Claude Code Review Bot
2026-03-08 23:08 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Xi Ruoyao @ 2026-03-06 6:28 UTC (permalink / raw)
To: Alex Hung, Alex Deucher, Christian König
Cc: loongarch, Mingcong Bai, Zixing Liu, Ard Biesheuvel, Xi Ruoyao,
LiarOnce, stable, Harry Wentland, Leo Li, Rodrigo Siqueira,
David Airlie, Simona Vetter, Alvin Lee, Dillon Varone, Ray Wu,
Kees Cook, Yan Li, Ryan Seto, Saaem Rizvi, amd-gfx, dri-devel,
linux-kernel
[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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END}
2026-03-06 6:28 [PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END} Xi Ruoyao
@ 2026-03-08 23:08 ` Claude Code Review Bot
2026-03-08 23:08 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-08 23:08 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END}
Author: Xi Ruoyao <xry111@xry111.site>
Patches: 1
Reviewed: 2026-03-09T09:08:52.939278
---
This is a single-patch series that fixes a missing FP context save/restore around a call to `dcn32_override_min_req_memclk()`. The function lives in `dcn32_fpu.c`, which is compiled with `CC_FLAGS_FPU` (enabling FP instructions). On architectures like LoongArch where the FPU isn't always enabled, calling into FPU-compiled code without the proper `DC_FP_START()`/`DC_FP_END()` guards will cause faults or incorrect behavior.
The fix is correct, minimal, and follows the established pattern already used throughout the same file (e.g., the `dcn32_internal_validate_bw()` call at lines 1770-1771 uses the same `DC_FP_START/END` wrapping). The `Fixes:` tag and `Cc: stable` are appropriate since this is a real bug that affects users on LoongArch.
**Verdict: Good to merge.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END}
2026-03-06 6:28 [PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END} Xi Ruoyao
2026-03-08 23:08 ` Claude review: " Claude Code Review Bot
@ 2026-03-08 23:08 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-08 23:08 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness: Correct.**
The added guards:
```c
DC_FP_START();
dcn32_override_min_req_memclk(dc, context);
DC_FP_END();
```
are necessary because `dcn32_override_min_req_memclk()` is defined in `dcn32_fpu.c` (confirmed at `dcn32_fpu.c:3600`), which is compiled with `CC_FLAGS_FPU` per `dc/dml/Makefile:28,65`. The sibling function `dcn32_override_min_req_dcfclk()` at line 1792 does **not** need wrapping because it lives in `dcn32_resource_helpers.c` (a non-FPU file), which is correct.
**Observations:**
1. The commit message is clear and well-structured with the `[Why]` format used by the amdgpu display team.
2. The `Fixes:` tag correctly references `ee7be8f3de1c` which introduced the unguarded call.
3. The `Cc: stable@vger.kernel.org` is appropriate for a bug fix that causes real failures on LoongArch hardware.
4. The pattern is consistent with how `dcn32_internal_validate_bw()` is already wrapped at lines 1770-1771 in the same function.
**No issues found.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-08 23:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 6:28 [PATCH] drm/amd/display: Wrap dcn32_override_min_req_memclk() in DC_FP_{START, END} Xi Ruoyao
2026-03-08 23:08 ` Claude review: " Claude Code Review Bot
2026-03-08 23:08 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox