[Spice-devel] [RFC v4 46/62] server/red_worker: handle_dev_update: for all clients (checkme)

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


handle_dev_update does area_update, i.e. rendering to a surface (usually
the primary, surface 0) on request of the driver. Since we only use a single
canvas for each surface on the device memory (the rest are in host memory),
this patch may not really be required.

TODO: test without this patch.
---
 server/red_worker.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 399ebea..550bda9 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10156,6 +10156,8 @@ static inline void handle_dev_update(RedWorker *worker)
     uint32_t num_dirty_rects;
     uint32_t surface_id;
     uint32_t clear_dirty_region;
+    RingItem *link;
+    Surfaces *surfaces;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
     receive_data(worker->channel, &rect, sizeof(SpiceRect *));
@@ -10170,18 +10172,17 @@ static inline void handle_dev_update(RedWorker *worker)
     validate_surface(&worker->surfaces, surface_id);
     red_update_area(worker, rect, surface_id);
 
-    surface = &worker->surfaces.surfaces[surface_id];
-    region_ret_rects(&surface->draw_dirty_region, dirty_rects, num_dirty_rects);
-
-    if (clear_dirty_region) {
-        region_clear(&surface->draw_dirty_region);
+    SURFACES_FOREACH(link, surfaces, worker) {
+        surface = &surfaces->surfaces[surface_id];
+        region_ret_rects(&surface->draw_dirty_region, dirty_rects, num_dirty_rects);
+        if (clear_dirty_region) {
+            region_clear(&surface->draw_dirty_region);
+        }
     }
-
     message = RED_WORKER_MESSAGE_READY;
     write_message(worker->channel, &message);
 }
 
-
 static inline void handle_dev_add_memslot(RedWorker *worker)
 {
     RedWorkerMessage message;
-- 
1.7.4.4



More information about the Spice-devel mailing list