Bug 299334 - graphics/drm-612-kmod: compile error: fatal error: 'opt_linuxkpi.h' file not found
Summary: graphics/drm-612-kmod: compile error: fatal error: 'opt_linuxkpi.h' file not ...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-x11 (Nobody)
URL: https://github.com/freebsd/drm-kmod/p...
Keywords:
Depends on:
Blocks:
 
Reported: 2026-10-12 15:10 UTC by O. Hartmann
Modified: 2026-10-17 09:26 UTC (History)
6 users (show)

See Also:
linimon: maintainer-feedback? (x11)


Attachments
Patch to fix build after commit src main 9820afb99e6f (26.10 KB, patch)
2026-10-14 08:36 UTC, Tomoaki AOKI
no flags Details | Diff
Update patch to drop missingly added files (22.85 KB, patch)
2026-10-15 08:51 UTC, Tomoaki AOKI
no flags Details | Diff
Update patch to match review D60795 (22.96 KB, patch)
2026-10-17 03:29 UTC, Tomoaki AOKI
junchoon: maintainer-approval? (x11)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2026-10-12 15:10:56 UTC
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"
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2026-10-12 22:45:18 UTC
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).
Comment 2 Tomoaki AOKI 2026-10-14 08:36:39 UTC
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@.
Comment 3 Tomoaki AOKI 2026-10-14 08:37:31 UTC
Note that I don't have GitHub account, thus, cannot comment there.
Comment 4 Tomoaki AOKI 2026-10-15 08:51:32 UTC
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.
Comment 5 Tomoaki AOKI 2026-10-17 03:29:40 UTC
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.
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-10-17 09:26:13 UTC
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(-)