virtio-gpu: avoid re-entering cmdq processing
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>
This commit is contained in:
parent
2606519b74
commit
f8f3c2719e
@ -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)
|
||||
|
@ -148,6 +148,7 @@ struct VirtIOGPU {
|
||||
|
||||
uint64_t hostmem;
|
||||
|
||||
bool processing_cmdq;
|
||||
bool renderer_inited;
|
||||
bool renderer_reset;
|
||||
QEMUTimer *fence_poll;
|
||||
|
Loading…
Reference in New Issue
Block a user