Skip to contentSkip to conversation

virtio-gpu-udmabuf: replacing scanout_width/height with backing_width/height

PATCH In review Dongwon Kim 2 participants 5 messages Jul 5, 2023 – Jul 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-gpu-udmabuf: replacing scanout_width/height with backing_width/height

'backing_width' and 'backing_height' are commonly used to indicate the size of the whole backing region so it makes sense to use those terms for VGAUDMABuf as well in place of 'scanout_width' and 'scanout_height'.

Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[email protected]>
---
 hw/display/virtio-gpu-udmabuf.c | 8 ++++----
 include/ui/console.h            | 4 ++--
 ui/dbus-listener.c              | 4 ++--
 ui/egl-helpers.c                | 4 ++--
 ui/gtk-egl.c                    | 4 ++--
 ui/gtk-gl-area.c                | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)
hw/display/virtio-gpu-udmabuf.c +4 -4
index ef1a740de5..920d457d4a 100644
@@ -186,8 +186,8 @@ static VGPUDMABuf
     dmabuf->buf.stride = fb->stride;
     dmabuf->buf.x = r->x;
     dmabuf->buf.y = r->y;
-    dmabuf->buf.scanout_width = r->width;
-    dmabuf->buf.scanout_height = r->height;
+    dmabuf->buf.backing_width = r->width;
+    dmabuf->buf.backing_height = r->height;
     dmabuf->buf.fourcc = qemu_pixman_to_drm_format(fb->format);
     dmabuf->buf.fd = res->dmabuf_fd;
     dmabuf->buf.allow_fences = true;
@@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,
 
     g->dmabuf.primary[scanout_id] = new_primary;
     qemu_console_resize(scanout->con,
-                        new_primary->buf.scanout_width,
-                        new_primary->buf.scanout_height);
+                        new_primary->buf.backing_width,
+                        new_primary->buf.backing_height);
     dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);
 
     if (old_primary) {
include/ui/console.h +2 -2
index f27b2aad4f..3e8b22d6c6 100644
@@ -201,8 +201,8 @@ typedef struct QemuDmaBuf {
     uint32_t  texture;
     uint32_t  x;
     uint32_t  y;
-    uint32_t  scanout_width;
-    uint32_t  scanout_height;
+    uint32_t  backing_width;
+    uint32_t  backing_height;
     bool      y0_top;
     void      *sync;
     int       fence_fd;
ui/dbus-listener.c +2 -2
index 0240c39510..7d73681cbc 100644
@@ -420,8 +420,8 @@ static void dbus_scanout_texture(DisplayChangeListener *dcl,
         .y0_top = backing_y_0_top,
         .x = x,
         .y = y,
-        .scanout_width = w,
-        .scanout_height = h,
+        .backing_width = w,
+        .backing_height = h,
     };
 
     assert(tex_id);
ui/egl-helpers.c +2 -2
index 8f9fbf583e..6b7be5753d 100644
@@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip)
     if (src->dmabuf) {
         x1 = src->dmabuf->x;
         y1 = src->dmabuf->y;
-        w = src->dmabuf->scanout_width;
-        h = src->dmabuf->scanout_height;
+        w = src->dmabuf->backing_width;
+        h = src->dmabuf->backing_height;
     }
 
     w = (x1 + w) > src->width ? src->width - x1 : w;
ui/gtk-egl.c +2 -2
index d59b8cd7d7..7604696d4a 100644
@@ -259,8 +259,8 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
 
     gd_egl_scanout_texture(dcl, dmabuf->texture,
                            dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                           dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                           dmabuf->scanout_height, NULL);
+                           dmabuf->x, dmabuf->y, dmabuf->backing_width,
+                           dmabuf->backing_height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
ui/gtk-gl-area.c +2 -2
index 7367dfd793..3337a4baa3 100644
@@ -300,8 +300,8 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *dcl,
 
     gd_gl_area_scanout_texture(dcl, dmabuf->texture,
                                dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                               dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                               dmabuf->scanout_height, NULL);
+                               dmabuf->x, dmabuf->y, dmabuf->backing_width,
+                               dmabuf->backing_height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
Signature · 1 line
2.34.1
#1 lore raw

Hi

Quoted 64 lines · Dongwon Kim

'backing_width' and 'backing_height' are commonly used to indicate the size of the whole backing region so it makes sense to use those terms for VGAUDMABuf as well in place of 'scanout_width' and 'scanout_height'.

Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[email protected]>
---
 hw/display/virtio-gpu-udmabuf.c | 8 ++++----
 include/ui/console.h            | 4 ++--
 ui/dbus-listener.c              | 4 ++--
 ui/egl-helpers.c                | 4 ++--
 ui/gtk-egl.c                    | 4 ++--
 ui/gtk-gl-area.c                | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)
