FreeBSD Is Pursuing A Compatibility Layer To Make It Easier To Run Linux DRM Drivers
Written by Michael Larabel in BSD on 12 May 2016 at 06:05 PM EDT. 43 Comments
BSD --
While for years developers working on FreeBSD have been porting DRM/KMS driver changes from the Linux kernel over to their kernel, they have trailed greatly behind the mainline Linux kernel driver state due to the amount of changes they have been making to the driver when re-basing it against a new Linux kernel release. Now they are pursuing a new approach of using a compatibility layer where they hope to be able to more closely follow the upstream Linux DRM/KMS drivers.

The porting of Linux KMS/DRM drivers to Linux has traditionally evolved a lot of work and even changing the coding style to match the FreeBSD kernel. But this has been no easy task and right now they are carrying around a 17,000 lines of code difference against the matching Intel Linux driver.

With their new approach, they are trying to keep the driver source as close as possible to the upstream Linux code and use shims where needed to adapt the interfaces on FreeBSD that don't match the Linux kernel. With their initial work in this direction, they are around a 9,000 LOC difference. For testing out this new layer for their DRM/KMS driver, they are working to update the Intel i915 DRM driver to what's found in the Linux 4.6 kernel. That code delta is now down to around 4,000 lines of code.

"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," explained Scott Long of Netflix in a message to Intel DRM developers.

They are planning on hosting this new effort within the FreeBSD ports tree and they hope this will happen in time for the FreeBSD 11.0-Beta release coming this summer. Right now they consider this new porting layer to be of alpha quality but hope it will be ready in time for the official FreeBSD 11.0 release.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week