提交 bba19b88 编写于 作者: G Gerd Hoffmann

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: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
上级 cb9ab7ca
...@@ -362,6 +362,7 @@ typedef struct GraphicHwOps { ...@@ -362,6 +362,7 @@ typedef struct GraphicHwOps {
void (*text_update)(void *opaque, console_ch_t *text); void (*text_update)(void *opaque, console_ch_t *text);
void (*update_interval)(void *opaque, uint64_t interval); void (*update_interval)(void *opaque, uint64_t interval);
int (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info); int (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info);
void (*gl_block)(void *opaque, bool block);
} GraphicHwOps; } GraphicHwOps;
QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
...@@ -374,6 +375,7 @@ void graphic_console_set_hwops(QemuConsole *con, ...@@ -374,6 +375,7 @@ void graphic_console_set_hwops(QemuConsole *con,
void graphic_hw_update(QemuConsole *con); void graphic_hw_update(QemuConsole *con);
void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); 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_index(unsigned int index);
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head); QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
......
...@@ -261,6 +261,16 @@ void graphic_hw_update(QemuConsole *con) ...@@ -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) void graphic_hw_invalidate(QemuConsole *con)
{ {
if (!con) { if (!con) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册