With newer AMD GPUs (>=Navi,Renoir) there is FPU context usage in the amdgpu driver.
The kernel_fpu_begin/end implementations in drm did not even allow nested begin-end blocks.
This patch merges a more complete implementation into base as requested by @manu.
The counter algorithm was tested (with the variables still being static) at https://github.com/freebsd/drm-kmod/pull/45
In this version, the variables are moved into the linuxkpi module, the context is allocated with sysinit once, to avoid silly reallocations all over the place.
Adding the file into conf/files.ARCH is quite annoying, would it be better to just ifdef the whole linux_fpu.c instead of excluding it from the build for arches that don't have fpu_kern(9)?
By the way the PowerPC crowd really should implement fpu_kern(9) already ;)