aboutsummaryrefslogtreecommitdiff
path: root/vnc.h
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-20 15:59:14 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-20 15:59:14 +0000
commit6baebed7698a37a0ac5168faf26023426b0ac940 (patch)
tree78d2d62278f8686e6a3282f0cf43f60e6ca9dce0 /vnc.h
parenta667866bc7c1d5cfeab89b24a7cd2913d3a0641a (diff)
vnc: cleanup surface handling, fix screen corruption bug. (Gerd Hoffmann)
This patch killes the old_data hack in the qemu server and replaces it with a clean separation of the guest-visible display surface and the vnc server display surface. Both guest and server surface have their own dirty bitmap for tracking screen updates. Workflow is this: (1) The guest writes to the guest surface. With shared buffers being active the guest writes are directly visible to the vnc server code. Note that this may happen in parallel to the vnc server code running (today only in xenfb, once we have vcpu threads in qemu also for other display adapters). (2) vnc_update() callback tags the specified area in the guest dirty map. (3) vnc_update_client() will first walk through the guest dirty map. It will compare guest and server surface for all regions tagged dirty and in case the screen content really did change the server surface and dirty map are updated. Note: old code used old_data in a simliar way, so this does *not* introduce an extra memcpy. (4) Then vnc_update_cient() will send the updates to the vnc client using the server surface and dirty map. Note: old code used the guest-visible surface instead, causing screen corruption in case of guest screen updates running in parallel. The separate dirty bitmap also has the nice effect that forced screen updates can be done cleanly by simply tagging the area in both guest and server dirty map. The old, hackish way was memset(old_data, 42, size) to trick the code checking for screen changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6860 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vnc.h')
-rw-r--r--vnc.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/vnc.h b/vnc.h
index 8b6bc5e128..ce9aa49900 100644
--- a/vnc.h
+++ b/vnc.h
@@ -104,15 +104,23 @@ struct VncDisplay
#endif
};
+struct VncSurface
+{
+ uint32_t dirty[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
+ DisplaySurface *ds;
+};
+
struct VncState
{
QEMUTimer *timer;
int csock;
+
DisplayState *ds;
+ struct VncSurface guest; /* guest visible surface (aka ds->surface) */
+ struct VncSurface server; /* vnc server surface */
+
VncDisplay *vd;
int need_update;
- uint32_t dirty_row[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
- char *old_data;
uint32_t features;
int absolute;
int last_x;
@@ -138,7 +146,7 @@ struct VncState
/* current output mode information */
VncWritePixels *write_pixels;
VncSendHextileTile *send_hextile_tile;
- DisplaySurface clientds, serverds;
+ DisplaySurface clientds;
CaptureVoiceOut *audio_cap;
struct audsettings as;