console: add graphic_hw_update_done()

Add a function to be called when a graphic update is done.

Declare the QXL renderer as async: render_update_cookie_num counts the
number of outstanding updates, and graphic_hw_update_done() is called
when it reaches none.

(note: this is preliminary work for asynchronous screendump support)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Marc-André Lureau 2015-08-24 13:20:49 +02:00
parent dd5b0f9549
commit 4d6316218b
4 changed files with 19 additions and 2 deletions

View file

@ -259,13 +259,22 @@ static void gui_setup_refresh(DisplayState *ds)
ds->have_text = have_text;
}
void graphic_hw_update_done(QemuConsole *con)
{
}
void graphic_hw_update(QemuConsole *con)
{
bool async = false;
if (!con) {
con = active_console;
}
if (con && con->hw_ops->gfx_update) {
con->hw_ops->gfx_update(con->hw);
async = con->hw_ops->gfx_update_async;
}
if (!async) {
graphic_hw_update_done(con);
}
}