Skip to contentSkip to conversation

vhost-user-gpu: fix import of DMABUF

PATCH Superseded [email protected] 3 participants 3 messages Apr 15, 2024 – Apr 16, 2024

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-user-gpu: fix import of DMABUF

From: Marc-André Lureau <[email protected]>

When using vhost-user-gpu with GL, qemu -display gtk doesn't show output and prints: qemu: eglCreateImageKHR failed

Since commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties"), egl_dmabuf_import_texture() uses backing_{width,height} for the texture dimension.

Fixes commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties")
---
 hw/display/vhost-user-gpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/vhost-user-gpu.c +2 -2
index 709c8a02a1..baffb1c2d4 100644
@@ -273,8 +273,8 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUserGpuMsg *msg)
         }
         *dmabuf = (QemuDmaBuf) {
             .fd = fd,
-            .width = m->fd_width,
-            .height = m->fd_height,
+            .backing_width = m->fd_width,
+            .backing_height = m->fd_height,
             .stride = m->fd_stride,
             .fourcc = m->fd_drm_fourcc,
             .y0_top = m->fd_flags & VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP,
Signature · 1 line
2.41.0.28.gd7d8841f67
#1 lore raw

Hi Marc-André,

Quoted 30 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, April 15, 2024 4:16 AM
To: [email protected]
Cc: Kim, Dongwon <[email protected]>; [email protected]; Marc- André Lureau <[email protected]>; Michael S. Tsirkin <[email protected]>; Gerd Hoffmann <[email protected]>
Subject: [PATCH] vhost-user-gpu: fix import of DMABUF

From: Marc-André Lureau <[email protected]>

When using vhost-user-gpu with GL, qemu -display gtk doesn't show output and
prints: qemu: eglCreateImageKHR failed

Since commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties"), egl_dmabuf_import_texture() uses backing_{width,height} for the texture dimension.

Fixes commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf

size properties")

---
 hw/display/vhost-user-gpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/vhost-user-gpu.c index renamed from hw/display/vhost-user-gpu.c +0 -0

709c8a02a1..baffb1c2d4 100644

hw/display/vhost-user-gpu.c vhost_user_gpu_handle_display(VhostUserGPU *g, · line 278

Quoted 6 lines
hw/display/vhost-user-gpu.c +0 -2
@@ -273,8 +273,8 @@ vhost_user_gpu_handle_display(VhostUserGPU *g,
 VhostUserGpuMsg *msg)
         }
         *dmabuf = (QemuDmaBuf) {
             .fd = fd,
-            .width = m->fd_width,
-            .height = m->fd_height,

[Kim, Dongwon] I think we could just leave .width/.height setting here although nothing will go wrong in any cases. Did you have any specific reason why leaving these uninitialized?

Quoted 7 lines
hw/display/vhost-user-gpu.c +2 -0
+            .backing_width = m->fd_width,
+            .backing_height = m->fd_height,
             .stride = m->fd_stride,
             .fourcc = m->fd_drm_fourcc,
             .y0_top = m->fd_flags & VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP,

--
2.41.0.28.gd7d8841f67

#2 lore raw

Hi

Quoted 28 lines · Dongwon

Hi Marc-André,

Quoted 25 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, April 15, 2024 4:16 AM
To: [email protected]
Cc: Kim, Dongwon <[email protected]>; [email protected]; Marc- André Lureau <[email protected]>; Michael S. Tsirkin <[email protected]>; Gerd Hoffmann <[email protected]>
Subject: [PATCH] vhost-user-gpu: fix import of DMABUF

From: Marc-André Lureau <[email protected]>

When using vhost-user-gpu with GL, qemu -display gtk doesn't show output and
prints: qemu: eglCreateImageKHR failed

Since commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties"), egl_dmabuf_import_texture() uses backing_{width,height} for the texture dimension.

Fixes commit 9ac06df8b ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf

size properties")

---
 hw/display/vhost-user-gpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 13 lines

hw/display/vhost-user-gpu.c vhost_user_gpu_handle_display(VhostUserGPU *g, · line 278

Quoted 11 lines
hw/display/vhost-user-gpu.c index renamed from hw/display/vhost-user-gpu.c +0 -0

709c8a02a1..baffb1c2d4 100644

hw/display/vhost-user-gpu.c +0 -2
@@ -273,8 +273,8 @@ vhost_user_gpu_handle_display(VhostUserGPU *g,
 VhostUserGpuMsg *msg)
         }
         *dmabuf = (QemuDmaBuf) {
             .fd = fd,
-            .width = m->fd_width,
-            .height = m->fd_height,

[Kim, Dongwon] I think we could just leave .width/.height setting here although nothing will go wrong in any cases. Did you have any specific reason why leaving these uninitialized?

Good point. In fact, there are even dedicated fields for width/height. Fixed in v2.

thanks

Signature · 1 line
Marc-André Lureau