On Fri, 2026-05-08 at 16:11 +0800, Xi Ruoyao wrote:
> On Thu, 2026-03-26 at 10:57 +0800, ChuanYu Tseng wrote:
>
> > FPU guards (DC_FP_START/DC_FP_END) are required to wrap around code that
> > can manipulates floats. To do this properly, the FPU guards must be used
> > in a file that is not compiled as a FPU unit. If the guards are used in
> > a file that is a FPU unit, other sections in the file that aren't guarded
> > may be end up being compiled to use FPU operations.
>
> /* snip */
>
> > diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
> > b/drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
>
> We have:
>
> CFLAGS_$(AMDDALPATH)/dc/dml2_0/dml2_wrapper.o := $(dml2_rcflags)
>
> and
>
> dml2_rcflags := $(CC_FLAGS_NO_FPU)
>
> so this file isn't compiled as a FPU unit. Why removing the guards
> here?
>
> /* snip */
>
> > index 408559d6fb2d..f8250c80be02 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
> > @@ -6,7 +6,20 @@
> > */
> >
> > #include "dml2_internal_types.h"
> > +#include "dml2_wrapper.h"
> > #include "dml2_wrapper_fpu.h"
> > +#include "dml21_wrapper.h"
> > +#include "dml21_wrapper_fpu.h"
> > +
> > +#include "dc_fpu.h"
> > +
> > +struct dml2_context *dml2_allocate_memory(void)
> > +{
> > + struct dml2_context *dml2;
> > +
> > + DC_RUN_WITH_PREEMPTION_ENABLED(dml2 = vzalloc(sizeof(struct
> > dml2_context)));
> > + return dml2;
> > +}
> >
> > bool dml2_validate(const struct dc *in_dc, struct dc_state *context,
> > struct dml2_context *dml2,
> > enum dc_validate_mode validate_mode)
> > @@ -23,16 +36,12 @@ bool dml2_validate(const struct dc *in_dc, struct
> > dc_state *context, struct dml2
> > return out;
> > }
> >
> > - DC_FP_START();
>
> Notably the removal of this is causing:
>
> [ 3.943927] do_fpu invoked from kernel context![#1]:
> [ 3.948860] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted
> 7.0.3-aosc-main-4k #2 PREEMPT(lazy)
Oh, I didn't expect the code path of 7.0.3 is so different from the
mainline (7.1-rc1). The mainline has guarded this elsewhere and the
breakage on 7.0.3 is caused by some difference reason that I'm still
trying to figure out...
--
Xi Ruoyao <[email protected]>