The VGA arbiter


So we finally have a working code to do the arbitration of the VGA legacy instructions. The code is separated in three pieces: vgaarb module [0], which is the arbiter itself inside Linux; the libvgaaccess [1], a set of user space functions to access the arbiter; and xf86VGAarbiter [2], the implementation of the library inside Xorg.

Basically we wrapped all the functions of the Xorg which deals with VGA (those wrapped by the RAC and few others) using the lock/unlock functions of the libvgaaccess. Really ugly.

The code was not extensively tested, but we’re able to start more than one instance of the Xorg at the same time without having the usual errors (yay, multiseat!). It’s a proof-of-concept. We need to discuss and define what would be the best way to integrate the Xorg with the libvgaaccess.

There’s an urgent todo which is the lack of DRI support. Currently, the arbitration will probably not work with DRI because it’s not guaranteed that the registers will keep a sane state in the case of interruptions. The not so urgent todo is to remove the RAC code [3] from inside the Xorg.

As suggested by benh, at this moment we want to stress mainly the kernel implementation to see if all the requirements were completely achieved, so we can post this to lkml for a complete review. So please, comment this out. We also started a “Theory of Operation” document here [4].

[0] git-clone

[1] git-clone

[2] patch applicable to Xorg 1.4 branch


or git-clone

[3] This must be discussed more because RAC lets different OSes be multi-head wise due all of this is only inside the X server. ITOH, the VGA arbiter relies in a piece inside the kernel. So different OSes would implement different kernel VGA arbiters.