[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/12] BACKPORT: vnc: fix copyrect screen corruption
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 07/12] BACKPORT: vnc: fix copyrect screen corruption |
Date: |
Wed, 26 Aug 2009 09:05:41 -0400 |
From: Gerd Hoffmann <address@hidden>
When sending a copyrect command to the vnc client, we must also update
the local server surface. Otherwise the server's and the client's idea
of the screen content run out of sync and screen updates don't work
correctly.
[ backport: uses ds_get_data() instead of direct dereference ]
Signed-off-by: Anthony Liguori <address@hidden>
Signed-off-by: Glauber Costa <address@hidden>
---
vnc.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/vnc.c b/vnc.c
index 1d8ebe7..c0700c0 100644
--- a/vnc.c
+++ b/vnc.c
@@ -633,8 +633,14 @@ static void send_framebuffer_update(VncState *vs, int x,
int y, int w, int h)
static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y,
int w, int h)
{
+
+ uint8_t *src_row;
+ uint8_t *dst_row;
+ int y,pitch,depth;
+
vnc_update_client(vs);
+ /* send bitblit op to the vnc client */
vnc_write_u8(vs, 0); /* msg id */
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1); /* number of rects */
@@ -642,6 +648,23 @@ static void vnc_copy(VncState *vs, int src_x, int src_y,
int dst_x, int dst_y, i
vnc_write_u16(vs, src_x);
vnc_write_u16(vs, src_y);
vnc_flush(vs);
+
+ /* do bitblit op on the local surface too */
+ pitch = ds_get_linesize(vs->ds);
+ depth = ds_get_bytes_per_pixel(vs->ds);
+ src_row = ds_get_data(vs->ds) + pitch * src_y + depth * src_x;
+ dst_row = ds_get_data(vs->ds) + pitch * dst_y + depth * dst_x;
+ if (dst_y > src_y) {
+ /* copy backwards */
+ src_row += pitch * (h-1);
+ dst_row += pitch * (h-1);
+ pitch = -pitch;
+ }
+ for (y = 0; y < h; y++) {
+ memmove(dst_row, src_row, w * depth);
+ src_row += pitch;
+ dst_row += pitch;
+ }
}
static void vnc_dpy_copy(DisplayState *ds, int src_x, int src_y, int dst_x,
int dst_y, int w, int h)
--
1.6.2.2
- [Qemu-devel] [GIT PULL] 0.10.7 stable release, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 01/12] fix for bad macaddr of e1000 in Windows 2003 server with original MS driver, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 02/12] Handle BH's queued by AIO completions in qemu_aio_flush(), Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 03/12] BACKPORT: Add save/restore support to the LSI logic SCSI device model., Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 04/12] vmdk: Fix backing file handling, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 05/12] fix broken migration, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 06/12] fix migration to obey -S, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 07/12] BACKPORT: vnc: fix copyrect screen corruption,
Glauber Costa <=
- [Qemu-devel] [PATCH 08/12] e1000.c doesn't properly emulate EERD and ICS registers, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 09/12] make windows notice media change, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 10/12] BACKPORT: Fix segfault of qemu-system-arm with PXA target, Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 11/12] Fix detached migration with exec., Glauber Costa, 2009/08/26
- [Qemu-devel] [PATCH 12/12] Don't segfault when changing VNC password on an SDL display., Glauber Costa, 2009/08/26
- [Qemu-devel] Re: [PATCH 11/12] Fix detached migration with exec., Chris Lalancette, 2009/08/27
- [Qemu-devel] Re: [PATCH 05/12] fix broken migration, Paolo Bonzini, 2009/08/26
- Message not available
- [Qemu-devel] Re: [PATCH 05/12] fix broken migration, Glauber Costa, 2009/08/27
- [Qemu-devel] Re: [PATCH 05/12] fix broken migration, Paolo Bonzini, 2009/08/28
Re: [Qemu-devel] [GIT PULL] 0.10.7 stable release, Chris Webb, 2009/08/26