* Virtio-GPU Xres and Yres seettings @ 2021-12-20 4:26 Pratik Parvati 2021-12-20 8:55 ` Philippe Mathieu-Daudé 0 siblings, 1 reply; 8+ messages in thread From: Pratik Parvati @ 2021-12-20 4:26 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 940 bytes --] 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. Our display is corrupted for the same Xres and Yres misunderstanding between the device and the driver - Please guide me to understand the problem. Let me know if you have any questions or need more information. Thanks & Regards, Pratik [-- Attachment #2: Type: text/html, Size: 1799 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 4:26 Virtio-GPU Xres and Yres seettings Pratik Parvati @ 2021-12-20 8:55 ` Philippe Mathieu-Daudé 2021-12-20 10:35 ` Gerd Hoffmann 0 siblings, 1 reply; 8+ messages in thread From: Philippe Mathieu-Daudé @ 2021-12-20 8:55 UTC (permalink / raw) To: Pratik Parvati, qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann 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. > > Our display is corrupted for the same Xres and Yres misunderstanding > between the device and the driver - Please guide me to understand the > problem. Let me know if you have any questions or need more information. > > Thanks & Regards, > Pratik ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 8:55 ` Philippe Mathieu-Daudé @ 2021-12-20 10:35 ` Gerd Hoffmann 2021-12-20 12:03 ` Pratik Parvati 0 siblings, 1 reply; 8+ messages in thread From: Gerd Hoffmann @ 2021-12-20 10:35 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Marc-André Lureau, qemu-devel, Pratik Parvati 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 10:35 ` Gerd Hoffmann @ 2021-12-20 12:03 ` Pratik Parvati 2021-12-20 12:18 ` Gerd Hoffmann 0 siblings, 1 reply; 8+ messages in thread From: Pratik Parvati @ 2021-12-20 12:03 UTC (permalink / raw) To: Gerd Hoffmann Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel [-- Attachment #1: Type: text/plain, Size: 4045 bytes --] > > 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 <kraxel@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 > > [-- Attachment #2: Type: text/html, Size: 6282 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 12:03 ` Pratik Parvati @ 2021-12-20 12:18 ` Gerd Hoffmann 2021-12-20 17:14 ` Pratik Parvati 0 siblings, 1 reply; 8+ messages in thread From: Gerd Hoffmann @ 2021-12-20 12:18 UTC (permalink / raw) To: Pratik Parvati Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel Hi, > 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. EDID is optional, so you can try disable the EDID feature bit and see what happens. You can also check /sys/class/drm/card0-${output}/edid inside the guest. take care, Gerd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 12:18 ` Gerd Hoffmann @ 2021-12-20 17:14 ` Pratik Parvati 2021-12-21 11:11 ` Gerd Hoffmann 0 siblings, 1 reply; 8+ messages in thread From: Pratik Parvati @ 2021-12-20 17:14 UTC (permalink / raw) To: Gerd Hoffmann Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel [-- Attachment #1: Type: text/plain, Size: 1251 bytes --] > EDID is optional, so you can try disable the EDID feature bit and see > what happens. Thanks Gerd, after disabling the EDID, I was able to get the required resolution (basically width and height) from the driver. Another strange observation - When the device receives the command VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING with the number of entries having a pixel data in scatter gather format, the device is trying to store these bytes in contiguous memory. When I read those sg memory, the device receives all zeros from the driver (for a 1024x768 display, the device receives 3MB of data from the driver). Is this an expected behaviour? - If not, what is the driver trying to display on the screen? This is happening during linux boot on the guest machine. Thanks & Regards, Pratik On Mon, 20 Dec 2021 at 17:48, Gerd Hoffmann <kraxel@redhat.com> wrote: > Hi, > > > 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. > > EDID is optional, so you can try disable the EDID feature bit and see > what happens. > > You can also check /sys/class/drm/card0-${output}/edid inside the > guest. > > take care, > Gerd > > [-- Attachment #2: Type: text/html, Size: 2567 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-20 17:14 ` Pratik Parvati @ 2021-12-21 11:11 ` Gerd Hoffmann 2021-12-21 11:27 ` Pratik Parvati 0 siblings, 1 reply; 8+ messages in thread From: Gerd Hoffmann @ 2021-12-21 11:11 UTC (permalink / raw) To: Pratik Parvati Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel On Mon, Dec 20, 2021 at 10:44:06PM +0530, Pratik Parvati wrote: > > EDID is optional, so you can try disable the EDID feature bit and see > > what happens. > > Thanks Gerd, after disabling the EDID, I was able to get the required > resolution (basically width and height) from the driver. > > Another strange observation - When the device receives the > command VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING with the number of > entries having a pixel data in scatter gather format, the device is trying > to store these bytes in contiguous memory. When I read those sg memory, the > device receives all zeros from the driver (for a 1024x768 display, > the device receives 3MB of data from the driver). Is this an expected > behaviour? - If not, what is the driver trying to display on the screen? How about reading the virtio spec? display updates are handled with transfer and flush commands. take care, Gerd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Virtio-GPU Xres and Yres seettings 2021-12-21 11:11 ` Gerd Hoffmann @ 2021-12-21 11:27 ` Pratik Parvati 0 siblings, 0 replies; 8+ messages in thread From: Pratik Parvati @ 2021-12-21 11:27 UTC (permalink / raw) To: Gerd Hoffmann Cc: Marc-André Lureau, Philippe Mathieu-Daudé, qemu-devel [-- Attachment #1: Type: text/plain, Size: 1298 bytes --] I apologise for not putting the question properly. I am referring virtio spec to understand the driver and device operation - I had a few questions on pixel data, as it was not working as expected. My display is working fine now; thanks for your help. Regards, Pratik On Tue, 21 Dec 2021 at 16:41, Gerd Hoffmann <kraxel@redhat.com> wrote: > On Mon, Dec 20, 2021 at 10:44:06PM +0530, Pratik Parvati wrote: > > > EDID is optional, so you can try disable the EDID feature bit and see > > > what happens. > > > > Thanks Gerd, after disabling the EDID, I was able to get the required > > resolution (basically width and height) from the driver. > > > > Another strange observation - When the device receives the > > command VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING with the number of > > entries having a pixel data in scatter gather format, the device is > trying > > to store these bytes in contiguous memory. When I read those sg memory, > the > > device receives all zeros from the driver (for a 1024x768 display, > > the device receives 3MB of data from the driver). Is this an expected > > behaviour? - If not, what is the driver trying to display on the screen? > > How about reading the virtio spec? > display updates are handled with transfer and flush commands. > > take care, > Gerd > > [-- Attachment #2: Type: text/html, Size: 2253 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-21 11:31 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-12-20 4:26 Virtio-GPU Xres and Yres seettings Pratik Parvati 2021-12-20 8:55 ` Philippe Mathieu-Daudé 2021-12-20 10:35 ` Gerd Hoffmann 2021-12-20 12:03 ` Pratik Parvati 2021-12-20 12:18 ` Gerd Hoffmann 2021-12-20 17:14 ` Pratik Parvati 2021-12-21 11:11 ` Gerd Hoffmann 2021-12-21 11:27 ` Pratik Parvati
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).