No description
Find a file
bzfbd 0dab4ff861
drm-kmod: LinuxKPI: use linux-native struct page (#398)
In order to support page_pools and further changes there is a plan to
migrate 'struct page' away from vm_page_t to Linux-native struct page.
The change introduces a conditional (PAGE_IS_LKPI_PAGE), which is also
used for the migration in LinuxKPI, to allow for a smooth transition.
Adding the conditionals here upfront serves two goals: (i) prepare
drm-kmod for the LinuxKPI changes to come, so that drm-kmod will not
break, and (ii) allow people trying out PAGE_IS_LKPI_PAGE for
page_pools/the mt76 wireless driver to also be able to use drm-kmod.
In the long-term once LinuxKPI transitioned, this will also help to
redice FreeBSD-specific code in drm-kmod.

Sponsored by:	The FreeBSD Foundation

Co-authored-by: Bjoern A. Zeeb <bz@FreeBSD.org>
2026-03-09 20:26:04 +01:00
.github/ISSUE_TEMPLATE
amd drm/amd/swsmu: add smu v14_0_2 support 2026-01-28 23:35:09 +01:00
dmabuf
drivers drm-kmod: LinuxKPI: use linux-native struct page (#398) 2026-03-09 20:26:04 +01:00
drm drm/edid: move all internal declarations to drm_crtc_internal.h 2026-01-28 23:35:10 +01:00
dummygfx
i915 drm/i915/display: add support for DMC wakelocks 2026-01-28 23:35:09 +01:00
include drm-kmod: LinuxKPI: use linux-native struct page (#398) 2026-03-09 20:26:04 +01:00
linuxkpi vt_drmfb: Fix visual artifacts on bitmaps crossing right display border 2026-02-21 14:03:07 +03:00
linuxkpi_video
radeon drm/radeon: silence UBSAN warning (v3) 2025-08-09 16:31:51 +02:00
scripts scripts/drmgeneratepatch: Update exclusion list for Linux 6.10 2025-08-09 16:41:47 +02:00
ttm
.cirrus.yml
.gitignore Add new linuxkpi_video driver 2023-12-11 00:27:20 +03:00
kconfig.mk drm/panic: Add a drm panic handler 2026-01-28 23:35:05 +01:00
linuxkpi_version.mk Bump linuxkpi required version to 61000 2026-01-28 23:34:15 +01:00
Makefile
README.md

drm-kmod

The DRM drivers ported from Linux to FreeBSD using linuxkpi.

Installing from sources

Requirements

You need to have the sources of FreeBSD kernel available and they MUST correspond to the installed version of FreeBSD.

There are several ways to get them:

  • by using the FreeBSD installer
  • by using the FreeBSD-src-sys package if you use PkgBase
  • by cloning the Git repository from https://git.FreeBSD.org/src.git or any mirror

By default, Makefiles expect the sources of the kernel to be in /usr/src/sys. The installer and the PkgBase package will install them in that directory. If you clone from Git, you can set SYSDIR=/path/to/FreeBSD/src/sys on the make(1) command line or in the environment when compiling the drivers and their firmwares.

Building

make -j12 DEBUG_FLAGS=-g SYSDIR=/usr/src/sys

As stated in the requirements section, set SYSDIR to the location where you put the FreeBSD kernel sources. The example above shows the default value.

Installing

sudo make install DEBUG_FLAGS=-g SYSDIR=/usr/src/sys KMODDIR=/boot/modules

As stated in the requirements section, set SYSDIR to the location where you put the FreeBSD kernel sources. The example above shows the default value.

Likewise, set KMODDIR to the location of the kernel you want to install the drivers for. The example above shows the default value which is the global directory, used by all installed kernels

Important

The DRM drivers MUST be compiled against the kernel sources corresponding to the installed kernel you want to use them with.

GPU firmwares

DRM drivers depend on binary firmwares. They are maintained in a separate Git repository at https://github.com/freebsd/drm-kmod-firmware.

The binary firmwares are packaged into kernel modules and loaded automatically by the DRM drivers when needed.

The kernel modules can be compiled by following the same instructions as the DRM drivers. The same constraint applies: use the matching kernel sources.

Contributing

Tip

This part is a TL;DR version of the porting process. For the full version, please visit https://github.com/freebsd/drm-kmod/wiki/Porting-a-new-version-of-DRM-drivers-from-Linux.

  1. Clone Linux:

    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git /path/to/linux-src
    
  2. Extract Linux patches:

    ./scripts/drmgeneratepatch \
        /path/to/linux-src \
        /path/to/patches-6.7 \
        v6.6..v6.7
    
  3. Filter out already applied patches:

    ./scripts/drmcheckapplied /path/to/patches-6.7
    
  4. Apply patches to drm-kmod:

    ./scripts/drmpatch /path/to/patches-6.7