[Intel-gfx] FreeBSD i915 driver update

Scott Long scottl at netflix.com
Thu May 12 20:18:21 UTC 2016


Hello intel-gfx,

I'd like to offer a heads-up on the ongoing work in the FreeBSD project
to update to a contemporary version of the i915 driver.

For context, some background information on the earlier approaches we've
taken to import the i915 driver in FreeBSD. In the past, developers often
reworked the imported driver to conform to FreeBSD coding and even style
conventions. Needless to say, this divergence from the upstream driver
caused an ever-increasing maintenance burden, and proved to be a large
impediment to updating the driver.

In May 2012 we updated to migrate to the KMS driver and bring compat up
to SandyBridge / IvyBridge hardware. We remained on this version for
several years.

In March 2016 Jean-Sébastien Pédron updated to the i915 driver from
Linux 3.8.13, bringing in initial support for Haswell GPUs. A lot of
effort went into reducing gratuituous differences versus the upstream
driver, but the delta to the Linux verison is still significant. This
is what we have in FreeBSD HEAD right now, and represents about 17KLOC
of diffs against Linux. FreeBSD HEAD source reference:
https://svnweb.freebsd.org/base/head/sys/dev/drm2/i915/

Jean-Sébastien and other developers have been discussing a new approach
for post-3.8.13 updates. Instead of maintaining a large set of changes,
the plan is to keep the driver as close as possible to the upstream Linux
version, and use straightforward shims to adapt to interfaces provided by
FreeBSD where possible.

We took an initial step on that path with an update to the Linux 3.9
driver, and have reduced the diffs to about 9KLOC.
https://github.com/freebsd/freebsd-base-graphics/tree/drm-next-3.9

Current work in progress is targeting an update to Linux 4.6, and the
driver currently attaches and basic functionality works (e.g., xterms
and glxgears).  A demonstration screen shot is at
https://plus.google.com/114029301710423058970/posts/485LyZegC9B
The delta to Linux is about 4KLOC right now.
https://github.com/iotamudelta/freebsd-base-graphics/tree/drm-next-4.6

The diffs against the upstream linux code have roughly halfed with
each porting effort.  The focus is on creating a linux KPI compatiblity
layer for FreeBSD that will allow the DRM and KMS drivers to work with
minimal changes.  The goal is to get it under 1KLOC and to the point
where its feasible to follow the upstream development on a 
change-by-change basis.  Our ultimate goal is to align closely with
the Linux graphics development community and collaborate with Intel,
ATI, and others on keeping FreeBSD up to date in their product
development efforts.

The Linux KPI module code and DRM modules will be put into the FreeBSD
ports tree to make them more modular and sharable between different
branches and forks of FreeBSD.  We're hoping to get a BETA level
release into the ports tree in time for the FreeBSD 11.0 launch this
summer.  However, the effort is still very much ALPHA quality right
now and will stay in github as it matures.

Even though the code is still ALPHA, we're looking for any feedback
on the approach we're taking, as well as any reports of successes
and failures on a variety of hardware.  Feel free to follow up on
this mailing list, or to join the freebsd-x11 mailing list on
freebsd.org.  We're also doing a bi-weekly community conference call
to discuss this and other topics in graphics on FreeBSD, and we
welcome others to join the discussion.  As we continue the progress
on getting the code fleshed out and matured, we expect that we'll
collaborate on this list and in the IRC channel.


More information about the Intel-gfx mailing list