hw/display/virtio-gpu-udmabuf.c +4 -4
index ef1a740de5..920d457d4a 100644
@@ -186,8 +186,8 @@ static VGPUDMABuf
     dmabuf->buf.stride = fb->stride;
     dmabuf->buf.x = r->x;
     dmabuf->buf.y = r->y;
-    dmabuf->buf.scanout_width = r->width;
-    dmabuf->buf.scanout_height = r->height;
+    dmabuf->buf.backing_width = r->width;
+    dmabuf->buf.backing_height = r->height;
     dmabuf->buf.fourcc = qemu_pixman_to_drm_format(fb->format);
     dmabuf->buf.fd = res->dmabuf_fd;
     dmabuf->buf.allow_fences = true;
@@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,
 
     g->dmabuf.primary[scanout_id] = new_primary;
     qemu_console_resize(scanout->con,
-                        new_primary->buf.scanout_width,
-                        new_primary->buf.scanout_height);
+                        new_primary->buf.backing_width,
+                        new_primary->buf.backing_height);
     dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);
 
     if (old_primary) {
include/ui/console.h +2 -2
index f27b2aad4f..3e8b22d6c6 100644
@@ -201,8 +201,8 @@ typedef struct QemuDmaBuf {
     uint32_t  texture;
     uint32_t  x;
     uint32_t  y;
-    uint32_t  scanout_width;
-    uint32_t  scanout_height;
+    uint32_t  backing_width;
+    uint32_t  backing_height;
     bool      y0_top;
     void      *sync;
     int       fence_fd;
ui/dbus-listener.c +0 -0
index 0240c39510..7d73681cbc 100644

ui/dbus-listener.c static void dbus_scanout_texture(DisplayChangeListener · line 426

Quoted 9 lines
ui/dbus-listener.c +2 -2
@@ -420,8 +420,8 @@ static void dbus_scanout_texture(DisplayChangeListener
 *dcl,
         .y0_top = backing_y_0_top,
         .x = x,
         .y = y,
-        .scanout_width = w,
-        .scanout_height = h,
+        .backing_width = w,
+        .backing_height = h,
 

This is not consistent with the function arguments. I think it should be after:

.width = w, .height = h, .backing_width = backing_wdth, .backing_height = backing_height

Hopefully this inconsistency is not repeated elsewhere.

thanks

Quoted 57 lines
ui/dbus-listener.c +0 -0
     };
     assert(tex_id);
ui/egl-helpers.c +2 -2
index 8f9fbf583e..6b7be5753d 100644
@@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip)
     if (src->dmabuf) {
         x1 = src->dmabuf->x;
         y1 = src->dmabuf->y;
-        w = src->dmabuf->scanout_width;
-        h = src->dmabuf->scanout_height;
+        w = src->dmabuf->backing_width;
+        h = src->dmabuf->backing_height;
     }
 
     w = (x1 + w) > src->width ? src->width - x1 : w;
ui/gtk-egl.c +2 -2
index d59b8cd7d7..7604696d4a 100644
@@ -259,8 +259,8 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
 
     gd_egl_scanout_texture(dcl, dmabuf->texture,
                            dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                           dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                           dmabuf->scanout_height, NULL);
+                           dmabuf->x, dmabuf->y, dmabuf->backing_width,
+                           dmabuf->backing_height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
ui/gtk-gl-area.c +1 -2
index 7367dfd793..3337a4baa3 100644
@@ -300,8 +300,8 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener
 *dcl,
 
     gd_gl_area_scanout_texture(dcl, dmabuf->texture,
                                dmabuf->y0_top, dmabuf->width,
 dmabuf->height,
-                               dmabuf->x, dmabuf->y,
 dmabuf->scanout_width,
-                               dmabuf->scanout_height, NULL);
+                               dmabuf->x, dmabuf->y,

dmabuf->backing_width,
+ dmabuf->backing_height, NULL);

     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;

--
2.34.1

Signature · 1 line
Marc-André Lureau
#2 lore raw
Quoted 79 lines · Marc-André Lureau

Hi

On Thu, Jul 6, 2023 at 3:10 AM Dongwon Kim <[email protected]> wrote:

    'backing_width' and 'backing_height' are commonly used to indicate
    the size
    of the whole backing region so it makes sense to use those terms for
    VGAUDMABuf as well in place of 'scanout_width' and 'scanout_height'.

    Cc: Gerd Hoffmann <[email protected]>
    Cc: Marc-André Lureau <[email protected]>
    Cc: Vivek Kasireddy <[email protected]>
    Signed-off-by: Dongwon Kim <[email protected]>
    ---
     hw/display/virtio-gpu-udmabuf.c | 8 ++++----
     include/ui/console.h            | 4 ++--
     ui/dbus-listener.c              | 4 ++--
     ui/egl-helpers.c                | 4 ++--
     ui/gtk-egl.c                    | 4 ++--
     ui/gtk-gl-area.c                | 4 ++--
     6 files changed, 14 insertions(+), 14 deletions(-)

    diff --git a/hw/display/virtio-gpu-udmabuf.c
    b/hw/display/virtio-gpu-udmabuf.c
    index ef1a740de5..920d457d4a 100644
    --- a/hw/display/virtio-gpu-udmabuf.c
    +++ b/hw/display/virtio-gpu-udmabuf.c
    @@ -186,8 +186,8 @@ static VGPUDMABuf
         dmabuf->buf.stride = fb->stride;
         dmabuf->buf.x = r->x;
         dmabuf->buf.y = r->y;
    -    dmabuf->buf.scanout_width = r->width;
    -    dmabuf->buf.scanout_height = r->height;
    +    dmabuf->buf.backing_width = r->width;
    +    dmabuf->buf.backing_height = r->height;
         dmabuf->buf.fourcc = qemu_pixman_to_drm_format(fb->format);
         dmabuf->buf.fd = res->dmabuf_fd;
         dmabuf->buf.allow_fences = true;
    @@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,

         g->dmabuf.primary[scanout_id] = new_primary;
         qemu_console_resize(scanout->con,
    -                        new_primary->buf.scanout_width,
    - new_primary->buf.scanout_height);
    +                        new_primary->buf.backing_width,
    + new_primary->buf.backing_height);
         dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);

         if (old_primary) {
    diff --git a/include/ui/console.h b/include/ui/console.h
    index f27b2aad4f..3e8b22d6c6 100644
    --- a/include/ui/console.h
    +++ b/include/ui/console.h
    @@ -201,8 +201,8 @@ typedef struct QemuDmaBuf {
         uint32_t  texture;
         uint32_t  x;
         uint32_t  y;
    -    uint32_t  scanout_width;
    -    uint32_t  scanout_height;
    +    uint32_t  backing_width;
    +    uint32_t  backing_height;
         bool      y0_top;
         void      *sync;
         int       fence_fd;
    diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
    index 0240c39510..7d73681cbc 100644
    --- a/ui/dbus-listener.c
    +++ b/ui/dbus-listener.c
    @@ -420,8 +420,8 @@ static void
    dbus_scanout_texture(DisplayChangeListener *dcl,
             .y0_top = backing_y_0_top,
             .x = x,
             .y = y,
    -        .scanout_width = w,
    -        .scanout_height = h,
    +        .backing_width = w,
    +        .backing_height = h,
Quoted 6 lines

This is not consistent with the function arguments. I think it should be after:

.width = w, .height = h, .backing_width = backing_wdth, .backing_height = backing_height

Hopefully this inconsistency is not repeated elsewhere.

Yes, you are right. Backing_* is for the whole surface. And normal width/height or w/h specifies the sub region as you mentioned earlier in all other places. Inconsistency was caused in QemuDmabuf where width/height was used as backing_width/height. We should have corrected it first. I will send another version of patch to correct this.

Quoted 67 lines

thanks

         };

         assert(tex_id);
    diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
    index 8f9fbf583e..6b7be5753d 100644
    --- a/ui/egl-helpers.c
    +++ b/ui/egl-helpers.c
    @@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src,
    bool flip)
         if (src->dmabuf) {
             x1 = src->dmabuf->x;
             y1 = src->dmabuf->y;
    -        w = src->dmabuf->scanout_width;
    -        h = src->dmabuf->scanout_height;
    +        w = src->dmabuf->backing_width;
    +        h = src->dmabuf->backing_height;
         }

         w = (x1 + w) > src->width ? src->width - x1 : w;
    diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
    index d59b8cd7d7..7604696d4a 100644
    --- a/ui/gtk-egl.c
    +++ b/ui/gtk-egl.c
    @@ -259,8 +259,8 @@ void
    gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,

         gd_egl_scanout_texture(dcl, dmabuf->texture,
                                dmabuf->y0_top, dmabuf->width,
    dmabuf->height,
    -                           dmabuf->x, dmabuf->y,
    dmabuf->scanout_width,
    -                           dmabuf->scanout_height, NULL);
    +                           dmabuf->x, dmabuf->y,
    dmabuf->backing_width,
    +                           dmabuf->backing_height, NULL);

         if (dmabuf->allow_fences) {
             vc->gfx.guest_fb.dmabuf = dmabuf;
    diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
    index 7367dfd793..3337a4baa3 100644
    --- a/ui/gtk-gl-area.c
    +++ b/ui/gtk-gl-area.c
    @@ -300,8 +300,8 @@ void
    gd_gl_area_scanout_dmabuf(DisplayChangeListener *dcl,

         gd_gl_area_scanout_texture(dcl, dmabuf->texture,
                                    dmabuf->y0_top, dmabuf->width,
    dmabuf->height,
    -                               dmabuf->x, dmabuf->y,
    dmabuf->scanout_width,
    -                               dmabuf->scanout_height, NULL);
    +                               dmabuf->x, dmabuf->y,
    dmabuf->backing_width,
    +                               dmabuf->backing_height, NULL);

         if (dmabuf->allow_fences) {
             vc->gfx.guest_fb.dmabuf = dmabuf;
    -- 
    2.34.1
Signature · 1 line
Marc-André Lureau
#3 lore raw

PATCH 1/1 virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

In reply to Marc-André Lureau

Replace 'width' and 'height' in QemuDmaBuf with 'backing_widht' and 'backing_height' as these commonly indicate the size of the whole surface (e.g. guest's Xorg extended display). Then use 'width' and 'height' for sub region in there (e.g. guest's scanouts).

Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[email protected]>
---
 hw/display/virtio-gpu-udmabuf.c | 12 ++++++------
 include/ui/console.h            |  4 ++--
 ui/dbus-listener.c              |  8 ++++----
 ui/egl-helpers.c                |  8 ++++----
 ui/gtk-egl.c                    |  8 ++++----
 ui/gtk-gl-area.c                |  6 +++---
 6 files changed, 23 insertions(+), 23 deletions(-)
hw/display/virtio-gpu-udmabuf.c +6 -6
index ef1a740de5..047758582c 100644
@@ -181,13 +181,13 @@ static VGPUDMABuf
     }
 
     dmabuf = g_new0(VGPUDMABuf, 1);
-    dmabuf->buf.width = fb->width;
-    dmabuf->buf.height = fb->height;
+    dmabuf->buf.width = r->width;
+    dmabuf->buf.height = r->height;
     dmabuf->buf.stride = fb->stride;
     dmabuf->buf.x = r->x;
     dmabuf->buf.y = r->y;
-    dmabuf->buf.scanout_width = r->width;
-    dmabuf->buf.scanout_height = r->height;
+    dmabuf->buf.backing_width = fb->width;
+    dmabuf->buf.backing_height = fb->height;;
     dmabuf->buf.fourcc = qemu_pixman_to_drm_format(fb->format);
     dmabuf->buf.fd = res->dmabuf_fd;
     dmabuf->buf.allow_fences = true;
@@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,
 
     g->dmabuf.primary[scanout_id] = new_primary;
     qemu_console_resize(scanout->con,
-                        new_primary->buf.scanout_width,
-                        new_primary->buf.scanout_height);
+                        new_primary->buf.width,
+                        new_primary->buf.height);
     dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);
 
     if (old_primary) {
include/ui/console.h +2 -2
index f27b2aad4f..3e8b22d6c6 100644
@@ -201,8 +201,8 @@ typedef struct QemuDmaBuf {
     uint32_t  texture;
     uint32_t  x;
     uint32_t  y;
-    uint32_t  scanout_width;
-    uint32_t  scanout_height;
+    uint32_t  backing_width;
+    uint32_t  backing_height;
     bool      y0_top;
     void      *sync;
     int       fence_fd;
ui/dbus-listener.c +4 -4
index 0240c39510..68ff343799 100644
@@ -415,13 +415,13 @@ static void dbus_scanout_texture(DisplayChangeListener *dcl,
                                backing_width, backing_height, x, y, w, h);
 #ifdef CONFIG_GBM
     QemuDmaBuf dmabuf = {
-        .width = backing_width,
-        .height = backing_height,
+        .width = w,
+        .height = h,
         .y0_top = backing_y_0_top,
         .x = x,
         .y = y,
-        .scanout_width = w,
-        .scanout_height = h,
+        .backing_width = backing_width,
+        .backing_height = backing_height,
     };
 
     assert(tex_id);
ui/egl-helpers.c +4 -4
index 8f9fbf583e..bc0960a9ec 100644
@@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip)
     if (src->dmabuf) {
         x1 = src->dmabuf->x;
         y1 = src->dmabuf->y;
-        w = src->dmabuf->scanout_width;
-        h = src->dmabuf->scanout_height;
+        w = src->dmabuf->width;
+        h = src->dmabuf->height;
     }
 
     w = (x1 + w) > src->width ? src->width - x1 : w;
@@ -314,9 +314,9 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
     }
 
     attrs[i++] = EGL_WIDTH;
