[Spice-devel] [RFC linux vdagent] Add POC for getting xrandr output from monitor ID
Gerd Hoffmann
kraxel at redhat.com
Tue Nov 13 11:44:34 UTC 2018
On Tue, Nov 13, 2018 at 11:21:26AM +0100, Lukáš Hrázký wrote:
> Hi,
>
> On Tue, 2018-11-13 at 09:04 +0100, Gerd Hoffmann wrote:
> > Hi,
> >
> > > To look up a PCI device by address, I could use the /sys filesystem. So
> > > for pci/0000/02.0, I would translate the domain 0000 into the
> > > filesystem path '/sys/devices/pci0000:00/' assuming bus '00'? And then
> > > look inside that directory for the the path '0000:00:02.0'. And then
> > > look for a path named 'drm' within that directory to determine whether
> > > it's a drm card or not? Is the existence of the 'drm' directory the
> > > thing that we should use to determine whether this is a drm card?
> >
> > Typically yes, except virtio-gpu which has an additional virtio level,
> > i.e. /sys/devices/pci0000:00/0000:00:02.0/virtio<n>/drm.
>
> Why the exception? Doesn't make this check look that great and
> reliable...
All virtio devices have that, due to the separation between virtio and
transport (which can be pci, mmio, ccw, maybe others too).
cheers,
Gerd
More information about the Spice-devel
mailing list