[Spice-devel] [spice-server 02/10] Remove DisplayChannel::red_drawable_count

Christophe Fergeau cfergeau at redhat.com
Fri Feb 12 17:51:01 UTC 2016


It's only used in a few debug printfs. If we want these stats, we'll
have to find a better way than forcing a dependency on a high-level
class in a lower-level _unref method just to maintain the stats.
---
 server/display-channel.c | 8 ++++----
 server/display-channel.h | 1 -
 server/red-worker.c      | 8 ++------
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 28304b3..fc74853 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1297,8 +1297,8 @@ void display_channel_free_some(DisplayChannel *display)
     DisplayChannelClient *dcc;
     RingItem *item, *next;
 
-    spice_debug("#draw=%d, #red_draw=%d, #glz_draw=%d", display->drawable_count,
-                display->red_drawable_count, display->glz_drawable_count);
+    spice_debug("#draw=%d, #glz_draw=%d", display->drawable_count,
+                display->glz_drawable_count);
     FOREACH_DCC(display, item, next, dcc) {
         GlzSharedDictionary *glz_dict = dcc ? dcc->glz_dict : NULL;
 
@@ -1943,8 +1943,8 @@ static void on_disconnect(RedChannelClient *rcc)
     display_channel_compress_stats_print(display);
 
     // this was the last channel client
-    spice_debug("#draw=%d, #red_draw=%d, #glz_draw=%d",
-                display->drawable_count, display->red_drawable_count,
+    spice_debug("#draw=%d, #glz_draw=%d",
+                display->drawable_count,
                 display->glz_drawable_count);
 }
 
diff --git a/server/display-channel.h b/server/display-channel.h
index e0b18ca..49f1a4f 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -181,7 +181,6 @@ struct DisplayChannel {
     _Drawable drawables[NUM_DRAWABLES];
     _Drawable *free_drawables;
 
-    uint32_t red_drawable_count;
     uint32_t glz_drawable_count;
 
     int stream_video;
diff --git a/server/red-worker.c b/server/red-worker.c
index ff68499..a606aac 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -137,7 +137,6 @@ void red_drawable_unref(DisplayChannel *display, RedDrawable *red_drawable,
     if (--red_drawable->refs) {
         return;
     }
-    display->red_drawable_count--;
     release_info_ext.group_id = group_id;
     release_info_ext.info = red_drawable->release_info;
     display->common.qxl->st->qif->release_resource(display->common.qxl, release_info_ext);
@@ -196,7 +195,6 @@ static RedDrawable *red_drawable_new(RedWorker *worker)
     RedDrawable * red = spice_new0(RedDrawable, 1);
 
     red->refs = 1;
-    worker->display_channel->red_drawable_count++;
 
     return red;
 }
@@ -856,9 +854,8 @@ static void handle_dev_oom(void *opaque, void *payload)
 
     spice_return_if_fail(worker->running);
     // streams? but without streams also leak
-    spice_debug("OOM1 #draw=%u, #red_draw=%u, #glz_draw=%u current %u pipes %u",
+    spice_debug("OOM1 #draw=%u, #glz_draw=%u current %u pipes %u",
                 display->drawable_count,
-                display->red_drawable_count,
                 display->glz_drawable_count,
                 display->current_size,
                 red_channel_sum_pipes_size(display_red_channel));
@@ -869,9 +866,8 @@ static void handle_dev_oom(void *opaque, void *payload)
         display_channel_free_some(worker->display_channel);
         worker->qxl->st->qif->flush_resources(worker->qxl);
     }
-    spice_debug("OOM2 #draw=%u, #red_draw=%u, #glz_draw=%u current %u pipes %u",
+    spice_debug("OOM2 #draw=%u, #glz_draw=%u current %u pipes %u",
                 display->drawable_count,
-                display->red_drawable_count,
                 display->glz_drawable_count,
                 display->current_size,
                 red_channel_sum_pipes_size(display_red_channel));
-- 
2.5.0



More information about the Spice-devel mailing list