diff options
Diffstat (limited to 'server/red_worker.c')
-rw-r--r-- | server/red_worker.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/server/red_worker.c b/server/red_worker.c index 4e342bd8..faa50ed6 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -183,7 +183,6 @@ static void red_update_area_till(DisplayChannel *display, const SpiceRect *area, static inline void display_begin_send_message(RedChannelClient *rcc); static void dcc_release_glz(DisplayChannelClient *dcc); static int red_display_free_some_independent_glz_drawables(DisplayChannelClient *dcc); -static void dcc_free_glz_drawable(DisplayChannelClient *dcc, RedGlzDrawable *drawable); static void display_channel_client_release_item_before_push(DisplayChannelClient *dcc, PipeItem *item); static void display_channel_client_release_item_after_push(DisplayChannelClient *dcc, @@ -1988,74 +1987,6 @@ static void fill_base(SpiceMarshaller *base_marshaller, Drawable *drawable) } /* - * 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 - * if possible. - * NOTE - the caller should prevent encoding using the dictionary during this operation - */ -static void dcc_free_glz_drawable(DisplayChannelClient *dcc, RedGlzDrawable *drawable) -{ - RingItem *head_instance = ring_get_head(&drawable->instances); - int cont = (head_instance != NULL); - - while (cont) { - if (drawable->instances_count == 1) { - /* Last instance: dcc_free_glz_drawable_instance will free the drawable */ - cont = FALSE; - } - GlzDrawableInstanceItem *instance = SPICE_CONTAINEROF(head_instance, - GlzDrawableInstanceItem, - glz_link); - if (!ring_item_is_linked(&instance->free_link)) { - // the instance didn't get out from window yet - glz_enc_dictionary_remove_image(dcc->glz_dict->dict, - instance->context, - &dcc->glz_data.usr); - } - dcc_free_glz_drawable_instance(dcc, instance); - - if (cont) { - head_instance = ring_get_head(&drawable->instances); - } - } -} - -/* Clear all lz drawables - enforce their removal from the global dictionary. - NOTE - prevents encoding using the dictionary during the operation*/ -static void dcc_free_glz_drawables(DisplayChannelClient *dcc) -{ - RingItem *ring_link; - GlzSharedDictionary *glz_dict = dcc ? dcc->glz_dict : NULL; - - if (!glz_dict) { - return; - } - - // assure no display channel is during global lz encoding - pthread_rwlock_wrlock(&glz_dict->encode_lock); - while ((ring_link = ring_get_head(&dcc->glz_drawables))) { - RedGlzDrawable *drawable = SPICE_CONTAINEROF(ring_link, RedGlzDrawable, link); - // no need to lock the to_free list, since we assured no other thread is encoding and - // thus not other thread access the to_free list of the channel - dcc_free_glz_drawable(dcc, drawable); - } - pthread_rwlock_unlock(&glz_dict->encode_lock); -} - -static void display_channel_free_glz_drawables(DisplayChannel *display_channel) -{ - RingItem *link, *next; - DisplayChannelClient *dcc; - - if (!display_channel) { - return; - } - DCC_FOREACH_SAFE(link, next, dcc, RED_CHANNEL(display_channel)) { - dcc_free_glz_drawables(dcc); - } -} - -/* * Remove from the global lz dictionary some glz_drawables that have no reference to * Drawable (their qxl drawables are released too). * NOTE - the caller should prevent encoding using the dictionary during the operation |