[Spice-devel] [PATCH spice-server v8 03/12] fixup! Convert RedChannel hierarchy to GObject

Frediano Ziglio fziglio at redhat.com
Mon Oct 24 08:40:46 UTC 2016


Simplify getting RedsState from DisplayChannel.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/display-channel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 59e6c8d..bcf26bb 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1902,8 +1902,7 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
 
     if (display->priv->renderer == RED_RENDERER_INVALID) {
         int i;
-        QXLInstance *qxl = common_graphics_channel_get_qxl(COMMON_GRAPHICS_CHANNEL(display));
-        RedsState *reds = red_qxl_get_server(qxl->st);
+        RedsState *reds = red_channel_get_server(RED_CHANNEL(display));
         GArray *renderers = reds_get_renderers(reds);
         for (i = 0; i < renderers->len; i++) {
             uint32_t renderer = g_array_index(renderers, uint32_t, i);
@@ -2037,8 +2036,7 @@ display_channel_constructed(GObject *object)
     stat_init(&self->priv->exclude_stat, "exclude", CLOCK_THREAD_CPUTIME_ID);
     stat_init(&self->priv->__exclude_stat, "__exclude", CLOCK_THREAD_CPUTIME_ID);
 #ifdef RED_STATISTICS
-    QXLInstance *qxl = common_graphics_channel_get_qxl(&self->parent);
-    RedsState *reds = red_qxl_get_server(qxl->st);
+    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),
-- 
2.7.4



More information about the Spice-devel mailing list