[coreboot] coccinelle project for i915 graphics driver for coreboot

ron minnich rminnich at gmail.com
Mon Apr 9 20:30:34 CEST 2012

I'm trying an experiment and I welcome anyone who wants to help.

It's a simple idea motivated by a very hard problem. The problem is
that we have unending problems with binary video bioses. We'd like to
get to a source based video bios on, e.g., chromebook.

The linux driver for the intel i915 series can in fact turn on
hardware without the vbios having run. This is great; one reason we
boot the chromebook so fast (as some of you saw last week) is that we
don't bother running the video bios.

This doesn't help those cases where you need graphics in coreboot,
seabios, u-boot, or whatever. For those modes, we still need the video
bios, and we have to cope with its slowness, bugs, and impenetrable

The simple idea is to use coccinelle to extract the init code from the
linux driver to create a standalone piece of C code . I've got to the
point that I can compile the module load function and most of the
things it calls to
a standalone user program.

Now why do it this way? Why not just do a one time hack of the driver
code to a coreboot driver? The reason is that the driver keeps
changing and getting bug fixes. It most recently got some very useful
fixes to the GMBUS driver. We want those fixes but the structure of
the code changed a lot.

I want to see if there is some more automated way to track those
changes. This may not work, but I think it's worth a try.

I'm calling the user mode code i915tool. The workflow is basically like this:

cd util/i915tool
export LINUX=/path/to/kernel
sh transform # copies in linux C code and transforms it

I've got this building two binaries that do things to graphics. Sadly,
I'm not lighting up any devices yet as the GMBUS always fails. But
it's a start, and being able to gdb this code is nice.

Anyway, there are people on this list who are lots better at
coccinelle than I am, and who know graphics better, and so on. What
I'm thinking to do is submit a commit for this tool in its nascent
state and let people take a look. Or, share the code, which may be

If interested, let me know. I could use the help :-)



More information about the coreboot mailing list