aboutsummaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-02-04 14:52:30 +0400
committerGerd Hoffmann <kraxel@redhat.com>2021-02-04 15:58:54 +0100
commit3cddb8b9e0b58eea04e6eb908fc6a12d5af3d3cb (patch)
tree3c3aed83b87348628a62e8c5c719d087b21498e9 /ui/console.c
parentf8f3c2719e11145d4f2902c562f7979df741daf0 (diff)
downloadqemu-3cddb8b9e0b58eea04e6eb908fc6a12d5af3d3cb.zip
qemu-3cddb8b9e0b58eea04e6eb908fc6a12d5af3d3cb.tar.gz
qemu-3cddb8b9e0b58eea04e6eb908fc6a12d5af3d3cb.tar.bz2
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>
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c
index d8cc640..c5d11bc 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -294,6 +294,15 @@ void graphic_hw_gl_block(QemuConsole *con, bool block)
}
}
+void graphic_hw_gl_flushed(QemuConsole *con)
+{
+ assert(con != NULL);
+
+ if (con->hw_ops->gl_flushed) {
+ con->hw_ops->gl_flushed(con->hw);
+ }
+}
+
int qemu_console_get_window_id(QemuConsole *con)
{
return con->window_id;