VGA arbitration: API proposal
benh at kernel.crashing.org
Fri Mar 4 18:23:30 PST 2005
> Typically, a driver could only enable IRQ generation on the card in on
> those circumstances:
> - It does have VGA decoding enabled (it called vga_set_legacy_decoding
> with no IO and no MEM decoding set). It basically puts the card out of
> the arbitration domain.
Grrr ... ok, I actually meant to write: "It does _not_ have VGA decoding
> - It does have VGA decoding enabled only for IO (decoding of the VGA
> memory aperture is disabled, that is it called vga_set_legacy_decoding
> with only IO set) and the interrupt handler doesn't need to do IO
> accesses. That is, it can afford to get interrupts while IO accesses are
> disabled in the config space (but not memory accesses).
> - It hold the VGA semaphore (vga_get) but I don't recommend this
> scenario unless the driver knows the interrupt will come very soon
> (maybe suitable for vblank waiting).
Note that this API suits well with having a /dev entry or some other
things with open/close file semantics. You can't easily track who is
holding the VGA with just echo's to sysfs. With a file descriptor, you
can track who is there, and you can properly cleanup if the process
So while it might still be a file in /sysfs, we really want to have
open()/close() callbacks in the kernel. If that is too much of a burden
for sysfs (I haven't looked), a /dev thing might be the best solution.
More information about the xorg