diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-12-03 12:34:25 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:31:25 -0600 |
commit | 09fe33c524ea8d1c3286116063917d2925bfedf5 (patch) | |
tree | 1934800adc267ce71c165bf879a665b41af200e0 | |
parent | a7ff46766ae081c579aee490186c1af9dca3b7ce (diff) | |
download | hqemu-09fe33c524ea8d1c3286116063917d2925bfedf5.zip hqemu-09fe33c524ea8d1c3286116063917d2925bfedf5.tar.gz |
console: block rendering until client is done
Allow gl user interfaces to block display device gl rendering.
The ui code might want to do that in case it takes a little
longer to bring things to screen, for example because we'll
hand over a dma-buf to another process (spice will do that).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r-- | include/ui/console.h | 2 | ||||
-rw-r--r-- | ui/console.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index 116bc2b..c8f9f7e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -362,6 +362,7 @@ typedef struct GraphicHwOps { void (*text_update)(void *opaque, console_ch_t *text); void (*update_interval)(void *opaque, uint64_t interval); int (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info); + void (*gl_block)(void *opaque, bool block); } GraphicHwOps; QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, @@ -374,6 +375,7 @@ void graphic_console_set_hwops(QemuConsole *con, void graphic_hw_update(QemuConsole *con); void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); +void graphic_hw_gl_block(QemuConsole *con, bool block); QemuConsole *qemu_console_lookup_by_index(unsigned int index); QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head); diff --git a/ui/console.c b/ui/console.c index fe950c6..791b4fc 100644 --- a/ui/console.c +++ b/ui/console.c @@ -261,6 +261,16 @@ void graphic_hw_update(QemuConsole *con) } } +void graphic_hw_gl_block(QemuConsole *con, bool block) +{ + if (!con) { + con = active_console; + } + if (con && con->hw_ops->gl_block) { + con->hw_ops->gl_block(con->hw, block); + } +} + void graphic_hw_invalidate(QemuConsole *con) { if (!con) { |