virtio-gpu-gl: initialise the deferred flag on every popped command

3bdba2ae2e added virtio_gpu_ctrl_command.deferred and cleared it in
virtio_gpu_handle_ctrl, but the GL device pops commands through
virtio_gpu_gl_handle_ctrl, which never set it.  virtqueue_pop allocates
with g_malloc, so the flag held leftover heap bytes: a command that
landed on a non-zero byte was processed, then taken off cmdq as deferred
and never answered or freed.

The guest sees those as commands that never complete.  On Windows a lost
CREATE_BLOB reply made the KMD retry the id ("resource already exists
25"), and lost unref/fence replies hung shutdown on the "Restarting"
screen (34 unanswered descriptors, empty cmdq and fenceq).  On Linux a
lost context or fence reply stalled Fire Strike and Time Spy at the
second D3D context.

Clear it with the other per-command flags.  Windows install -> reboot ->
desktop: 4/4 pass after, 3/4 failed before.

Assisted-by: Claude:claude-opus-5-5
This commit is contained in:
osy committed 2026-10-07 00:30:16 -07:00
1 parent 40b5b1ff33
commit fdaf37123a
1 file changed
+1
+1
View File
@@ -94,6 +94,7 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
cmd->error = 0;
cmd->finished = false;
cmd->suspended = false;
cmd->deferred = false;
QTAILQ_INSERT_TAIL(&g->cmdq, cmd, next);
cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command));
}