From 920f857c2d4ad3e8c238c44756b737169b4c7408 Mon Sep 17 00:00:00 2001 From: Marc-AndrĂ© Lureau Date: Tue, 24 Sep 2013 15:11:21 +0200 Subject: worker: move display_channel_flush_all_surfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Fabiano FidĂȘncio --- server/display-channel.c | 11 +++++++++++ server/display-channel.h | 1 + server/red_worker.c | 22 +++------------------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/server/display-channel.c b/server/display-channel.c index 37ba5c31..0f801d31 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -838,3 +838,14 @@ int display_channel_wait_for_migrate_data(DisplayChannel *display) } return FALSE; } + +void display_channel_flush_all_surfaces(DisplayChannel *display) +{ + int x; + + for (x = 0; x < NUM_SURFACES; ++x) { + if (display->surfaces[x].context.canvas) { + display_channel_current_flush(display, x); + } + } +} diff --git a/server/display-channel.h b/server/display-channel.h index 111e0146..ac323e35 100644 --- a/server/display-channel.h +++ b/server/display-channel.h @@ -275,6 +275,7 @@ int display_channel_add_drawable (DisplayCha void display_channel_current_flush (DisplayChannel *display, int surface_id); int display_channel_wait_for_migrate_data (DisplayChannel *display); +void display_channel_flush_all_surfaces (DisplayChannel *display); static inline int is_equal_path(SpicePath *path1, SpicePath *path2) { diff --git a/server/red_worker.c b/server/red_worker.c index d744f483..3a21d964 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -6200,28 +6200,12 @@ static void handle_dev_destroy_primary_surface_async(void *opaque, void *payload destroy_primary_surface(worker, surface_id); } -static void flush_all_surfaces(DisplayChannel *display) -{ - int x; - - for (x = 0; x < NUM_SURFACES; ++x) { - if (display->surfaces[x].context.canvas) { - display_channel_current_flush(display, x); - } - } -} - -static void dev_flush_surfaces(RedWorker *worker) -{ - flush_all_qxl_commands(worker); - flush_all_surfaces(worker->display_channel); -} - static void handle_dev_flush_surfaces_async(void *opaque, void *payload) { RedWorker *worker = opaque; - dev_flush_surfaces(worker); + flush_all_qxl_commands(worker); + display_channel_flush_all_surfaces(worker->display_channel); } static void handle_dev_stop(void *opaque, void *payload) @@ -6232,7 +6216,7 @@ static void handle_dev_stop(void *opaque, void *payload) spice_assert(worker->running); worker->running = FALSE; red_display_clear_glz_drawables(worker->display_channel); - flush_all_surfaces(worker->display_channel); + display_channel_flush_all_surfaces(worker->display_channel); /* todo: when the waiting is expected to take long (slow connection and * overloaded pipe), don't wait, and in case of migration, * purge the pipe, send destroy_all_surfaces -- cgit