On recent CURRENT (FreeBSD 16.0-CURRENT #2 main-n290062-8f93ad70078a: Mon Oct 12 05:17:53 CEST 2026 amd64) port graphics/drm-612-kmod fails to compile due to a missing header, see below. The error was introduced with a couple of patches for LinuxKPI, so i guess this is fallout - but neverthelesse a bug. [...] --- dma-resv.o --- In file included from /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/graphics/drm-612-kmod/work/drm-kmod-drm_v6.12.110_1/drivers/dma-buf/dma-resv.c:36: In file included from /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/graphics/drm-612-kmod/work/drm-kmod-drm_v6.12.110_1/linuxkpi/bsd/include/linux/dma-resv.h:42: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/ww_mutex.h:34: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/mutex.h:37: /usr/src/sys/compat/linuxkpi/common/include/linux/kernel.h:33:10: fatal error: 'opt_linuxkpi.h' file not found 33 | #include "opt_linuxkpi.h"
I'll refer to https://github.com/freebsd/drm-kmod/pull/524 for a discussion and update (along with current@ from today and src-committers).
Created attachment 275674 [details] Patch to fix build after commit src main 9820afb99e6f Upload here for convenience. This version (v4) allows build for graphics/drm-515-kmod. (Patch v3 available at freebsd-current ML didn't yet support graphics/drm-515-kmod.) This was because original patches for Note that this should be the interim patch until graphics/drm-*-kmod are updated to incorporate the fixes. I'll provide updated patch that drops graphics/drm-*-kmod part and clean-up NVIDIA counterparts here and open corresponding review for it. I think this is the way to go, but if it takes for too long a time, I'm OK to open review with this version, with noting co-authored by: dumbbell@ and bz@.
Note that I don't have GitHub account, thus, cannot comment there.
Created attachment 275706 [details] Update patch to drop missingly added files In graphics/drm-612-kmod part, temporarily renamed patches remained. This was because I've missingly copied the same patch from other ports instead of renaming existing files to their original names. (Was actually no harm for builds, as the renames were to extra-*.) Fix this, and a cosmetic fix (space -> tab) in graphics/nvidia-drm-kmod/Makefile.common.
Created attachment 275812 [details] Update patch to match review D60795 Decided to open review for this and done as review D60795, as official pkg build cluster already started failing. https://lists.freebsd.org/archives/freebsd-pkg-fallout/2026-October/1008007.html While here, readd accidentally dropped device_if.h on NVIDIA counterpart. It wouln't be matter for default src builds (should be included in ${LINUXKPI_GENSRCS}), but there's still possiblities for non-default builds to drop it from ${LINUXKPI_GENSRCS}, so readded for safety. The same was already done for graphics/drm-*-kmod parts in earlier update of the patch that is NOT uploaded here, but forgotton for NVIDIA counterpart.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6866177454acf8fc5ac4295a0571fa791442ab52 commit 6866177454acf8fc5ac4295a0571fa791442ab52 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2026-10-17 01:38:06 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2026-10-17 09:23:23 +0000 Revert LinuxKPI: LINUXKPI_DEBUG changes to allow drm-kmod to build It has been almost a week with an open pull-requests and a follow-up identified merge from master drm-kmod, as well as a patch supplied in a PR for the ports to fix the the current build breakage in drm-kmod and as a result also in nvidia-drm-* ports. The problem there is that instead of using the kmod.mk supplied definitions for LINUXKPI and despite using kmod.mk for the build, the external components have hand-rolled solutions which can get out of synch with src.git. This was not discovered early on given that building drm-kmod with LOCAL_MODULES_DIR= from git sources will not fail as the kernel build will have provided the new opt_linuxkpi.h file. In addition drm-kmod master already had the -include for kconfig.h which the src tree has had since 2024. Give the pkgbase/kmod builds and users over the weekend a chance to produce drm-kmod packages as the number of affected poeple is rising. These changes will hopefully be brought back next week once drm-kmod and nvidia-drm-* ports are fixed. PR: 299334 Bring back after: 3+ days This reverts commit bbfd52dcbeb7b6e540220b3b24b664df6d200200. This reverts commit 9820afb99e6fdc471cb820f321530c52ed2c31ac. sys/compat/linuxkpi/common/include/linux/kconfig.h | 29 +--------------------- sys/compat/linuxkpi/common/include/linux/kernel.h | 6 ++--- sys/compat/linuxkpi/common/include/linux/mutex.h | 4 +-- sys/compat/linuxkpi/common/include/linux/rwlock.h | 2 +- sys/compat/linuxkpi/common/include/linux/rwsem.h | 2 +- sys/compat/linuxkpi/common/include/linux/seqlock.h | 2 +- .../linuxkpi/common/include/linux/spinlock.h | 8 +++--- sys/compat/linuxkpi/common/include/linux/wait.h | 2 +- .../linuxkpi/common/include/linux/ww_mutex.h | 2 +- sys/compat/linuxkpi/common/src/linux_hrtimer.c | 2 +- sys/compat/linuxkpi/common/src/linux_work.c | 2 +- sys/conf/kmod.mk | 1 - sys/conf/options | 3 --- sys/conf/std.debug | 1 - sys/conf/std.nodebug | 1 - 15 files changed, 15 insertions(+), 52 deletions(-)