Looks like it fails with build tools.error: sys/conf/kern.pre.mk: does not exist in index
hint hint hinthint: Use 'git am --show-current-patch=diff' to see the failed patch
[titus@z ~/builds]$ git clone https://github.com/freebsd/freebsd-src.git
Cloning into 'freebsd-src'...
remote: Enumerating objects: 5197123, done.
remote: Counting objects: 100% (1819/1819), done.
remote: Compressing objects: 100% (807/807), done.
remote: Total 5197123 (delta 1327), reused 1044 (delta 1011), pack-reused 5195304 (from 3)
Receiving objects: 100% (5197123/5197123), 3.01 GiB | 30.71 MiB/s, done.
Resolving deltas: 100% (3556376/3556376), done.
Updating files: 100% (103542/103542), done.
[titus@z ~/builds]$ cd freebsd-src/
[titus@z ~/builds/freebsd-src]$ git checkout -b drm-base-subtree
Switched to a new branch 'drm-base-subtree'
[titus@z ~/builds/freebsd-src]$ git remote add drm-subtree https://github.com/evadot/drm-subtree.git
[titus@z ~/builds/freebsd-src]$ git subtree add --prefix sys/dev/drm/ drm-subtree master
git fetch drm-subtree master
remote: Enumerating objects: 2189, done.
remote: Counting objects: 100% (286/286), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 2189 (delta 252), reused 235 (delta 229), pack-reused 1903 (from 1)
Receiving objects: 100% (2189/2189), 1.49 MiB | 17.48 MiB/s, done.
Resolving deltas: 100% (1440/1440), done.
From https://github.com/evadot/drm-subtree
* branch master -> FETCH_HEAD
* [new branch] master -> drm-subtree/master
Added dir 'sys/dev/drm'
[titus@z ~/builds/freebsd-src]$ git am sys/dev/drm/extra_patches/*.patch
Applying: Hook DRM to the build
error: patch failed: sys/conf/kern.pre.mk:309
error: sys/conf/kern.pre.mk: patch does not apply
error: patch failed: sys/conf/options:101
error: sys/conf/options: patch does not apply
Patch failed at 0001 Hook DRM to the build
hint: Use 'git am --show-current-patch=diff' to see the failed patch
# git am --show-current-patch=diff
---
sys/arm64/conf/GENERIC-DRM | 21 +++++++++++++++++++++
sys/conf/kern.pre.mk | 15 +++++++++++++++
sys/conf/options | 1 +
3 files changed, 37 insertions(+)
create mode 100644 sys/arm64/conf/GENERIC-DRM
diff --git a/sys/arm64/conf/GENERIC-DRM b/sys/arm64/conf/GENERIC-DRM
new file mode 100644
index 000000000000..db1fffb1729e
--- /dev/null
+++ b/sys/arm64/conf/GENERIC-DRM
@@ -0,0 +1,21 @@
+#
+# GENERIC-DRM
+#
+# Custom kernel for arm64 plus DRM
+#
+# $FreeBSD$
+
+#NO_UNIVERSE
+
+include GENERIC
+ident GENERIC-DRM
+
+# DRM Support
+options COMPAT_DRMKPI
+options COMPAT_LINUXKPI
+
+device drm
+device aw_de2_drm
+device dw_hdmi
+files "../../dev/drm/extra_patches/files"
+files "../../dev/drm/extra_patches/files.aw"
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 5a786c81324d..d7b041148e0e 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -309,6 +309,21 @@ MLXFW_C= ${OFED_C_NOIMP} \
-I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
${.IMPSRC}
+# DRM C flags.
+DRM_INCLUDES+= -I${S}/dev/drm/core/include
+DRM_INCLUDES+= -I${S}/dev/drm/core/include/uapi
+DRM_INCLUDES+= -I${S}/dev/drm/drmkpi/include/
+
+DRM_CFLAGS= ${CFLAGS} ${DRM_INCLUDES}
+DRM_CFLAGS+= -include ${S}/dev/drm/drmkpi/include/drm/drm_os_freebsd.h
+DRM_CFLAGS+= '-DKBUILD_MODNAME="DRMv5.6"'
+DRM_CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -Wno-missing-prototypes
+# Complain about unsigned long long versus uint64_t, remove -Wformat for now
+.if ${MACHINE_CPUARCH} == "aarch64"
+DRM_CFLAGS+= -Wno-format
+.endif
+DRM_C= ${CC} -c ${DRM_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
+
GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
diff --git a/sys/conf/options b/sys/conf/options
index c66b94ce2efd..aea8083927cc 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -101,6 +101,7 @@ COMPAT_FREEBSD12 opt_global.h
COMPAT_FREEBSD13 opt_global.h
COMPAT_LINUXKPI opt_dontuse.h
_COMPAT_LINUX32 opt_compat.h # XXX: make sure opt_compat.h exists
+COMPAT_DRMKPI opt_global.h
COMPILING_LINT opt_global.h
CY_PCI_FASTINTR
DEADLKRES opt_watchdog.h
--
2.35.1
(END)
freebsd-arm probably
it may work if you check out an older version.
COMPAT_FREEBSD* are for enabling backward compatibilities support in kernel with the specified release (here 13). 32 has a specific meaning other than (still nonexistent) release, but 32bit compatibilities.What this code means ?
Code:+++ b/sys/conf/options @@ -101,6 +101,7 @@ COMPAT_FREEBSD12 opt_global.h COMPAT_FREEBSD13 opt_global.h
I read FreeBSD 13 as the latest. And 13 is compatible with the latest changes made on the repo (3 years ago).
Or above.COMPAT_XXX is for older versions so if you have COMPAT_FREEBSD13 you are @14