[Spice-devel] [PATCH RFC 03/14] Pass surface directly to current_remove_all

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


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

diff --git a/server/display-channel.c b/server/display-channel.c
index 18f31dc..5e9bc7d 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -382,9 +382,9 @@ static void current_remove(DisplayChannel *display, TreeItem *item)
     }
 }
 
-static void current_remove_all(DisplayChannel *display, int surface_id)
+static void current_remove_all(DisplayChannel *display, RedSurface *surface)
 {
-    Ring *ring = &display->priv->surfaces[surface_id].current;
+    Ring *ring = &surface->current;
     RingItem *ring_item;
 
     while ((ring_item = ring_get_head(ring))) {
@@ -1208,7 +1208,7 @@ void display_channel_current_flush(DisplayChannel *display, int surface_id)
     while (!ring_is_empty(&display->priv->surfaces[surface_id].current_list)) {
         free_one_drawable(display, FALSE);
     }
-    current_remove_all(display, surface_id);
+    current_remove_all(display, &display->priv->surfaces[surface_id]);
 }
 
 void display_channel_free_some(DisplayChannel *display)
@@ -1713,7 +1713,7 @@ static void display_channel_destroy_surface(DisplayChannel *display, uint32_t su
     /* note that draw_depend_on_me must be called before current_remove_all.
        otherwise "current" will hold items that other drawables may depend on, and then
        current_remove_all will remove them from the pipe. */
-    current_remove_all(display, surface_id);
+    current_remove_all(display, &display->priv->surfaces[surface_id]);
     clear_surface_drawables_from_pipes(display, surface_id, FALSE);
     display_channel_surface_unref(display, surface_id);
 }
@@ -1729,7 +1729,7 @@ void display_channel_destroy_surface_wait(DisplayChannel *display, uint32_t surf
     /* note that draw_depend_on_me must be called before current_remove_all.
        otherwise "current" will hold items that other drawables may depend on, and then
        current_remove_all will remove them from the pipe. */
-    current_remove_all(display, surface_id);
+    current_remove_all(display, &display->priv->surfaces[surface_id]);
     clear_surface_drawables_from_pipes(display, surface_id, TRUE);
 }
 
-- 
2.7.4



More information about the Spice-devel mailing list