« Temporal Disturbance | Home | More Chapman Stick »

April 3, 2009

DRI Locking, DRI2 and glxinfo

Quite a few milestones passed today.  The first was that I finished the writing part of my thesis.  There's still a lot to do, but the main slog of producing the original text is now done.  From this point onwards, it's a question of adding figures and working through the list of feedback from my supervisor.  That's not easy, but it's much easier to get motivated about.  I've really been struggling for momentum recently.

I upgraded my Freerunner's GSM firmware to the "Moko11" version.  This includes some flow control fixes which help with problems such as missed calls.  I wasn't having such problems (at least, that anyone told me about..), but I installed it anyway.  One thing I did notice is that the GSM registration now happens smoothly, whereas previously I'd seen a "no network" icon just before it properly registered.

I ran into an issue with making DRI work on ARM.  The issue is with a locking mechanism which requires an atomic "compare and swap" operation.  On the Freerunner's ARMv4t architecture, that isn't quite available.  The nearest we can get is "atomic swap", which isn't quite enough (see here, for example).  A suitable locking mechanism could be devised (our chip has a SWP instruction for this purpose), but it seemed that this would be at least a moderate pain.

So, with some encouragement from other DRI developers on IRC, I took a closer look at DRI2.  Previously I'd been avoiding this because of the smaller number of drivers which use it, particularly in the realm of simple fixed-function hardware.  However, DRI2 does away with locking altogether, so allows this problem to be circumvented.

I gave this a go, and it turned out not to be too much effort to rebase the work so far against Mesa 7.4 and to enable DRI2.  The result?  "glxinfo" now works with the driver.

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
[snip GLX bits]
OpenGL vendor string: Thomas White
OpenGL renderer string: Mesa DRI glamo 20090402
OpenGL version string: 1.2 Mesa 7.4
[snip OpenGL extensions]
16 GLX Visuals
[followed by the expected list of visuals]
Impressive? Not really, but certainly a step in the right direction.

This is your 22:04 service to mobile Linux 3D graphics acceleration, and the next station will be "glClear".

Leave a comment