[Spice-commits] Branch 'server_multi_client.v5' - server/red_worker.c

Alon Levy alon at kemper.freedesktop.org
Sun May 8 06:07:36 PDT 2011


 server/red_worker.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 9249b8b2f2d0cd0fc4bd14791c9a01724c009196
Author: Alon Levy <alevy at redhat.com>
Date:   Fri Apr 22 23:12:44 2011 +0300

    server/red_worker: handle_dev_update: for all clients (checkme)
    
    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.

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;


More information about the Spice-commits mailing list