[Spice-commits] server/display-channel.c server/red-worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Oct 31 09:42:29 UTC 2016


 server/display-channel.c |    6 +++++-
 server/red-worker.c      |    3 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 2307bb45b5c37945b1000a7f0283f824e08d6512
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Oct 25 13:42:32 2016 +0100

    Move capability initialisation into channel creation
    
    No reason why RedWorker should know the capabilities of
    DisplayChannel.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/display-channel.c b/server/display-channel.c
index b483b57..9b7b129 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -2027,6 +2027,7 @@ static void
 display_channel_constructed(GObject *object)
 {
     DisplayChannel *self = DISPLAY_CHANNEL(object);
+    RedChannel *channel = RED_CHANNEL(self);
 
     G_OBJECT_CLASS(display_channel_parent_class)->constructed(object);
 
@@ -2039,7 +2040,6 @@ display_channel_constructed(GObject *object)
     stat_init(&self->priv->__exclude_stat, "__exclude", CLOCK_THREAD_CPUTIME_ID);
 #ifdef RED_STATISTICS
     RedsState *reds = red_channel_get_server(RED_CHANNEL(self));
-    RedChannel *channel = RED_CHANNEL(self);
     self->priv->cache_hits_counter =
         stat_add_counter(reds, red_channel_get_stat_node(channel),
                          "cache_hits", TRUE);
@@ -2053,6 +2053,10 @@ display_channel_constructed(GObject *object)
     image_cache_init(&self->priv->image_cache);
     self->priv->stream_video = SPICE_STREAM_VIDEO_OFF;
     display_channel_init_streams(self);
+
+    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_MONITORS_CONFIG);
+    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_PREF_COMPRESSION);
+    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_STREAM_REPORT);
 }
 
 void display_channel_process_surface_cmd(DisplayChannel *display,
diff --git a/server/red-worker.c b/server/red-worker.c
index f7f0726..ec8ebce 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -1379,9 +1379,6 @@ RedWorker* red_worker_new(QXLInstance *qxl,
     red_channel_set_stat_node(channel, stat_add_node(reds, worker->stat, "display_channel", TRUE));
     red_channel_register_client_cbs(channel, client_display_cbs, dispatcher);
     g_object_set_data(G_OBJECT(channel), "dispatcher", dispatcher);
-    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_MONITORS_CONFIG);
-    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_PREF_COMPRESSION);
-    red_channel_set_cap(channel, SPICE_DISPLAY_CAP_STREAM_REPORT);
     reds_register_channel(reds, channel);
 
     return worker;


More information about the Spice-commits mailing list