diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/virtio-gpu-3d.c | 5 | ||||
-rw-r--r-- | hw/display/virtio-gpu.c | 11 | ||||
-rw-r--r-- | hw/display/virtio-vga.c | 10 |
3 files changed, 26 insertions, 0 deletions
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index 6f646b1eb3..fa192946a3 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -383,6 +383,11 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, { VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); + cmd->waiting = g->renderer_blocked; + if (cmd->waiting) { + return; + } + virgl_renderer_force_ctx_0(); switch (cmd->cmd_hdr.type) { case VIRTIO_GPU_CMD_CTX_CREATE: diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index af9b757d20..1cb4002e0e 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -897,11 +897,22 @@ static int virtio_gpu_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) return 0; } +static void virtio_gpu_gl_block(void *opaque, bool block) +{ + VirtIOGPU *g = opaque; + + g->renderer_blocked = block; + if (!block) { + virtio_gpu_process_cmdq(g); + } +} + const GraphicHwOps virtio_gpu_ops = { .invalidate = virtio_gpu_invalidate_display, .gfx_update = virtio_gpu_update_display, .text_update = virtio_gpu_text_update, .ui_info = virtio_gpu_ui_info, + .gl_block = virtio_gpu_gl_block, }; static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 249dbc05aa..e58b165ae5 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -66,11 +66,21 @@ static int virtio_vga_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) return -1; } +static void virtio_vga_gl_block(void *opaque, bool block) +{ + VirtIOVGA *vvga = opaque; + + if (virtio_gpu_ops.gl_block) { + virtio_gpu_ops.gl_block(&vvga->vdev, block); + } +} + static const GraphicHwOps virtio_vga_ops = { .invalidate = virtio_vga_invalidate_display, .gfx_update = virtio_vga_update_display, .text_update = virtio_vga_text_update, .ui_info = virtio_vga_ui_info, + .gl_block = virtio_vga_gl_block, }; /* VGA device wrapper around PCI device around virtio GPU */ |