-    attrs[i++] = dmabuf->width;
+    attrs[i++] = dmabuf->backing_width;
     attrs[i++] = EGL_HEIGHT;
-    attrs[i++] = dmabuf->height;
+    attrs[i++] = dmabuf->backing_height;;
     attrs[i++] = EGL_LINUX_DRM_FOURCC_EXT;
     attrs[i++] = dmabuf->fourcc;
 
ui/gtk-egl.c +4 -4
index d59b8cd7d7..a37ad6c9db 100644
@@ -258,9 +258,9 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
     }
 
     gd_egl_scanout_texture(dcl, dmabuf->texture,
-                           dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                           dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                           dmabuf->scanout_height, NULL);
+                           dmabuf->y0_top, dmabuf->backing_width, dmabuf->backing_height,
+                           dmabuf->x, dmabuf->y, dmabuf->width,
+                           dmabuf->height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
@@ -280,7 +280,7 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl,
         if (!dmabuf->texture) {
             return;
         }
-        egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->width, dmabuf->height,
+        egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->backing_width, dmabuf->backing_height,
                              dmabuf->texture, false);
     } else {
         egl_fb_destroy(&vc->gfx.cursor_fb);
ui/gtk-gl-area.c +3 -3
index 7367dfd793..ea3d50598e 100644
@@ -299,9 +299,9 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *dcl,
     }
 
     gd_gl_area_scanout_texture(dcl, dmabuf->texture,
-                               dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                               dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                               dmabuf->scanout_height, NULL);
+                               dmabuf->y0_top, dmabuf->backing_width, dmabuf->backing_height,
+                               dmabuf->x, dmabuf->y, dmabuf->width,
+                               dmabuf->height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#4 lore raw

