Untangling The Linux Graphics Stack
carbon-project.org
carbon-project.org
This article reminds me a little of that essay. As a Linux user, which the first sentence implies is the target audience, this article helps me understand exactly nothing.
P.S. For your own sanity, never read back anything you wrote as a teenager. Dear lord.
Does anyone here know more details?
Gallium is an interface for doing 3D stuff. It's very generalized and describes a very general, shaderful, batched renderer. "Shaderful" means that the renderer has shaders instead of old-school fixed-function TCL and pixel combiners; "batched" means that the renderer prefers to operate on pre-cooked buffers full of data rather than vertex-at-a-time data.
Gallium matters because it is a much more direct and low-level interface for describing hardware which enables hardware-specific optimizations to be decoupled from API-level logic. We have implemented GL, D3D (not open-source!), VG, X11 (EXA, Xv, XvMC, VDPAU), etc. on top of Gallium, without having to write entirely new backends each time. It makes it easier to write drivers. Gallium's actual interface is also less verbose than user-level APIs, which means the actual drivers are smaller by anywhere from 30-50% LOCs.
There are two basic parts to graphics drivers: kernel and userspace. All policy is in userspace; for graphics, this means things like rendering APIs (Cairo, GTK, X11, GL, VG). The kernel part manages the card's low-level state, handling its memory, outputs, onboard audio, power states, and so forth, but doesn't actually control how the card renders things.
The big complexity is how many different userspace clients there are that can ask the graphics card to render something fancy for them. In the X11 world, there's the internal X11 driver, which speaks EXA and uses the card to draw the general desktop, but there's also GLX, which goes through Mesa to get GL commands translated into commands for the specific graphics card. On top of those, there's special drivers for video, with four (!!) different APIs: Xvideo, Xvideo MC, VDPAU, VAAPI, and those each require helper code. VDPAU and VAAPI each require external helper libraries too.
Still with me? Awesome. Your toolkits also have graphics stuff, although they usually target an intermediate API rather than a specific card. These include Cairo, GTK, Qt, Wx, Pango, and so forth. Usually these toolkits speak the neutral X11 protocol, but they might decide to speak GL if they think it can make things go faster.