LWN.net Logo

Non-modular X?

By Jonathan Corbet
September 21, 2011
It has been nearly six years since the release of X11R7.0, the first major release done by the X.Org Foundation. Among the many changes in this release was the change to a new modular architecture that allowed individual graphics drivers to be built and distributed independently from the server itself. Separating out the drivers was seen as a way to make it easier to contribute to their development and to get support for new hardware out to users as quickly as possible. By all accounts, X.Org has been a success, and the modular server architecture would seem to have worked out well.

So it is interesting to see a surge of new discussion of the architecture of our graphics subsystems at all levels. At the kernel level, developers are rethinking the relationships between graphics subsystems; that discussion will be covered in a separate article. At the X.Org level, instead, developers are considering undoing one of the headline changes from X11R7.0 and pulling graphics drivers back into the server itself.

The topic was evidently discussed at the recently-concluded X.Org Developer Conference; Jesse Barnes then brought it to the mailing list with the goal of discussing the good and bad aspects of returning to a monolithic server. At the top of his list of "pros" was that it would make it easier to make API changes in the server and push them into drivers. The kernel benefits from the ability to make internal API changes quickly; X could also make use of this flexibility. Being able to effect API changes immediately would also enable the removal of a bunch of backward-compatibility code intended to make it easier to mix driver and server versions.

The down side, of course, is that life gets harder for developers maintaining out-of-tree drivers - though it must be said that not everybody saw that as a disadvantage. Perhaps a monolithic server will encourage more drivers to move into the X.Org repository. But there is an interesting twist: some drivers, like the Wacom input driver, are licensed under the GPL. X, of course, is under the MIT license; adding GPL-licensed code into the mix would raise some awkward questions. What that means, in reality, is that some drivers will remain outside of the X server repository regardless of what happens to the rest.

Alex Deucher made the claim that API changes in the X server have been decreasing in frequency for some time, so the ability to make them more easily may not be all that valuable. The movement of much of the driver code into the kernel may have caused a reduction in disruptive driver changes in the X.Org server. But it may also be that, as Keith Packard said: "We don't get ABI changes because they're nearly impossible to handle." If those changes could be made more easily, chances are that the server would see more of them. Dave Airlie noted that he has a scheme in the works to make major changes to the driver API, but that he does not see how it can be done with the current, modular model.

How merging the drivers would affect testing is not entirely clear. On the one hand, testers working with new drivers would be building a new server as well, improving testing of the whole system. On the other, testing just a new driver without moving to a new server as well would become harder with the effect that some users are likely to just not bother. So the amount of driver testing could decrease. Nobody really knows how that would settle out, though, without actually trying the experiment.

Distributors could end up working harder to backport drivers to older servers, but the level of concern expressed by distributors in this discussion has been relatively low. As Ubuntu maintainer Bryce Harrington put it: "I favor just doing whatever the upstream developers feel is best for their own needs."

A different concern expressed by driver developers has to do with the core X.Org development process. The rules say that all patches must be reviewed before they can be merged into the master branch. Like all other projects, X.Org is short of reviewer time, so getting the requisite Reviewed-by tags for obscure changes can be a long and frustrating process. Driver code is typically understood by - and reviewed by - fewer developers than core code; that suggests that making changes to drivers in a monolithic server could be hard. The project might have to make some process changes in response; perhaps, as is the case in the kernel, the bar for driver changes could be set a little lower than for changes to the core code.

From your editor's reading of the discussion, it seems that there is a stronger sentiment in favor of making this change than there is against it. Those in favor see a way of making the development process more efficient and more closely integrating all the pieces of the X server. Those who have expressed opposition are mostly concerned about peripheral issues: licensing, review process, etc. Even the developer who is arguably the strongest opponent of the change - Luc Verhaegen - has argued that the real concerns are elsewhere. A better "mindset" when it comes to the design of the core API, he said, would have more far-ranging effects than the organization of the source tree.

As of this writing, no decision has been made public. It is not even 100% clear how such a decision can be made in the X.Org environment, which lacks a dictator (benevolent or otherwise) with the power to impose or block a change. Any project wanting to be successful in the long term must occasionally examine and tweak its institutions and processes. X.Org has already achieved the "long term," but not without some significant changes on the way. Relative to those changes, a decision to pull the drivers back in - or not to do so - seems relatively insignificant. The project, its processes, and its code have all improved considerably over the course of the last six years or so; that trend seems likely to continue into the future either way.


(Log in to post comments)

Non-modular X?

Posted Sep 22, 2011 2:35 UTC (Thu) by jsbarnes (guest, #4096) [Link]

Note this would only be a very small step back toward the old, monolithic days. No one so far has suggested merging libX11, Mesa, xterm, xcalc, and other code back into the server. So even if we do merge the drivers back in, we'd end up looking like Linux and probably wouldn't go any further than that. I do admit to a bit of nostalgia for "make World" though, but only because hindsight filters out the horrors and 'World' has such a grand ring to it. :)

Non-modular X?

Posted Sep 22, 2011 8:05 UTC (Thu) by mbar (subscriber, #73813) [Link]

not make, "emerge -e world" is the correct way :)

Non-modular X?