Re: [PATCH] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

Quoted 11 lines · Dongwon Kim

Replace 'width' and 'height' in QemuDmaBuf with 'backing_widht' and 'backing_height' as these commonly indicate the size of the whole surface (e.g. guest's Xorg extended display). Then use 'width' and 'height' for sub region in there (e.g. guest's scanouts).

Cc Gerd Hoffmann <[email protected]>
Cc Marc-André Lureau <[email protected]>
Cc Vivek Kasireddy <[email protected]>
Quoted 163 lines
---
 hw/display/virtio-gpu-udmabuf.c | 12 ++++++------
 include/ui/console.h            |  4 ++--
 ui/dbus-listener.c              |  8 ++++----
 ui/egl-helpers.c                |  8 ++++----
 ui/gtk-egl.c                    |  8 ++++----
 ui/gtk-gl-area.c                |  6 +++---
 6 files changed, 23 insertions(+), 23 deletions(-)
hw/display/virtio-gpu-udmabuf.c +6 -6
index ef1a740de5..047758582c 100644
@@ -181,13 +181,13 @@ static VGPUDMABuf
     }
 
     dmabuf = g_new0(VGPUDMABuf, 1);
-    dmabuf->buf.width = fb->width;
-    dmabuf->buf.height = fb->height;
+    dmabuf->buf.width = r->width;
+    dmabuf->buf.height = r->height;
     dmabuf->buf.stride = fb->stride;
     dmabuf->buf.x = r->x;
     dmabuf->buf.y = r->y;
