Re: [PATCH linux vdagent] Add POC for getting xrandr output from monitor ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hi,

> Also, can you respond to Frediano's comments below about e.g. HDMI-A,
> etc? As far as I can tell, libdrm doesn't really give us a canonical
> name for the output, it only gives us a connection type enumeration. I
> borrowed a function from your drminfo utility to construct an output
> name, but that doesn't seem to perfectly match the xrandr output names.

xrandr names come from the driver, so maybe take the table from the
modesetting driver instead.

> > The POC is pretty long but mostly the issue seems that the Xorg names
> > are "inspired" and not derived from DRM. I said inspired because it
> > seems every Xorg driver is able to register whatever name they want,
> > is just that usually they use DRM information.

Yep.  Most hardware is handled by the modesetting driver these days.

qxl will continue to use its own driver, which is needed for multihead
support.  The modesetting driver can handle qxl too, but only in single
head mode.  For multihead it would try to use one framebuffer per
monitor, simliar to wayland.

And, yes, the qxl driver shifts output numbering by one (qxl_drmmode.c):

        /* need to do smart conversion here for compat with non-kms ATI driver */
        snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id - 1);

The comment looks like this was simply cut&pasted from another driver,
which has this for reasons not applying to qxl.  So maybe we should
simply change that in the qxl driver ...

> > In the code there are manually adjustment for:
> > - Virtual-XX outputs starting from 0 instead of 1 (like kernel
> > names);

... even though it probably doesn't remove the need for this quirk.

> > > $ ./src/get-xrandr-output 0000:00:02.0 0
> > > Device /dev/dri/card0 is at ../../../0000:00:02.0
> > > DRM connector for monitor 0:	name=eDP-1 id=71 (*CONNECTED*)
> > >     Found matching X Output:	name=eDP-1 id=114 (*CONNECTED*)
> > > 
> > 
> > I though the format of the PCI ID was different (a long string with
> > all the path), are we going to have a function to extract this new
> > "PCI address" from the PCI ID we discussed?

Yes, you get something like "pci/0000/02.0" (or longer in case
pci-bridges are in the path).  So you can search that in sysfs,
or walk all drm devices and compare.  The matching sysfs path
would be this:

/sys/devices/pci0000:00/0000:00:02.0/drm/card0
                ^^^^            ^^^^
In case of virtio there will be another path element, like this:

/sys/devices/pci0000:00/0000:00:02.0/virtio4/drm/card0

Don't become confused by this.

> > This does not support different order of detecting card, the array
> > should be scan
> > in advance to check if given name starts with 0 or 1, would be better
> > to check
> > for every name, not just QXL.

See above.  Add a special case for qxl is fine I think.

cheers,
  Gerd

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]