From: Marc-André Lureau <marcandre.lur...@redhat.com> Add a function to be called when an async graphic update is done.
Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- hw/display/qxl-render.c | 9 +++++++-- include/ui/console.h | 1 + ui/console.c | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index 54bbf01..a5c9abc 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -105,7 +105,7 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) qxl->guest_primary.surface.mem, MEMSLOT_GROUP_GUEST); if (!qxl->guest_primary.data) { - return; + goto end; } qxl_set_rect_to_surface(qxl, &qxl->dirty[0]); qxl->num_dirty_rects = 1; @@ -133,7 +133,7 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) } if (!qxl->guest_primary.data) { - return; + goto end; } for (i = 0; i < qxl->num_dirty_rects; i++) { if (qemu_spice_rect_is_empty(qxl->dirty+i)) { @@ -154,6 +154,11 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) qxl->dirty[i].bottom - qxl->dirty[i].top); } qxl->num_dirty_rects = 0; + +end: + if (qxl->render_update_cookie_num == 0) { + graphic_hw_update_done(qxl->ssd.dcl.con); + } } /* diff --git a/include/ui/console.h b/include/ui/console.h index a14a619..cb41d22 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -311,6 +311,7 @@ void graphic_console_set_hwops(QemuConsole *con, void *opaque); bool graphic_hw_update(QemuConsole *con); +void graphic_hw_update_done(QemuConsole *con); void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); diff --git a/ui/console.c b/ui/console.c index 47352ef..1f800ef 100644 --- a/ui/console.c +++ b/ui/console.c @@ -250,6 +250,10 @@ static void gui_setup_refresh(DisplayState *ds) ds->have_text = have_text; } +void graphic_hw_update_done(QemuConsole *con) +{ +} + bool graphic_hw_update(QemuConsole *con) { if (!con) { -- 2.4.3