@@ -113,6 +113,7 @@ typedef struct VirtIOGPU {
bool use_virgl_renderer;
bool renderer_inited;
int renderer_blocked;
+ bool renderer_reset;
QEMUTimer *fence_poll;
QEMUTimer *print_stats;
@@ -1084,6 +1084,12 @@ static void virtio_gpu_gl_block(void *opaque, bool block)
assert(g->renderer_blocked >= 0);
if (g->renderer_blocked == 0) {
+#ifdef CONFIG_VIRGL
+ if (g->renderer_reset) {
+ g->renderer_reset = false;
+ virtio_gpu_virgl_reset(g);
+ }
+#endif
virtio_gpu_process_cmdq(g);
}
}
@@ -1368,7 +1374,11 @@ static void virtio_gpu_reset(VirtIODevice *vdev)
#ifdef CONFIG_VIRGL
if (g->use_virgl_renderer) {
- virtio_gpu_virgl_reset(g);
+ if (g->renderer_blocked) {
+ g->renderer_reset = true;
+ } else {
+ virtio_gpu_virgl_reset(g);
+ }
g->use_virgl_renderer = 0;
}
#endif
If renderer_blocked is set do not call virtio_gpu_virgl_reset(). Instead set a flag indicating that virglrenderer needs a reset. When renderer_blocked gets cleared do the actual reset call. Without this we can trigger an assert in spice due to calling spice_qxl_gl_scanout() while another operation is still running: spice_qxl_gl_scanout: condition `qxl_state->gl_draw_cookie == GL_DRAW_COOKIE_INVALID' failed Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20190314115358.26678-2-kraxel@redhat.com --- include/hw/virtio/virtio-gpu.h | 1 + hw/display/virtio-gpu.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-)