-    dmabuf->buf.scanout_width = r->width;
-    dmabuf->buf.scanout_height = r->height;
+    dmabuf->buf.backing_width = fb->width;
+    dmabuf->buf.backing_height = fb->height;;
     dmabuf->buf.fourcc = qemu_pixman_to_drm_format(fb->format);
     dmabuf->buf.fd = res->dmabuf_fd;
     dmabuf->buf.allow_fences = true;
@@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g,
 
     g->dmabuf.primary[scanout_id] = new_primary;
     qemu_console_resize(scanout->con,
-                        new_primary->buf.scanout_width,
-                        new_primary->buf.scanout_height);
+                        new_primary->buf.width,
+                        new_primary->buf.height);
     dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);
 
     if (old_primary) {
include/ui/console.h +2 -2
index f27b2aad4f..3e8b22d6c6 100644
@@ -201,8 +201,8 @@ typedef struct QemuDmaBuf {
     uint32_t  texture;
     uint32_t  x;
     uint32_t  y;
-    uint32_t  scanout_width;
-    uint32_t  scanout_height;
+    uint32_t  backing_width;
+    uint32_t  backing_height;
     bool      y0_top;
     void      *sync;
     int       fence_fd;
ui/dbus-listener.c +4 -4
index 0240c39510..68ff343799 100644
@@ -415,13 +415,13 @@ static void
 dbus_scanout_texture(DisplayChangeListener *dcl,
                                backing_width, backing_height, x, y, w, h);
 #ifdef CONFIG_GBM
     QemuDmaBuf dmabuf = {
-        .width = backing_width,
-        .height = backing_height,
+        .width = w,
+        .height = h,
         .y0_top = backing_y_0_top,
         .x = x,
         .y = y,
-        .scanout_width = w,
-        .scanout_height = h,
+        .backing_width = backing_width,
+        .backing_height = backing_height,
     };
 
     assert(tex_id);
ui/egl-helpers.c +4 -4
index 8f9fbf583e..bc0960a9ec 100644
@@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip)
     if (src->dmabuf) {
         x1 = src->dmabuf->x;
         y1 = src->dmabuf->y;
-        w = src->dmabuf->scanout_width;
-        h = src->dmabuf->scanout_height;
+        w = src->dmabuf->width;
+        h = src->dmabuf->height;
     }
 
     w = (x1 + w) > src->width ? src->width - x1 : w;
@@ -314,9 +314,9 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
     }
 
     attrs[i++] = EGL_WIDTH;
