diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-09-24 15:40:40 +0200 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-11-20 09:49:49 +0000 |
commit | aa8f2a1a95e3da3c4e0a55d25c06e1e47dd213a9 (patch) | |
tree | 698baac4fa5460ad1d1a98fc12b418eb691a59dd /server/red_worker.c | |
parent | 920f857c2d4ad3e8c238c44756b737169b4c7408 (diff) | |
download | spice-aa8f2a1a95e3da3c4e0a55d25c06e1e47dd213a9.tar.gz spice-aa8f2a1a95e3da3c4e0a55d25c06e1e47dd213a9.tar.xz spice-aa8f2a1a95e3da3c4e0a55d25c06e1e47dd213a9.zip |
worker: move dcc_free_glz_drawable_instance
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server/red_worker.c')
-rw-r--r-- | server/red_worker.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/server/red_worker.c b/server/red_worker.c index 3a21d964..633d5d45 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -571,8 +571,8 @@ static inline void set_surface_release_info(QXLReleaseInfoExt *release_info_ext, release_info_ext->group_id = group_id; } -static void red_drawable_unref(RedWorker *worker, RedDrawable *red_drawable, - uint32_t group_id) +void red_drawable_unref(RedWorker *worker, RedDrawable *red_drawable, + uint32_t group_id) { QXLReleaseInfoExt release_info_ext; @@ -2004,52 +2004,6 @@ static void fill_base(SpiceMarshaller *base_marshaller, Drawable *drawable) spice_marshall_DisplayBase(base_marshaller, &base); } -/* Remove from the to_free list and the instances_list. - When no instance is left - the RedGlzDrawable is released too. (and the qxl drawable too, if - it is not used by Drawable). - NOTE - 1) can be called only by the display channel that created the drawable - 2) it is assumed that the instance was already removed from the dictionary*/ -void dcc_free_glz_drawable_instance(DisplayChannelClient *dcc, - GlzDrawableInstanceItem *glz_drawable_instance) -{ - DisplayChannel *display_channel = DCC_TO_DC(dcc); - RedWorker *worker = display_channel->common.worker; - RedGlzDrawable *glz_drawable; - - spice_assert(glz_drawable_instance); - spice_assert(glz_drawable_instance->glz_drawable); - - glz_drawable = glz_drawable_instance->glz_drawable; - - spice_assert(glz_drawable->dcc == dcc); - spice_assert(glz_drawable->instances_count); - - ring_remove(&glz_drawable_instance->glz_link); - glz_drawable->instances_count--; - // when the remove callback is performed from the channel that the - // drawable belongs to, the instance is not added to the 'to_free' list - if (ring_item_is_linked(&glz_drawable_instance->free_link)) { - ring_remove(&glz_drawable_instance->free_link); - } - - if (ring_is_empty(&glz_drawable->instances)) { - spice_assert(!glz_drawable->instances_count); - - Drawable *drawable = glz_drawable->drawable; - - if (drawable) { - ring_remove(&glz_drawable->drawable_link); - } - red_drawable_unref(worker, glz_drawable->red_drawable, - glz_drawable->group_id); - display_channel->glz_drawable_count--; - if (ring_item_is_linked(&glz_drawable->link)) { - ring_remove(&glz_drawable->link); - } - free(glz_drawable); - } -} - static void red_display_handle_glz_drawables_to_free(DisplayChannelClient* dcc) { RingItem *ring_link; |