virtio-gpu: Call Virgl only in the main thread
PATCH 1/1 virtio-gpu: Call Virgl only in the main thread
Virgl relies on callbacks provided by the OpenGL display, and such a display may rely on eglMakeCurrent. eglMakeCurrent will fail if the given context is current to some other thread. The easiest way to avoid such a failure is to call the OpenGL display in a single thread. As all operations except virtio_gpu_virgl_reset happens in the main thread, this change makes virtio_gpu_virgl_reset happen only in the main thread.
--- hw/display/virtio-gpu-gl.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
hw/display/virtio-gpu-gl.c +1 -6
@@ -90,17 +90,12 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)static void virtio_gpu_gl_reset (VirtIODevice *vdev) { -VirtIOGPU *g =VIRTIO_GPU (vdev);VirtIOGPUGL *gl =VIRTIO_GPU_GL (vdev);virtio_gpu_reset (vdev);if (gl->renderer_inited) { -if (g->parent_obj.renderer_blocked) { - gl->renderer_reset = true; - }else { -virtio_gpu_virgl_reset (g); - } + gl->renderer_reset = true; } }
Signature · 1 line
2.30.1 (Apple Git-130)
Quoted 8 lines · Akihiko Odaki
Virgl relies on callbacks provided by the OpenGL display, and such a display may rely on eglMakeCurrent. eglMakeCurrent will fail if the given context is current to some other thread. The easiest way to avoid such a failure is to call the OpenGL display in a single thread. As all operations except
virtio_gpu_virgl_resethappens in the main thread, this change makesvirtio_gpu_virgl_resethappen only in the main thread.Signed-off-by Akihiko Odaki <[email protected]>
Added to vga patch queue.
thanks,
Gerd