-    attrs[i++] = dmabuf->width;
+    attrs[i++] = dmabuf->backing_width;
     attrs[i++] = EGL_HEIGHT;
-    attrs[i++] = dmabuf->height;
+    attrs[i++] = dmabuf->backing_height;;
     attrs[i++] = EGL_LINUX_DRM_FOURCC_EXT;
     attrs[i++] = dmabuf->fourcc;
 
ui/gtk-egl.c +3 -3
index d59b8cd7d7..a37ad6c9db 100644
@@ -258,9 +258,9 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
     }
 
     gd_egl_scanout_texture(dcl, dmabuf->texture,
-                           dmabuf->y0_top, dmabuf->width, dmabuf->height,
-                           dmabuf->x, dmabuf->y, dmabuf->scanout_width,
-                           dmabuf->scanout_height, NULL);
+                           dmabuf->y0_top, dmabuf->backing_width,
 dmabuf->backing_height,
+                           dmabuf->x, dmabuf->y, dmabuf->width,
+                           dmabuf->height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
ui/gtk-egl.c +1 -1
@@ -280,7 +280,7 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl,
         if (!dmabuf->texture) {
             return;
         }
-        egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->width,
 dmabuf->height,
+        egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->backing_width,
 dmabuf->backing_height,
                              dmabuf->texture, false);
     } else {
         egl_fb_destroy(&vc->gfx.cursor_fb);
ui/gtk-gl-area.c +1 -3
index 7367dfd793..ea3d50598e 100644
@@ -299,9 +299,9 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener
 *dcl,
     }
 
     gd_gl_area_scanout_texture(dcl, dmabuf->texture,
-                               dmabuf->y0_top, dmabuf->width,
 dmabuf->height,
-                               dmabuf->x, dmabuf->y,
 dmabuf->scanout_width,
-                               dmabuf->scanout_height, NULL);
+                               dmabuf->y0_top, dmabuf->backing_width,

dmabuf->backing_height,

ui/gtk-gl-area.c +2 -1
+                               dmabuf->x, dmabuf->y, dmabuf->width,
+                               dmabuf->height, NULL);
 
     if (dmabuf->allow_fences) {
         vc->gfx.guest_fb.dmabuf = dmabuf;
--

2.20.1

Signature · 1 line
Marc-André Lureau