[Spice-devel] [PATCH RFC 08/14] Pass surface directly calling display_channel_current_flush

Frediano Ziglio fziglio at redhat.com
Thu Sep 29 08:44:07 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dcc.c             | 6 +++---
 server/display-channel.c | 8 ++++----
 server/display-channel.h | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 3e597b8..c4510b0 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -257,7 +257,7 @@ static void add_drawable_surface_images(DisplayChannelClient *dcc, Drawable *dra
                 continue;
             }
             dcc_create_surface(dcc, surface_id);
-            display_channel_current_flush(display, surface_id);
+            display_channel_current_flush(display, drawable->surface_deps[x]);
             dcc_push_surface_image(dcc, surface_id);
         }
     }
@@ -267,7 +267,7 @@ static void add_drawable_surface_images(DisplayChannelClient *dcc, Drawable *dra
     }
 
     dcc_create_surface(dcc, drawable->surface->id);
-    display_channel_current_flush(display, drawable->surface->id);
+    display_channel_current_flush(display, drawable->surface);
     dcc_push_surface_image(dcc, drawable->surface->id);
 }
 
@@ -437,7 +437,7 @@ void dcc_start(DisplayChannelClient *dcc)
 
     red_channel_client_ack_zero_messages_window(RED_CHANNEL_CLIENT(dcc));
     if (display->priv->surfaces[0].context.canvas) {
-        display_channel_current_flush(display, 0);
+        display_channel_current_flush(display, &display->priv->surfaces[0]);
         red_channel_client_pipe_add_type(rcc, RED_PIPE_ITEM_TYPE_INVAL_PALETTE_CACHE);
         dcc_create_surface(dcc, 0);
         dcc_push_surface_image(dcc, 0);
diff --git a/server/display-channel.c b/server/display-channel.c
index 006b218..7627df9 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1152,7 +1152,7 @@ void display_channel_flush_all_surfaces(DisplayChannel *display)
 
     for (x = 0; x < NUM_SURFACES; ++x) {
         if (display->priv->surfaces[x].context.canvas) {
-            display_channel_current_flush(display, x);
+            display_channel_current_flush(display, &display->priv->surfaces[x]);
         }
     }
 }
@@ -1203,12 +1203,12 @@ static bool free_one_drawable(DisplayChannel *display, int force_glz_free)
     return TRUE;
 }
 
-void display_channel_current_flush(DisplayChannel *display, int surface_id)
+void display_channel_current_flush(DisplayChannel *display, RedSurface *surface)
 {
-    while (!ring_is_empty(&display->priv->surfaces[surface_id].current_list)) {
+    while (!ring_is_empty(&surface->current_list)) {
         free_one_drawable(display, FALSE);
     }
-    current_remove_all(display, &display->priv->surfaces[surface_id]);
+    current_remove_all(display, surface);
 }
 
 void display_channel_free_some(DisplayChannel *display)
diff --git a/server/display-channel.h b/server/display-channel.h
index 59ec6a4..bd386a7 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -269,7 +269,7 @@ void                       display_channel_compress_stats_reset      (DisplayCha
 void                       display_channel_surface_id_unref          (DisplayChannel *display,
                                                                       uint32_t surface_id);
 void                       display_channel_current_flush             (DisplayChannel *display,
-                                                                      int surface_id);
+                                                                      RedSurface *surface);
 int                        display_channel_wait_for_migrate_data     (DisplayChannel *display);
 void                       display_channel_flush_all_surfaces        (DisplayChannel *display);
 void                       display_channel_free_glz_drawables_to_free(DisplayChannel *display);
-- 
2.7.4



More information about the Spice-devel mailing list