Linux does not have a standard graphics driver interface like Windows does, at the moment is sort of defined by X, and since Wayland and Mir aim to replace X, the interface will be replaced too.
This means that every driver needs to interface with each of the window managers.
I would agree that is a silly idea, but such is the world when applications need very low level access to hardware to attain real time performance. You just get a tangly mess.
> On Linux it is actually the window server that provides
> the interface between applications and the video driver.
This hasn't been true for a long, long time. Modern Linux applications directly call into the graphics driver, either through OpenGL or an intermediate library such as Clutter. > This means that every driver needs to interface with
> each of the window managers.
This is also not true. Window managers are driver-independent, and you can easily write your own window manager without any knowledge of the underlying hardware. You might mean "display server" instead of "window manager", but there's only one display server used in Linux, and that is X11.X11 was designed in an era before standardized graphics or input APIs, so it doesn't use OpenGL. As a result, it needs its own set of drivers for nearly everything (keyboards, mice, graphics, overlays). That's why Linux graphics drivers need to have special X11 support.
Wayland and Mir are an attempt to replace X11 with a much thinner layer, handling only the bare necessities of getting the driver and user application together so they can talk OpenGL together.
This code is an optimization, not a strict requirement, as you're right that in theory XWayland or XMir could be supported in a hardware-agnostic manner. For XWayland this is the (formerly "wlshm") xf86-video-wayland X driver: <http://cgit.freedesktop.org/xorg/driver/xf86-video-wayland/>, but it is much slower than the hardware-specific options (which also exist for the radeon and nouveau X drivers). I don't know if there's an equivalent hardware-agnostic X driver for Mir, but in no case would a production-quality windowing server have that as its only method of compatibility for an important hardware segment--both Wayland and Mir developers expect X-dependent applications to stick around for quite some time, so they must perform as well as possible.
For what it's worth, my hat is firmly in the Wayland camp; its design is simpler, its development more open, and its motivations more clear than those of Mir. Canonical does a bad job of software stewardship and I'd hate to see them in control of the dominant graphics solution for Linux.
Wayland and Mir driver support is pretty much a mystery, and Canonical has been trying to engage hardware designers (Nvidia, Intel, AMD) for support. This recent spate between Canonical and Intel may be indicative that the process isn't going well.
Ubuntu's next LTS release is 14.04 so it's 8 months away, and if there's any surefire way to piss Canonical off then Intel us definitely getting that job done. I'm not trying to defend Canonical but it's hard to ignore the reality of the situation.
I wouldn't be surprised if BSD licensing is on the table front-and-center during negotiations, considering the legal barriers surrounding GPLv3.
Also, it makes me wonder where this leaves Valve. I get the distinct impression that they've been getting cozy with Canonical and they might be getting nervous about the situation.
I think Valve is the reason that Canonical can work together with NVidia and AMD, and that they're probably not nervous about this at all.
This means that if one part of the stack is GPL, everything higher must also be GPL.
Actually the opposite; Canonical will sell phone vendors a non-GPL version of Mir so that they can lock down their phones.
But for now, it's only speculation. Time will tell.
So think the video driver as library and the windowing system as an application using video driver library.
However, as tinco explained[0], it seems that there is no "standard graphics api" for linux, and the "link" between window servers and graphics drivers is hard coded. So you do in fact have to patch the video driver to provide support for a new window server (on Linux at least).