VGA arbitration: API proposal
Egbert Eich
eich at suse.de
Sat Mar 5 13:53:04 PST 2005
Alan Cox writes:
> On Sad, 2005-03-05 at 04:46, Jon Smirl wrote:
> > mark all drivers as VGA or not
> > only allow a single card in the system that is marked as requiring VGA
> > require fbdev/fbcon on the non-VGA cards
>
> Why ?
>
> > if there is a second VGA required card, print a big message and refuse to boot
> > discourage any further writing of code that uses VGA
>
> Doesn't work in the real world.
>
> There is a fairly easy vga API for the kernel and I proposed pretty much
> that with the vga class driver stuff I sent folks to play with.
>
> All you actually need is
>
> /* Caller must ensure devices are VGA */
> vga_conflicts(struct pci_dev *card1, struct pci_dev *card2)
> vga_set_routing(struct pci_dev *card)
>
> That is sufficient to encapsulate the low level wonders of the system.
> PC
> class devices have a vga_conflicts of "return 1" while the SGI's can do
> smarter stuff. For most platforms vga_set_routing() becomes a pci
> library call to shared code.
That's not unsimilar to the sematic we have in X. Just that
we do a
resource_conflicts(resource_type, state, card) to see if 'card' has any
resource conflict for a resource of 'type' during 'setup' or 'operating'
state.
Furthermore we can do a vga_set_routing(NULL) to disable VGA routing
to any bus.
>
> At the higher level there are some small complexities I can find no way
> to hide, one of which is that if one VGA device is locked in use you
> must be very very careful if and where you sleep waiting for VGA
> control. The practicalities of multiple kernel side vga consoles for
> example are unpleasant.
Right.
Egbert.
More information about the xorg
mailing list