qemu-devel
[Top][All Lists]
Advanced

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

Re: Virtio-GPU Xres and Yres seettings


From: Gerd Hoffmann
Subject: Re: Virtio-GPU Xres and Yres seettings
Date: Mon, 20 Dec 2021 11:35:48 +0100

On Mon, Dec 20, 2021 at 09:55:00AM +0100, Philippe Mathieu-Daudé wrote:
> Cc'ing Gerd & Marc-André.
> 
> On 12/20/21 05:26, Pratik Parvati wrote:
> > Hi Team,
> > 
> > I am working on a Virtio-GPU device (backend) for one of our customer
> > projects - we are using the Virtio-GPU driver (frontend) to drive our
> > device. Our device code has been written using Qemu virtio-gpu device
> > code as a reference. Our device is setting the resolution to 1024x768 as
> > a response to the command received from the driver (i.e,
> > VIRTIO_GPU_CMD_GET_DISPLAY_INFO) - I also verified that driver is
> > receiving the response bytes properly, but the next
> > command (i.e, VIRTIO_GPU_CMD_RESOURCE_CREATE_2D) that device receive has
> > a width and height as 4096 and 2160 respectively. The driver is assuming
> > a 4k display for some reason and I need your help to understand why this
> > is happening.

Wild guess: virtio_gpu_resp_display_info.pmodes[0].enabled is false?

> > Our display is corrupted for the same Xres and Yres misunderstanding
> > between the device and the driver

Oh, the VIRTIO_GPU_CMD_GET_DISPLAY_INFO reply is just a hint for the
driver.  The driver is free to choose whatever it wants, your device
must be prepared for that.

The linux kms driver specifically returns a long list of standard modes
(including 4k) to userspace, with the resolution returned by
VIRTIO_GPU_CMD_GET_DISPLAY_INFO tagged as 'preferred'.  Typically
userspace (aka display server, aka xorg / wayland / ...) uses the
preferred resolution by default, but userspace can also pick something
else and the kernel driver will forward the request to the device.

So, it might also be the software running inside the guest which
picks 4k ...

HTH & take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]