Fetching contributors…
Cannot retrieve contributors at this time
117 lines (72 sloc) 4.02 KB
| Porting DRM/GEM from OpenBSD to NetBSD (Intel only) |
The intel driver included in NetBSD -current does not support the recent
integrated GPUs found in Core i3/i5/i7 platforms. 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 ports these three components from OpenBSD to NetBSD. Support for
(embedded) display port has been, in addition, ported directly from Linux. The
port focusses on Intel GPUs and removes support for other graphics hardware.
Note: This port is for NetBSD's native It's not compatible with pkgsrc's ^^^^^^
***** Use at your own risk ****** Work in progress *****
There are several ways to build and install this port. The safest option is to
(cross-)build a new release from scratch. But this may take time, so, instead,
one may choose to use the automated build script that is provided with the port.
Last, it is possible to manually build the required components. Let us present
in detail these three alternatives.
Automated build script
Download the script, create a directory with enough free space for
the build (750 MiB), and then run the script from this directory:
$ /path/to/ -mv <time stamp>
This builds a new kernel as well as intel-specific modules and libraries.
WARNING: this script modifies the local X11R7 installation!
The <time stamp> specifies the date of NetBSD -current sources. You may use any
date compatible with the CVS date format. But, obviously, it is safer to choose
a date that is close to the sources of the running NetBSD system.
Manual build
1. Patch NetBSD 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"
However, this only builds the intel(4) driver as well as its dependencies.
See the script to build Mesa DRI modules and XvMC libraries.
Full (cross-)build
Fetch a clean NetBSD -current source tree, as explained here:
Next, do step 1 of the Manual build section to patch the source tree, and, then,
perform a full (cross-)build of the patched release using the script.
For instance:
$ ./ -U -m amd64 -x release
Install the release as usual.