[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/10] virtio-gpu: move scanout restoration to post_load
|
From: |
marcandre . lureau |
|
Subject: |
[PULL 08/10] virtio-gpu: move scanout restoration to post_load |
|
Date: |
Mon, 6 Nov 2023 17:32:17 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
As we are going to introduce an extra subsection for "blob" resources,
scanout have to be restored after.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
---
hw/display/virtio-gpu.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 8efabae7ee..26065c6466 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1267,7 +1267,6 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,
size_t size,
{
VirtIOGPU *g = opaque;
struct virtio_gpu_simple_resource *res;
- struct virtio_gpu_scanout *scanout;
uint32_t resource_id, pformat;
void *bits = NULL;
int i;
@@ -1337,6 +1336,17 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,
size_t size,
/* load & apply scanout state */
vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1);
+
+ return 0;
+}
+
+static int virtio_gpu_post_load(void *opaque, int version_id)
+{
+ VirtIOGPU *g = opaque;
+ struct virtio_gpu_scanout *scanout;
+ struct virtio_gpu_simple_resource *res;
+ int i;
+
for (i = 0; i < g->parent_obj.conf.max_outputs; i++) {
/* FIXME: should take scanout.r.{x,y} into account */
scanout = &g->parent_obj.scanout[i];
@@ -1520,6 +1530,7 @@ static const VMStateDescription vmstate_virtio_gpu = {
} /* device */,
VMSTATE_END_OF_LIST()
},
+ .post_load = virtio_gpu_post_load,
};
static Property virtio_gpu_properties[] = {
--
2.41.0
- [PULL 00/10] Gpu patches, marcandre . lureau, 2023/11/06
- [PULL 01/10] virtio-gpu-rutabaga: Add empty interface to fix arm64 crash, marcandre . lureau, 2023/11/06
- [PULL 02/10] ati-vga: Fix aperture sizes, marcandre . lureau, 2023/11/06
- [PULL 03/10] ati-vga: Support unaligned access to GPIO DDC registers, marcandre . lureau, 2023/11/06
- [PULL 04/10] ati-vga: Add 30 bit palette access register, marcandre . lureau, 2023/11/06
- [PULL 05/10] ati-vga: Implement fallback for pixman routines, marcandre . lureau, 2023/11/06
- [PULL 06/10] virtio-gpu: block migration of VMs with blob=true, marcandre . lureau, 2023/11/06
- [PULL 07/10] virtio-gpu: factor out restore mapping, marcandre . lureau, 2023/11/06
- [PULL 08/10] virtio-gpu: move scanout restoration to post_load,
marcandre . lureau <=
- [PULL 10/10] Revert "virtio-gpu: block migration of VMs with blob=true", marcandre . lureau, 2023/11/06
- [PULL 09/10] virtio-gpu: add virtio-gpu/blob vmstate subsection, marcandre . lureau, 2023/11/06
- Re: [PULL 00/10] Gpu patches, Stefan Hajnoczi, 2023/11/06