[Spice-commits] 2 commits - server/red_worker.c

Yonit Halperin yhalperi at kemper.freedesktop.org
Tue Aug 24 00:14:17 PDT 2010


 server/red_worker.c |   38 ++++----------------------------------
 1 file changed, 4 insertions(+), 34 deletions(-)

New commits:
commit a960598e23309712622782ba7e65e0c957e9b2d9
Author: Yonit Halperin <yhalperi at yhalperi.tlv.redhat.com>
Date:   Mon Aug 23 09:07:53 2010 +0300

    server: remove the no longer used glz drawables list that was maintained for each surface.

diff --git a/server/red_worker.c b/server/red_worker.c
index 84a771a..2ce15f5 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -590,11 +590,9 @@ typedef struct GlzDrawableInstanceItem {
 
 struct RedGlzDrawable {
     RingItem link;    // ordered by the time it was encoded
-    RingItem surface_link;
     RedDrawable *red_drawable;
     Drawable    *drawable;
     uint32_t     group_id;
-    int32_t      surface_id;
     SpiceImage  *self_bitmap;
     GlzDrawableInstanceItem instances_pool[MAX_GLZ_DRAWABLE_INSTANCES];
     Ring instances;
@@ -830,7 +828,6 @@ typedef struct RedSurface {
     uint32_t refs;
     Ring current;
     Ring current_list;
-    Ring glz_drawables;
 #ifdef ACYCLIC_SURFACE_DEBUG
     int current_gn;
 #endif
@@ -4672,14 +4669,11 @@ static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannel *channel, Dra
     ret->red_drawable = drawable->red_drawable;
     ret->drawable = drawable;
     ret->group_id = drawable->group_id;
-    ret->surface_id = drawable->surface_id;
     ret->self_bitmap = drawable->self_bitmap;
     ret->instances_count = 0;
     ring_init(&ret->instances);
 
     ring_item_init(&ret->link);
-    ring_item_init(&ret->surface_link);
-    ring_add(&surface->glz_drawables, &ret->surface_link);
     ring_add_before(&ret->link, &channel->glz_drawables);
     drawable->red_glz_drawable = ret;
 
@@ -4745,7 +4739,6 @@ static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
         if (ring_item_is_linked(&glz_drawable->link)) {
             ring_remove(&glz_drawable->link);
         }
-        ring_remove(&glz_drawable->surface_link);
         free(glz_drawable);
     }
 }
@@ -8744,7 +8737,6 @@ static inline void red_create_surface(RedWorker *worker, uint32_t surface_id, ui
     ring_init(&surface->current);
     ring_init(&surface->current_list);
     ring_init(&surface->depend_on_me);
-    ring_init(&surface->glz_drawables);
     region_init(&surface->draw_dirty_region);
     surface->refs = 1;
     if (worker->renderer != RED_RENDERER_INVALID) {
commit 11777186698a8e370c1b5fc82feb046495f9c491
Author: Yonit Halperin <yhalperi at yhalperi.tlv.redhat.com>
Date:   Mon Aug 23 09:05:27 2010 +0300

    server: remove unnecessary dependency between surfaces and Glz drawables
    
    Fixes freedesktop bug #28568

diff --git a/server/red_worker.c b/server/red_worker.c
index e56e409..84a771a 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1541,10 +1541,9 @@ static inline void set_surface_release_info(RedWorker *worker, uint32_t surface_
 }
 
 static inline void free_red_drawable(RedWorker *worker, RedDrawable *drawable, uint32_t group_id,
-                                     SpiceImage *self_bitmap, int surface_id)
+                                     SpiceImage *self_bitmap)
 {
     QXLReleaseInfoExt release_info_ext;
-    red_destroy_surface(worker, surface_id);
 
     if (self_bitmap) {
         red_put_image(self_bitmap);
@@ -1600,12 +1599,12 @@ static inline void release_drawable(RedWorker *worker, Drawable *item)
 
         remove_drawable_dependencies(worker, item);
         red_dec_surfaces_drawable_dependencies(worker, item);
+        red_destroy_surface(worker, item->surface_id);
 
         if (item->red_glz_drawable) {
             item->red_glz_drawable->drawable = NULL;
         } else { // no reference to the qxl drawable left
-            free_red_drawable(worker, item->red_drawable, item->group_id, item->self_bitmap,
-                              item->surface_id);
+            free_red_drawable(worker, item->red_drawable, item->group_id, item->self_bitmap);
         }
         free_drawable(worker, item);
     }
@@ -1798,24 +1797,6 @@ static void red_current_clear(RedWorker *worker, int surface_id)
     }
 }
 
-static void red_clear_surface_glz_drawables(RedWorker *worker, int surface_id)
-{
-    RingItem *ring_item;
- 
-    if (!worker->display_channel) {
-        return;
-    }
-
-    pthread_rwlock_wrlock(&worker->display_channel->glz_dict->encode_lock);
-
-    while ((ring_item = ring_get_head(&worker->surfaces[surface_id].glz_drawables))) {
-        RedGlzDrawable *now = SPICE_CONTAINEROF(ring_item, RedGlzDrawable, surface_link);
-        red_display_free_glz_drawable(worker->display_channel, now);
-    }
-
-    pthread_rwlock_unlock(&worker->display_channel->glz_dict->encode_lock);
-}
-
 static void red_clear_surface_drawables_from_pipe(RedWorker *worker, int surface_id)
 {
     Ring *ring;
@@ -3541,7 +3522,6 @@ static inline void red_process_surface(RedWorker *worker, RedSurfaceCmd *surface
         set_surface_release_info(worker, surface_id, 0, surface->release_info, group_id);
         red_handle_depends_on_target_surface(worker, surface_id);
         red_current_clear(worker, surface_id);
-        red_clear_surface_glz_drawables(worker, surface_id);
         red_clear_surface_drawables_from_pipe(worker, surface_id);
         red_destroy_surface(worker, surface_id);
         break;
@@ -4759,8 +4739,7 @@ static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
             drawable->red_glz_drawable = NULL;
         } else { // no reference to the qxl drawable left
             free_red_drawable(channel->base.worker, glz_drawable->red_drawable,
-                              glz_drawable->group_id, glz_drawable->self_bitmap,
-                              glz_drawable->surface_id);
+                              glz_drawable->group_id, glz_drawable->self_bitmap);
         }
 
         if (ring_item_is_linked(&glz_drawable->link)) {
@@ -9802,7 +9781,6 @@ static inline void destroy_surface_wait(RedWorker *worker, int surface_id)
     }
     red_flush_surface_pipe(worker);
     red_current_clear(worker, surface_id);
-    red_clear_surface_glz_drawables(worker, surface_id);
     red_clear_surface_drawables_from_pipe(worker, surface_id);
     red_wait_outgoing_item((RedChannel *)worker->display_channel);
     if (worker->display_channel) {


More information about the Spice-commits mailing list