mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
display/ui: add a callback to indicate GL state is flushed
Displaying rendered resources requires blocking qemu GPU to avoid extra framebuffer copies. For an external display, via Spice currently, there is a callback to block/unblock the rendering in the same thread. But with the vhost-user-gpu backend, the qemu process doesn't handle the rendering itself, and the blocking callback isn't effective. Instead, the backend must be notified when the display code is done. Fix this by adding a new GraphicHwOps callback to indicate the GL state is flushed, and we are done manipulating the shared GL resources. Call it from gtk and spice display. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-19-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
f8f3c2719e
commit
3cddb8b9e0
11 changed files with 48 additions and 10 deletions
|
@ -360,7 +360,7 @@ vhost_user_gpu_update_blocked(VhostUserGPU *g, bool blocked)
|
|||
}
|
||||
|
||||
static void
|
||||
vhost_user_gpu_gl_unblock(VirtIOGPUBase *b)
|
||||
vhost_user_gpu_gl_flushed(VirtIOGPUBase *b)
|
||||
{
|
||||
VhostUserGPU *g = VHOST_USER_GPU(b);
|
||||
|
||||
|
@ -578,7 +578,7 @@ vhost_user_gpu_class_init(ObjectClass *klass, void *data)
|
|||
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
|
||||
VirtIOGPUBaseClass *vgc = VIRTIO_GPU_BASE_CLASS(klass);
|
||||
|
||||
vgc->gl_unblock = vhost_user_gpu_gl_unblock;
|
||||
vgc->gl_flushed = vhost_user_gpu_gl_flushed;
|
||||
|
||||
vdc->realize = vhost_user_gpu_device_realize;
|
||||
vdc->reset = vhost_user_gpu_reset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue