]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
fix vnc screen corruption bugs and viewer exits
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 4 Aug 2009 14:35:46 +0000 (15:35 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 4 Aug 2009 14:35:57 +0000 (15:35 +0100)
I have been having problems with display corruption using raw
encoding.

I have also been having issues with the vncviewer client exiting with
"rect too big".

These problems appear when there are rapid changes to the framebuffer
contents. [I've been using "find /" in my tests to generate a lot of text
output.]

The root cause of both problems appears to be the changing of
the underlying framebuffer data during the creation of the update.
[Hextile makes multiple passes over the data and gets badly
confused if the data changes..]

The attached patch pulls the pixel data from the "stable" old_data
buffer rather than directly from the (changing) display surface.

Submitted-by: Andrew Thomas <andrew.thomas@oracle.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit 99a5a9155284ab47eda2be738be0115aa97ce0ff)

vnc.c
vnchextile.h

diff --git a/vnc.c b/vnc.c
index f8606cbde523416afb53069fd7a0251810c1871f..702ee5d912be9ed7d2e4bac533b113acfb1ad7f5 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -499,7 +499,7 @@ static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h
 
     vnc_framebuffer_update(vs, x, y, w, h, 0);
 
-    row = ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds);
+    row = vs->old_data + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds);
     for (i = 0; i < h; i++) {
        vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds));
        row += ds_get_linesize(vs->ds);
index f3fdfb4a267180d8026345fe3a2736f75a4467ea..145588696c67f1fc897927133f98358a58a9948a 100644 (file)
@@ -13,7 +13,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs,
                                              void *last_fg_,
                                              int *has_bg, int *has_fg)
 {
-    uint8_t *row = (ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds));
+    uint8_t *row = (vs->old_data + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds));
     pixel_t *irow = (pixel_t *)row;
     int j, i;
     pixel_t *last_bg = (pixel_t *)last_bg_;