Add infrastructure for working Mesa 3D under X11!

You'll probably also need the kernel side of things (the last commit I just added, fix null pointer on cache flush.)