summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-24 15:11:21 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-11-20 09:49:49 +0000
commit920f857c2d4ad3e8c238c44756b737169b4c7408 (patch)
tree892d0d4f79e4f2c3acfc72f8c9419a45c01c6e3d /server
parent422d67dde4bb9d55362dee5db2237ef373448dbd (diff)
downloadspice-920f857c2d4ad3e8c238c44756b737169b4c7408.zip
spice-920f857c2d4ad3e8c238c44756b737169b4c7408.tar.gz
spice-920f857c2d4ad3e8c238c44756b737169b4c7408.tar.xz
worker: move display_channel_flush_all_surfaces
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/display-channel.c11
-rw-r--r--server/display-channel.h1
-rw-r--r--server/red_worker.c22
3 files changed, 15 insertions, 19 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index 37ba5c3..0f801d3 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 111e014..ac323e3 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 d744f48..3a21d96 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