[Spice-devel] [RFCv5 47/47] server/red_worker: handle_dev_update: for all clients (checkme)

Alon Levy alevy at redhat.com
Sun May 8 06:11:43 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.

Testing with and without this patch shows that: (tested with two clients, winxp
vm)
 * without this patch update area is correct only for one client. The other
  clearly shows wrong rendering artifacts (window drag shows traces of
  intermediate points with wrong background).
 * with this patch there are still wrong rendering (image on client correct,
  image via printscreen wrong) but less so.

TODO: more testing. Clearly something is very wrong.
---
 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 43373af..c9d6211 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10271,6 +10271,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;
+    RedRender *render;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
     receive_data(worker->channel, &rect, sizeof(SpiceRect *));
@@ -10285,18 +10287,17 @@ static inline void handle_dev_update(RedWorker *worker)
     validate_surface(&worker->render, surface_id);
     red_update_area(worker, rect, surface_id);
 
-    surface = &worker->render.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);
+    RENDER_FOREACH(link, render, worker) {
+        surface = &render->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.5.1



More information about the Spice-devel mailing list