single vnc server surface
This patch removes the server surface from VncState and adds a single
server surface to VncDisplay for all the possible clients connected.
Each client maintains a different dirty bitmap in VncState.
The guest surface is moved to VncDisplay as well because we don't need
to track guest updates in more than one place.
This patch has been updated to handle CopyRect correctly and efficiently.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
diff --git a/vnc.h b/vnc.h
index a35b378..5c903de 100644
--- a/vnc.h
+++ b/vnc.h
@@ -84,6 +84,11 @@
#include "vnc-auth-sasl.h"
#endif
+struct VncSurface
+{
+ uint32_t dirty[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
+ DisplaySurface *ds;
+};
struct VncDisplay
{
@@ -93,6 +98,9 @@
VncState *clients;
kbd_layout_t *kbd_layout;
+ struct VncSurface guest; /* guest visible surface (aka ds->surface) */
+ DisplaySurface *server; /* vnc server surface */
+
char *display;
char *password;
int auth;
@@ -105,19 +113,12 @@
#endif
};
-struct VncSurface
-{
- uint32_t dirty[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
- DisplaySurface *ds;
-};
-
struct VncState
{
int csock;
DisplayState *ds;
- struct VncSurface guest; /* guest visible surface (aka ds->surface) */
- struct VncSurface server; /* vnc server surface */
+ uint32_t dirty[VNC_MAX_HEIGHT][VNC_DIRTY_WORDS];
VncDisplay *vd;
int need_update;