summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-24 16:15:09 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-11-20 09:49:49 +0000
commit30a963d53a468da28b71dfd88b685423be60d446 (patch)
tree7bf91262e54ad7adb555a3cfbda24e097ba2f5ea /server
parentaa8f2a1a95e3da3c4e0a55d25c06e1e47dd213a9 (diff)
downloadspice-30a963d53a468da28b71dfd88b685423be60d446.zip
spice-30a963d53a468da28b71dfd88b685423be60d446.tar.gz
spice-30a963d53a468da28b71dfd88b685423be60d446.tar.xz
worker: add display_channel_free_glz_drawables_to_free()
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/dcc-encoders.c17
-rw-r--r--server/dcc-encoders.h2
-rw-r--r--server/display-channel.c12
-rw-r--r--server/display-channel.h1
-rw-r--r--server/red_worker.c27
5 files changed, 33 insertions, 26 deletions
diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index 1f98d1a..d8d6617 100644
--- a/server/dcc-encoders.c
+++ b/server/dcc-encoders.c
@@ -472,3 +472,20 @@ void dcc_free_glz_drawable_instance(DisplayChannelClient *dcc,
free(glz_drawable);
}
}
+
+void dcc_free_glz_drawables_to_free(DisplayChannelClient* dcc)
+{
+ RingItem *ring_link;
+
+ if (!dcc->glz_dict) {
+ return;
+ }
+ pthread_mutex_lock(&dcc->glz_drawables_inst_to_free_lock);
+ while ((ring_link = ring_get_head(&dcc->glz_drawables_inst_to_free))) {
+ GlzDrawableInstanceItem *drawable_instance = SPICE_CONTAINEROF(ring_link,
+ GlzDrawableInstanceItem,
+ free_link);
+ dcc_free_glz_drawable_instance(dcc, drawable_instance);
+ }
+ pthread_mutex_unlock(&dcc->glz_drawables_inst_to_free_lock);
+}
diff --git a/server/dcc-encoders.h b/server/dcc-encoders.h
index cdb44ac..811183c 100644
--- a/server/dcc-encoders.h
+++ b/server/dcc-encoders.h
@@ -38,6 +38,8 @@ typedef struct GlzDrawableInstanceItem GlzDrawableInstanceItem;
void dcc_encoders_init (DisplayChannelClient *dcc);
void dcc_free_glz_drawable_instance (DisplayChannelClient *dcc,
GlzDrawableInstanceItem *item);
+void dcc_free_glz_drawables_to_free (DisplayChannelClient* dcc);
+
void marshaller_add_compressed (SpiceMarshaller *m,
RedCompressBuf *comp_buf,
size_t size);
diff --git a/server/display-channel.c b/server/display-channel.c
index 0f801d3..3b7a016 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -849,3 +849,15 @@ void display_channel_flush_all_surfaces(DisplayChannel *display)
}
}
}
+
+static void rcc_free_glz_drawables_to_free(RedChannelClient *rcc)
+{
+ DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
+
+ dcc_free_glz_drawables_to_free(dcc);
+}
+
+void display_channel_free_glz_drawables_to_free(DisplayChannel *display)
+{
+ red_channel_apply_clients(RED_CHANNEL(display), rcc_free_glz_drawables_to_free);
+}
diff --git a/server/display-channel.h b/server/display-channel.h
index ac323e3..d47abf7 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -276,6 +276,7 @@ void display_channel_current_flush (DisplayCha
int surface_id);
int display_channel_wait_for_migrate_data (DisplayChannel *display);
void display_channel_flush_all_surfaces (DisplayChannel *display);
+void display_channel_free_glz_drawables_to_free(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 633d5d4..2759857 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2004,23 +2004,6 @@ static void fill_base(SpiceMarshaller *base_marshaller, Drawable *drawable)
spice_marshall_DisplayBase(base_marshaller, &base);
}
-static void red_display_handle_glz_drawables_to_free(DisplayChannelClient* dcc)
-{
- RingItem *ring_link;
-
- if (!dcc->glz_dict) {
- return;
- }
- pthread_mutex_lock(&dcc->glz_drawables_inst_to_free_lock);
- while ((ring_link = ring_get_head(&dcc->glz_drawables_inst_to_free))) {
- GlzDrawableInstanceItem *drawable_instance = SPICE_CONTAINEROF(ring_link,
- GlzDrawableInstanceItem,
- free_link);
- dcc_free_glz_drawable_instance(dcc, drawable_instance);
- }
- pthread_mutex_unlock(&dcc->glz_drawables_inst_to_free_lock);
-}
-
/*
* Releases all the instances of the drawable from the dictionary and the display channel client.
* The release of the last instance will also release the drawable itself and the qxl drawable
@@ -6826,13 +6809,6 @@ RedWorker* red_worker_new(QXLInstance *qxl, RedDispatcher *red_dispatcher)
return worker;
}
-static void red_display_cc_free_glz_drawables(RedChannelClient *rcc)
-{
- DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
-
- red_display_handle_glz_drawables_to_free(dcc);
-}
-
SPICE_GNUC_NORETURN static void *red_worker_main(void *arg)
{
RedWorker *worker = arg;
@@ -6868,8 +6844,7 @@ SPICE_GNUC_NORETURN static void *red_worker_main(void *arg)
/* during migration, in the dest, the display channel can be initialized
while the global lz data not since migrate data msg hasn't been
received yet */
- red_channel_apply_clients(&worker->display_channel->common.base,
- red_display_cc_free_glz_drawables);
+ display_channel_free_glz_drawables_to_free(worker->display_channel);
}
worker->event_timeout = INF_EVENT_WAIT;