« Submitted! | Home | OpenStreetMapping with a FreeRunner »
June 15, 2009
DRI Front Buffer Handling and KMS
Now that I've got rid of my thesis, it's time to dig my teeth into some fun stuff. I came across a problem with our current DRI architecture for the FreeRunner, which involves trying to combine DRI2 with an existing fbdev-based X driver. The problem arises because we tell EXA that we will allocate memory for pixmaps ourselves (in this case using our GEM interface through libdrm). But, in that case, the X server will attempt to allocate the "screen pixmap", by which I mean the main front buffer which contains what's on the screen, with the same mechanism. This wouldn't be a problem if we could tell, at the time of allocation, that the pixmap being allocated is the screen pixmap, but we can't. At least, not in the tests I've performed.
The "right" way to make this all work is to use kernel modesetting, KMS, to submit the screen pixmap - at a later time - to the lower-level graphics system for display. The execution flow goes something like this:
I took advantage of Truebox's half price deal on debug boards, not knowing how I'd managed to get this far without one. The kit came complete with screwdriver and guitar plectrum for opening the case (sooo much better than the cheap screwdriver and credit card combination I was using before), and they were kind enough to throw in a spare battery at no extra cost. Thanks Truebox!
The "right" way to make this all work is to use kernel modesetting, KMS, to submit the screen pixmap - at a later time - to the lower-level graphics system for display. The execution flow goes something like this:
- Tell EXA we'll handle pixmap allocation.
- At an unspecified point, the screen pixmap gets created via our mechanism.
- Later on, we submit the screen pixmap (in fact, just its GEM handle) to KMS.
- KMS programs the graphics hardware to display the contents of the buffer on the screen.
- Open /dev/fb0, mmap() it. That's what's on the screen.
- Tell EXA we'll handle pixmap allocation.
- At an unspecified point, the screen pixmap gets created via our mechanism.
- Contents of /dev/fb0 are not the same as the screen pixmap.
- Whoops.
I took advantage of Truebox's half price deal on debug boards, not knowing how I'd managed to get this far without one. The kit came complete with screwdriver and guitar plectrum for opening the case (sooo much better than the cheap screwdriver and credit card combination I was using before), and they were kind enough to throw in a spare battery at no extra cost. Thanks Truebox!
Leave a comment