[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v16 05/13] virtio-gpu: Unrealize GL device
From: |
Dmitry Osipenko |
Subject: |
[PATCH v16 05/13] virtio-gpu: Unrealize GL device |
Date: |
Sun, 23 Jun 2024 18:23:35 +0300 |
Even though GL GPU doesn't support hotplugging today, free virgl
resources when GL device is unrealized. For consistency.
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
hw/display/virtio-gpu-gl.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index 21a1e9a05c5d..0109244276fc 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -150,6 +150,22 @@ static Property virtio_gpu_gl_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static void virtio_gpu_gl_device_unrealize(DeviceState *qdev)
+{
+ VirtIOGPU *g = VIRTIO_GPU(qdev);
+ VirtIOGPUGL *gl = VIRTIO_GPU_GL(qdev);
+
+ if (gl->renderer_state >= RS_INITED) {
+ if (virtio_gpu_stats_enabled(g->parent_obj.conf)) {
+ timer_free(gl->print_stats);
+ }
+ timer_free(gl->fence_poll);
+ virgl_renderer_cleanup(NULL);
+ }
+
+ gl->renderer_state = RS_START;
+}
+
static void virtio_gpu_gl_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -163,6 +179,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass,
void *data)
vgc->update_cursor_data = virtio_gpu_gl_update_cursor_data;
vdc->realize = virtio_gpu_gl_device_realize;
+ vdc->unrealize = virtio_gpu_gl_device_unrealize;
vdc->reset = virtio_gpu_gl_reset;
device_class_set_props(dc, virtio_gpu_gl_properties);
}
--
2.45.2
- [PATCH v16 00/13] Support blob memory and venus on qemu, Dmitry Osipenko, 2024/06/23
- [PATCH v16 01/13] virtio-gpu: Use trace events for tracking number of in-flight fences, Dmitry Osipenko, 2024/06/23
- [PATCH v16 02/13] virtio-gpu: Move fence_poll timer to VirtIOGPUGL, Dmitry Osipenko, 2024/06/23
- [PATCH v16 03/13] virtio-gpu: Move print_stats timer to VirtIOGPUGL, Dmitry Osipenko, 2024/06/23
- [PATCH v16 04/13] virtio-gpu: Handle virtio_gpu_virgl_init() failure, Dmitry Osipenko, 2024/06/23
- [PATCH v16 05/13] virtio-gpu: Unrealize GL device,
Dmitry Osipenko <=
- [PATCH v16 06/13] virtio-gpu: Use pkgconfig version to decide which virgl features are available, Dmitry Osipenko, 2024/06/23
- [PATCH v16 07/13] virtio-gpu: Support context-init feature with virglrenderer, Dmitry Osipenko, 2024/06/23
- [PATCH v16 08/13] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled, Dmitry Osipenko, 2024/06/23
- [PATCH v16 09/13] virtio-gpu: Add virgl resource management, Dmitry Osipenko, 2024/06/23
- [PATCH v16 10/13] virtio-gpu: Support suspension of commands processing, Dmitry Osipenko, 2024/06/23