[Spice-devel] [RFC v4 48/62] server/red_worker: handle_dev_destroy_surfaces: clear all surfaces

Alon Levy alevy at redhat.com
Tue Apr 26 03:55:13 PDT 2011


---
 server/red_worker.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 9795dab..ca59662 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10256,16 +10256,10 @@ static inline void handle_dev_destroy_surface_wait(RedWorker *worker)
 }
 
 /* called upon device reset */
-
-/* TODO: split me*/
-static inline void handle_dev_destroy_surfaces(RedWorker *worker)
+static inline void __handle_dev_destroy_surfaces(RedWorker *worker, Surfaces *surfaces)
 {
-    Surfaces *surfaces = &worker->surfaces;
     int i;
-    RedWorkerMessage message;
 
-    red_printf("");
-    flush_all_qxl_commands(worker);
     //to handle better
     for (i = 0; i < NUM_SURFACES; ++i) {
         if (surfaces->surfaces[i].context.canvas) {
@@ -10277,7 +10271,19 @@ static inline void handle_dev_destroy_surfaces(RedWorker *worker)
         }
     }
     ASSERT(ring_is_empty(&surfaces->streams));
+}
 
+static inline void handle_dev_destroy_surfaces(RedWorker *worker)
+{
+    RedWorkerMessage message;
+    RingItem *link;
+    Surfaces *surfaces;
+
+    red_printf("");
+    flush_all_qxl_commands(worker);
+    SURFACES_FOREACH(link, surfaces, worker) {
+        __handle_dev_destroy_surfaces(worker, surfaces);
+    }
     if (cursor_connected(worker)) {
         red_wait_outgoing_items(&worker->cursor_channel->common.base);
         red_channel_pipes_add_type(&worker->cursor_channel->common.base,
-- 
1.7.4.4



More information about the Spice-devel mailing list