Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Porting DRM/GEM from OpenBSD to NetBSD (Intel only)
Pull request Compare This branch is 109 commits behind gsutre:device-softc-split.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


|             Porting DRM/GEM from OpenBSD to NetBSD (Intel only)              |

The intel driver included in NetBSD -current does not support the recent
Ironlake IGPs found in Core i3/i5 based laptops.  However, OpenBSD 4.8 supports
them (kudos to OpenBSD developers!).  This support involves three components of
the system:

1. Kernel DRM driver (with GEM support)
2. Userland DRM library
3. video driver

This project aims at porting these three components from OpenBSD to NetBSD, with
a focus on Intel graphics chipsets.  The OpenBSD Xenocara DRM library and
Intel video driver should not require much work.  So the main challenge of this
project is the port of OpenBSD's DRM/GEM kernel driver to NetBSD.

Note: This port is for NetBSD's native  It's not compatible with pkgsrc's                    ^^^^^^

*****      Use at your own risk        ******        Work in progress      *****

1. Patch kernel source tree (/usr/src and /usr/xsrc)

$ git clone

Replace files in /usr/src and /usr/xsrc by the ones provided in the src and xsrc
sub-directories of this project.  This can be achieved for instance as follows:

(WARNING: this overwrites your local source tree.)

$ cd netbsd-drmgem
$ cp -av src xsrc /usr

Alternatively, for /usr/src, you can generate a patch to apply to your source
tree with the following command, run from within the cloned git repository:

$ git diff remotes/origin/netbsd-current remotes/origin/master -- src

However, the generated patch only concerns /usr/src.  It is still necessary to
overwrite /usr/xsrc with files in the xsrc sub-directory of this project.

2. Build and install new kernel

See for instance

3. Build and install OpenBSD Xenocara's libdrm and Xorg intel driver

Refer to the above link for details.  In most cases, the following should work:

$ export USETOOLS=no

$ cd /usr/src/external/mit/xorg/lib/libdrm
$ su root -c "make includes"
$ make
$ su root -c "make install"

$ cd /usr/src/external/mit/xorg/lib/libdrm_intel
$ su root -c "make includes"
$ make
$ su root -c "make install"

$ cd /usr/src/external/mit/xorg/server/drivers/xf86-video-intel
$ make
$ su root -c "make install"

4. Full (cross-)build

As an alternative to steps 2 and 3, you may perform a full (cross-)build of the
patched NetBSD system, using the script.  For instance:

$ ./ -U -m i386 -x release
Something went wrong with that request. Please try again.