VGA Arbiter

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Oct 26 18:35:37 PDT 2007


On Fri, 2007-10-26 at 17:17 -0200, Paulo Ricardo Zanoni wrote:
> Hi!
> 
> In 2005, there was some discussion[0, 1] about a possible VGA Arbiter inside the 
> Kernel.  People discussed an interface and Benjamin Herrenschmidt started 
> writing a implementation. Due to the lack of time he stopped working on it.
> 
> Me and Tiago Vignatti are interested on the problem (because we work with 
> multiseat), so we started working on Benjamin's patch. We continued the 
> implementation of the /dev interface[2], we created a small library that uses 
> this interface[3] and we also made (tried to) the xserver use it[4].

Great !

> The problem is that we're still trying to understand everything =) The code is a 
> little complicated and we've never played with PCI stuff. So we want to hear 
> your opinions if we're going on the right way.

Also, I think there were bugs in my implementation... sorry no to be
very precise about it, but it's fairly old and I don't remember
precisely.

I suppose we can just find & iron them out in time :-)

> To use the /dev interface you just write strings on the device and the kernel 
> interprets it and does what it has to do. The interface is very simple and is 
> explained at vgaarb.c:520 (kernel module code). It was originally written as 
> part of the kernel, but we made it a module (to make easier to compile and 
> test). The problem is that string comparing inside the kernel does not have too 
> much performance.

The interface was something I quickly threw together, it doesn't
necessarily have to be that way. In fact, I wonder if a sysfs file might
be better. Anyway, it's good to have a proof of concept to work from.

> The library is a very simple abstraction that talks to the /dev. The code still 
> needs to change a lot, but works =)
> 
> The xserver code is actually a modification in the RAC code. We wrapped the 
> video driver calls with with "get_lock" and "put_lock". This is really not what 
> should be done, it is just the easier way to test if things work. Currently, it 
> is not working and we're studying X's code to see what we did wrong (maybe the 
> problem is in the Kernel module).

An important function I wanted to have is when a video driver such as
radeon knows it will only use MMIO and no legacy stuff, it can take
itself out of the arbitration (take the card out of the arbitration) at
least until I needs to use legacy stuff again.

This is important because you cannot reliably use interrupts for
example, like the DRM does on these, if your MMIO decoding can be
switched off by another cards driver trying to get to its own legacy IOs
or memory space.

> Until now, we're just trying to "make things work". After this, we'll make the 
> code a lot better and improve performance.
> 
> We want to know what you guys think about it. Are we on the right way? Anyone 
> willing to help?

I'll try as time permit.

Cheers,
Ben.





More information about the xorg mailing list