[PATCH] xf86VGAarbiter,vgaHW: Only wrap co-operating VGA drivers

Mark Kettenis mark.kettenis at xs4all.nl
Fri Sep 13 04:40:51 PDT 2013


> Date: Fri, 13 Sep 2013 11:09:45 +0100
> From: Chris Wilson <chris at chris-wilson.co.uk>
> 
> On Fri, Sep 13, 2013 at 11:56:26AM +0200, Mark Kettenis wrote:
> > Wouldn't it make sense to move all arbitration for KMS devices into
> > the kernel?  For the broken intel devices that can't turn off legacy
> > VGA access completely you'd then have the kernel report that it
> > doesn't need any legacy resources such that the X server would skip
> > the lock/unlock for that device.  But you'd still include it in the
> > number of devices such that wrapping would happen and the driver for
> > the non-KMS devices would still participate in arbitration in the
> > traditional way.
> 
> The arbitration is in the kernel. X is simply requesting from the kernel
> VGA access around every operation irrespective of whether the driver
> requires device access (let alone VGA access) for that operation.

Not quite.  The code in libpciaccess that actually implements the
OS-specific bits of the arbitration interface only passes through the
requests if the kernel indicates that the device needs arbitration.

> X also disables DRI if the kernel reports there is more than one VGA
> device in the system.

Again, not quite true.  It will happily do DRI for devices for which
the kernel reports it doesn't need VGA legacy access.  Works (mostly)
fine for radeon KMS, at least on OpenBSD-current.

Anyway, what I'm trying to say is that the kernel could indicate to
libpciaccess that no arbitration is needed/wanted for devices managed
by the intel KMS driver, since it doesn't allow direct access to the
hardware in the first place.

> > This would also fix situations where you have for example a Wayland
> > Compositor running on your KMS device, but still want to run an X
> > server on the VGA device.
> 
> Wayland (i.e. each wayland client) would need to learn a lot more about
> the realities of hw before it is able to cooperate, in the same way as
> unblocking DRI requires moving the vgaarb handling into each DRI client.

That would be the wrong model.  In the end, only the kernel has a
complete picture.  And since clients only have access to the hardware
through the kernel anyway, the kernel can actually do the full
arbitration enabling legacy VGA access when necessary instead of
relying on the clients to do this.


More information about the xorg-devel mailing list