> > 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?
virtio_gpu_resp_display_info.pmodes[0].enabled is true, I have verified this. > > > 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 ... Is it possible that EDID bytes are sent wrong to the driver (as a response to VIRTIO_GPU_CMD_GET_EDID command)?? - I am configuring these bytes the same way Qemu does. Thanks for Quick response. Regards, Pratik Regards, Pratik On Mon, 20 Dec 2021 at 16:06, Gerd Hoffmann <kra...@redhat.com> wrote: > 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 > >