September 23, 2009 posted by Jared D. McNeill
For a second consecutive year I mentored Jeremy Morse for NetBSD's Google Summer of Code. This year's project was entitled Display Control and Acceleration.
Typically on NetBSD a framebuffer console driver will be implemented in the kernel using the rasops(9) library. However, since rasops is geared towards terminal emulation, what you end up with is a graphics driver that is good at drawing text on the console and maybe exporting some registers and the framebuffer via mmap to userland, but not much else.
What this project set out to do was to introduce a layer between wsdisplay and the graphics driver, separating terminal emulation from graphics primitives. This will give display driver authors an API similar to that of an Xorg or GDI display driver. Once this layer is in place, the new graphics subsystem can export its own API to userland, enabling kernel mode setting and basic 2D acceleration in userland without additional device drivers. To demonstrate this, a new graphics driver was to be written and an existing third-party application was to be adapted to take advantage of these APIs.
All of the objectives were met. A new kernel display driver for the Intel GMA series has been developed using this API and QT/Embedded has been demonstrated running on top of it with full 2D acceleration. The source code is available here.
Over the next little while we hope to polish up some of the kernel changes and stabilize the APIs so this can be merged with NetBSD -current at some point.