[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/24] virtio-gpu: avoid re-entering cmdq processing
From: |
Gerd Hoffmann |
Subject: |
[PULL 21/24] virtio-gpu: avoid re-entering cmdq processing |
Date: |
Fri, 5 Feb 2021 07:56:17 +0100 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The next patch will notify the GL context got flush, which will resume
the queue processing. However, if this happens within the caller
context, it will end up with a stack overflow flush/update loop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210204105232.834642-18-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/virtio/virtio-gpu.h | 1 +
hw/display/virtio-gpu.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 4f3dbf79f9bc..0043268e9021 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -148,6 +148,7 @@ struct VirtIOGPU {
uint64_t hostmem;
+ bool processing_cmdq;
bool renderer_inited;
bool renderer_reset;
QEMUTimer *fence_poll;
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 0e833a462bae..7eb4265a6da7 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -814,6 +814,10 @@ void virtio_gpu_process_cmdq(VirtIOGPU *g)
{
struct virtio_gpu_ctrl_command *cmd;
+ if (g->processing_cmdq) {
+ return;
+ }
+ g->processing_cmdq = true;
while (!QTAILQ_EMPTY(&g->cmdq)) {
cmd = QTAILQ_FIRST(&g->cmdq);
@@ -843,6 +847,7 @@ void virtio_gpu_process_cmdq(VirtIOGPU *g)
g_free(cmd);
}
}
+ g->processing_cmdq = false;
}
static void virtio_gpu_gl_unblock(VirtIOGPUBase *b)
--
2.29.2
- [PULL 15/24] ui: add an optional get_flags callback to GraphicHwOps, (continued)
- [PULL 15/24] ui: add an optional get_flags callback to GraphicHwOps, Gerd Hoffmann, 2021/02/05
- [PULL 07/24] vhost-user-gpu: use an extandable state enum for commands, Gerd Hoffmann, 2021/02/05
- [PULL 11/24] ui: add gd_gl_area_scanout_disable, Gerd Hoffmann, 2021/02/05
- [PULL 17/24] ui: check hw requirements during DCL registration, Gerd Hoffmann, 2021/02/05
- [PULL 23/24] chardev: check if the chardev is registered for yanking, Gerd Hoffmann, 2021/02/05
- [PULL 10/24] ui: remove gl_ctx_get_current, Gerd Hoffmann, 2021/02/05
- [PULL 24/24] tests: add some virtio-gpu & vhost-user-gpu acceptance test, Gerd Hoffmann, 2021/02/05
- [PULL 18/24] ui: add qemu_egl_has_dmabuf helper, Gerd Hoffmann, 2021/02/05
- [PULL 16/24] ui: add a DCLOps callback to check dmabuf support, Gerd Hoffmann, 2021/02/05
- [PULL 06/24] vhost-user-gpu: handle vhost-user-gpu features in a callback, Gerd Hoffmann, 2021/02/05
- [PULL 21/24] virtio-gpu: avoid re-entering cmdq processing,
Gerd Hoffmann <=
- [PULL 22/24] display/ui: add a callback to indicate GL state is flushed, Gerd Hoffmann, 2021/02/05
- [PULL 05/24] vhost-user-gpu: check backend for EDID support, Gerd Hoffmann, 2021/02/05
- [PULL 19/24] ui: check gtk-egl dmabuf support, Gerd Hoffmann, 2021/02/05
- [PULL 20/24] ui: add egl dmabuf import to gtkglarea, Gerd Hoffmann, 2021/02/05
- Re: [PULL 00/24] Vga ui 20210205 patches, Peter Maydell, 2021/02/05