virtio-gpu: first surface update with blob scanout after resumed
PATCH v2 1/1 virtio-gpu: first surface update with blob scanout after resumed
From: Dongwon Kim <[email protected]>
The guest surface needs to be updated with a blob scanout after resumed from saved vm state if blob is enabled.
v2: Rebased
--- hw/display/virtio-gpu.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
hw/display/virtio-gpu.c +14 -7
@@ -1422,16 +1422,23 @@ static int virtio_gpu_post_load(void *opaque, int version_id)if (!res) {return -EINVAL ; } - scanout->ds =qemu_create_displaysurface_pixman (res->image); -if (!scanout->ds) { -return -EINVAL ; - } + +if (res->blob_size) { +assert (g->dmabuf.primary[i] !=NULL ); + g->dmabuf.primary[i]->buf.fd = res->dmabuf_fd; +dpy_gl_scanout_dmabuf (scanout->con, &g->dmabuf.primary[i]->buf); + }else { + scanout->ds =qemu_create_displaysurface_pixman (res->image); +if (!scanout->ds) { +return -EINVAL ; + }#ifdef WIN32 -qemu_displaysurface_win32_set_handle (scanout->ds, res->handle,0 ); +qemu_displaysurface_win32_set_handle (scanout->ds, res->handle,0 );#endif +dpy_gfx_replace_surface (scanout->con, scanout->ds); +dpy_gfx_update_full (scanout->con); + } -dpy_gfx_replace_surface (scanout->con, scanout->ds); -dpy_gfx_update_full (scanout->con);if (scanout->cursor.resource_id) {update_cursor (g, &scanout->cursor); }
Signature · 1 line
2.34.1
Hi
Quoted 8 lines · On Thu, Mar 7, 2024 at 2:27 AM <[email protected]> wrote:
From: Dongwon Kim <[email protected]>
The guest surface needs to be updated with a blob scanout after resumed from saved vm state if blob is enabled.
v2: Rebased
This patch conflicts with the already reviewed (and almost in queue)
patch from https://patchew.org/QEMU/[email protected]/[email protected]/.
There are chances that it solves your problem, since it calls into virtio_gpu_do_set_scanout() which handles blob resources.
Could you check? And if it doesn't fix it, can you apply your solution on top of it?
thanks
Quoted 46 lines
Cc Marc-André Lureau <[email protected]>Cc Vivek Kasireddy <[email protected]>Signed-off-by Dongwon Kim <[email protected]>--- hw/display/virtio-gpu.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)hw/display/virtio-gpu.c +14
-8@@ -1422,16 +1422,23 @@ static int virtio_gpu_post_load(void *opaque, int version_id)if (!res) {return -EINVAL ; } - scanout->ds =qemu_create_displaysurface_pixman (res->image); -if (!scanout->ds) { -return -EINVAL ; - } + +if (res->blob_size) { +assert (g->dmabuf.primary[i] !=NULL ); + g->dmabuf.primary[i]->buf.fd = res->dmabuf_fd; +dpy_gl_scanout_dmabuf (scanout->con, &g->dmabuf.primary[i]->buf); + }else { + scanout->ds =qemu_create_displaysurface_pixman (res->image); +if (!scanout->ds) { +return -EINVAL ; + }#ifdef WIN32 -qemu_displaysurface_win32_set_handle (scanout->ds, res->handle,0 ); +qemu_displaysurface_win32_set_handle (scanout->ds, res->handle,0 );#endif +dpy_gfx_replace_surface (scanout->con, scanout->ds); +dpy_gfx_update_full (scanout->con); + } -dpy_gfx_replace_surface (scanout->con, scanout->ds); -dpy_gfx_update_full (scanout->con);if (scanout->cursor.resource_id) {update_cursor (g, &scanout->cursor); } --2.34.1
Signature · 1 line
Marc-André Lureau
Hi Marc-André,
Ok, seems like your commit would fix the problem I was trying to solve. I will test it and let you know the results.
Quoted 84 lines
-----Original Message-----
From: Marc-André Lureau <[email protected]>
Sent: Tuesday, March 12, 2024 4:35 AM
To: Kim, Dongwon <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2] virtio-gpu: first surface update with blob scanout after resumedHi
Quoted 8 lines · On Thu, Mar 7, 2024 at 2:27 AM <[email protected]> wrote:
From: Dongwon Kim <[email protected]>
The guest surface needs to be updated with a blob scanout after resumed from saved vm state if blob is enabled.
v2: Rebased
This patch conflicts with the already reviewed (and almost in queue) patch from
https://patchew.org/QEMU/20240228122323.962826-1-
[email protected]/20240228122323.962826-3- [email protected]/.There are chances that it solves your problem, since it calls into
virtio_gpu_do_set_scanout()which handles blob resources.Could you check? And if it doesn't fix it, can you apply your solution on top of it?
thanks
hw/display/virtio-gpu.c static int virtio_gpu_post_load(void *opaque, int
Quoted 12 lines
Cc Marc-André Lureau <[email protected]>Cc Vivek Kasireddy <[email protected]>Signed-off-by Dongwon Kim <[email protected]>--- hw/display/virtio-gpu.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)hw/display/virtio-gpu.c index renamed from hw/display/virtio-gpu.c +0
-0
1c1ee230b3..01bc4f9565100644hw/display/virtio-gpu.c +0
-0@@ -1422,16 +1422,23 @@ static int virtio_gpu_post_load(void *opaque, int
version_id)Quoted 32 lines
hw/display/virtio-gpu.c +15
-8if (!res) {return -EINVAL ; } - scanout->ds =qemu_create_displaysurface_pixman (res->image); -if (!scanout->ds) { -return -EINVAL ; - } + +if (res->blob_size) { +assert (g->dmabuf.primary[i] !=NULL ); + g->dmabuf.primary[i]->buf.fd = res->dmabuf_fd; +dpy_gl_scanout_dmabuf (scanout->con, &g->dmabuf.primary[i]->buf); + }else { + scanout->ds =qemu_create_displaysurface_pixman (res->image); +if (!scanout->ds) { +return -EINVAL ; + }#ifdef WIN32 -qemu_displaysurface_win32_set_handle (scanout->ds, res->handle,0 ); +qemu_displaysurface_win32_set_handle (scanout->ds, + res->handle,0 );#endif +dpy_gfx_replace_surface (scanout->con, scanout->ds); +dpy_gfx_update_full (scanout->con); + } -dpy_gfx_replace_surface (scanout->con, scanout->ds); -dpy_gfx_update_full (scanout->con);if (scanout->cursor.resource_id) {update_cursor (g, &scanout->cursor); } --Quoted 3 lines
2.34.1
--
Marc-André Lureau