[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] virtio-gpu: first surface update with blob scanout after res
From: |
dongwon . kim |
Subject: |
[PATCH 2/2] virtio-gpu: first surface update with blob scanout after resumed |
Date: |
Tue, 5 Mar 2024 14:22:52 -0800 |
From: Dongwon Kim <dongwon.kim@intel.com>
The guest surface needs to be updated with a blob scanout after resumed
from saved vm state if blob is enabled.
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
hw/display/virtio-gpu.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 1c1ee230b3..01bc4f9565 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -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