diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-04-30 13:35:35 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-05-10 13:55:28 +0200 |
commit | 76fa8b359b4c0c24f390ea4b788242cc627b966f (patch) | |
tree | f790e2423205e4210e6a0bc31b9efe2d8b08b143 /hw/display/virtio-gpu-gl.c | |
parent | 37f86af087397688c7de4ea4ddf05449d48e6ee0 (diff) | |
download | qemu-76fa8b359b4c0c24f390ea4b788242cc627b966f.zip qemu-76fa8b359b4c0c24f390ea4b788242cc627b966f.tar.gz qemu-76fa8b359b4c0c24f390ea4b788242cc627b966f.tar.bz2 |
virtio-gpu: move virgl reset
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20210430113547.1816178-1-kraxel@redhat.com
Message-Id: <20210430113547.1816178-5-kraxel@redhat.com>
Diffstat (limited to 'hw/display/virtio-gpu-gl.c')
-rw-r--r-- | hw/display/virtio-gpu-gl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 9b7b5f0..c3e562f 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,22 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" +static void virtio_gpu_gl_reset(VirtIODevice *vdev) +{ + VirtIOGPU *g = VIRTIO_GPU(vdev); + + virtio_gpu_reset(vdev); + + if (g->parent_obj.use_virgl_renderer) { + if (g->parent_obj.renderer_blocked) { + g->renderer_reset = true; + } else { + virtio_gpu_virgl_reset(g); + } + g->parent_obj.use_virgl_renderer = false; + } +} + static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp) { VirtIOGPU *g = VIRTIO_GPU(qdev); @@ -56,6 +72,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); vdc->realize = virtio_gpu_gl_device_realize; + vdc->reset = virtio_gpu_gl_reset; device_class_set_props(dc, virtio_gpu_gl_properties); } |