RfC: vfio: add vgpu edid support?

Zhenyu Wang zhenyuw at linux.intel.com
Mon Sep 10 09:37:09 UTC 2018


On 2018.09.07 16:05:15 +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> I consider adding EDID support to qemu, for display configuration.
> 
> qemu patches are here:
>     https://git.kraxel.org/cgit/qemu/log/?h=sirius/edid
> 
> linux kernel patches are here:
>     https://git.kraxel.org/cgit/linux/log/?h=edid
> 
> Current (experimental) patches have support for the stdvga and
> virtio-vga.
> 
> I think it would be quite useful for vgpu too.  Unlike emulated devices
> vgpu's do not have a paravirtual display configuration path, because the
> standard way to configure the display is to simply read the edid from
> the monitor.
> 
> Intel has two hard-coded edid blobs for that (depending on vgpu type).
> Not sure how nvidia handles this, but probably simliar.  With qemu
> passing a edid blob for the virtual display instead of using the
> hardcoded blob we could make the display configuration much more
> flexible.
> 
> Ideally qemu would also be able to update the edid blob at any time, and
> the vgpu will notify the guest about it (probably by emulating a monitor
> hotplug event).  The guest can react on qemu window resizing then and
> adapt automatically, simliar to how it works with qxl and virtio-gpu.

What's the frequency for those edid update during resizing? Looks it's
possible to bring hotplug storm that I'm not sure if all guest drivers
for gvt has proper handling.

> 
> The guest and the vgpu should be able to handle "odd" non-standard
> display resolutions like this (coming from random window resizing):
> 
>    Detailed mode: Clock 106.620 MHz, 477 mm x 330 mm
>                   1212 1515 1551 1636 hborder 0
>                    840  844  848  869 vborder 0
>                   -hsync -vsync 
>                   VertFreq: 74 Hz, HorFreq: 65171 Hz
>

Some odd timing might not be supported, e.g can't get a sane PLL setting
calculation for clock required. As gvt exposes a virtual display pipeline
following hw definition, so guest driver still depend on sane output, I
think that may just go wrong with arbitrary mode..

> +/**
> + * VFIO_DEVICE_GFX_EDID_SET - _IOW(VFIO_TYPE, VFIO_BASE + 18,
> + *                                 struct vfio_device_gfx_edid_set)
> + *
> + * Set edid blob.
> + *
> + * Should trigger monitor hotplug emulation, to notifiy the guest os
> + * that the edid has changed.
> + *
> + */
> +struct vfio_device_gfx_edid_set {
> +	__u32 argsz;
> +	__u32 flags;
> +	/* in */
> +	__u8  edid[256];
> +};
> +

I assume you have defined return value for the set too right? In case
for driver can't handle or invalid edid blob, etc.

> +#define VFIO_DEVICE_GFX_EDID_SET _IO(VFIO_TYPE, VFIO_BASE + 18)
> +
>  /* -------- API for Type1 VFIO IOMMU -------- */
>  
>  /**
> -- 
> 2.9.3
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20180910/77a7e343/attachment.sig>


More information about the intel-gvt-dev mailing list