Posted Sep 22, 2011 9:21 UTC (Thu) by njwhite (subscriber, #51848) [Link]

Would such a change make it easier for the BSDs to use Xorg, going forward?

Non-modular X?

Posted Sep 22, 2011 13:02 UTC (Thu) by daniels (subscriber, #16193) [Link]

Probably not. They already have their own build system to build everything at once as if the modular split never happened, a huge amount of patches which often are never sent upstream, etc.

GPL'd drivers isn't a problem

Posted Sep 22, 2011 12:49 UTC (Thu) by coriordan (guest, #7544) [Link]

The GPL'd drivers might end up being kept out of the core repository, but they could still be kept in *a* repository on x.org. X.Org would still have the same control and the same access to change APIs and API usage.

There's no conflict at all, and by giving free drivers a place of privilege not available to proprietary drivers, it would encourage the former.

Win-win.

GPL'd drivers isn't a problem

Posted Sep 22, 2011 13:33 UTC (Thu) by vonbrand (subscriber, #4458) [Link]

Placing GPL drivers outside the main tree is certainly making them second-rate citizens.

GPL'd drivers isn't a problem

Posted Sep 22, 2011 14:06 UTC (Thu) by bronson (subscriber, #4806) [Link]

If they don't have the same license as the main project then they ARE second rate citizens.

GPL'd drivers isn't a problem

Posted Sep 23, 2011 4:48 UTC (Fri) by whot (subscriber, #50317) [Link]

Not that simple. In the case of the wacom driver, the license was chosen (many years ago btw.) for specific reasons, presumably to prevent competitors from converting it to a proprietary one. Remember that until late 2009 the main contributor to the wacom driver was Wacom Inc and it's still the number 2 contributor.

Pretending that it's a second rate citizen has little practical effect. There is a user-base that needs the driver, it cannot easily be replaced by evdev and rewriting it from scratch is not viable. Virtually all input drivers bar evdev and synaptics are far more second rate citizens than the wacom driver.

GPL'd drivers isn't a problem

Posted Sep 29, 2011 21:31 UTC (Thu) by frabcus (guest, #25169) [Link]

Why can't the project ship a mix of GPL and BSD code together? They're compatible licenses, and the GPL existing in one tree wouldn't magically virally spread to relicense the rest of the code.

Anyone who wants to embed it linked to proprietary code, could then strip out the GPLed stuff with a patch. (It'll be in specific driver directory trees anyway).

GPL'd drivers isn't a problem

Posted Sep 29, 2011 22:28 UTC (Thu) by whot (subscriber, #50317) [Link]

Code hardly stays still, so the initial merge would likely be a nonissue. Though the whole point of merging the drivers that code can be shared easily. In this case, any cleanup or code merging would need to make sure that the code only ever flows in one direction. And that's walking a minefield.

GPL'd drivers isn't a problem

Posted Sep 23, 2011 6:54 UTC (Fri) by hpro (subscriber, #74751) [Link]

I don't know which VCS xorg uses, but would not git's submodules, or SVN's external links work around this neatly? Or would that run afoul of the licensing requirements?

GPL'd drivers isn't a problem

Posted Sep 23, 2011 23:45 UTC (Fri) by coriordan (guest, #7544) [Link]

I don't know the details either, but I know that these kinds of issues revolve around vague words in legislation, like "separate". Are the two code bases "separate"?

Putting them on the same server shouldn't cause a problem. Lots of project hosting facilities host hundreds of projects, and they're "separate".

However, having the repositories "linked", or having one as a "submodule" of the other... no one can say for sure, but it mightn't be a good idea. Law is all grey areas, so when it's not a big inconvenience, projects should err on the side of carefulness. IMO.

GPL'd drivers isn't a problem

Posted Nov 24, 2011 8:01 UTC (Thu) by Duncan (guest, #6647) [Link]

Much of xorg uses git, but I'm not sure if the whole family descended from the original monolithic-X does, yet. (This from a gentoo/x11 overlay user that runs the live-git builds of one or more components for some period, from time to time. Everything I've run live versions of has been git and I /think/ it all is, but am not sure.)

Duncan

Non-modular X?

Posted Sep 25, 2011 20:51 UTC (Sun) by mikov (subscriber, #33179) [Link]

How would it work if I wanted to use two different graphics cards at the same time? Is that even possible now?

It worked pretty well in Windows 2000.

Non-modular X?

Posted Nov 24, 2011 7:57 UTC (Thu) by Duncan (guest, #6647) [Link]

It shouldn't change the situation regarding multiple cards, except that it might make it easier to use disparate drivers since they would by definition be all using the same API/ABI.

Multiple cards has worked, in theory, for a very long time, either in "zaphod mode" (multiple desktops each of which runs its own desktop and panel apps, etc, mice and keyboards can go between but apps can't) or with xinerama (merged into one big desktop). In practice, there's a lot of restrictions on mix-and-matching that only a real guru knows, and often, the proprietary drivers such as nvidia seem to work better in this regard.

The biggest restriction, however, other than some hardware simply not working, is that OpenGL often doesn't work across all cards, either disabling it entirely or working only on one card of the multi-card setup. This is one major advantage of the servantware nvidia driver (and possibly the amd/ati one as well, I'm not sure); it tends to work over multiple cards with fewer restrictions than the native freedomware drivers do. Of course, there's disadvantages too and people like me won't run them at all, but that's one of a number of advantages.

FWIW, at least for Linux, there's a kernel option that enables a graphics routing arbitrator, the purpose of which is to route graphics commands to the appropriate graphics chip/card in a multi-chip/card system. That was only introduced in the last 2-3 years, so it's a /relatively/ new development.

Duncan

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds