debuggers.hg

view tools/ioemu/patches/vnc-cleanup @ 10973:7e914d9cd7e6

[qemu patches] Refresh patches.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Fri Aug 04 10:43:02 2006 +0100 (2006-08-04)
parents f3d6a5281617
children ec8dd0528fc6
line source
1 Index: ioemu/vnc.c
2 ===================================================================
3 --- ioemu.orig/vnc.c 2006-08-04 10:42:19.575024607 +0100
4 +++ ioemu/vnc.c 2006-08-04 10:42:26.918176009 +0100
5 @@ -83,13 +83,16 @@
6 static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
7 {
8 VncState *vs = ds->opaque;
9 - int i;
10 + uint64_t mask;
12 h += y;
13 + if (w != 1024)
14 + mask = ((1ULL << (w / 16)) - 1) << (x / 16);
15 + else
16 + mask = ~(0ULL);
18 for (; y < h; y++)
19 - for (i = 0; i < w; i += 16)
20 - vs->dirty_row[y] |= (1ULL << ((x + i) / 16));
21 + vs->dirty_row[y] |= mask;
22 }
24 static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
25 @@ -262,6 +265,7 @@
26 static void vnc_update_client(void *opaque)
27 {
28 VncState *vs = opaque;
29 + int64_t now = qemu_get_clock(rt_clock);
31 if (vs->need_update && vs->csock != -1) {
32 int y;
33 @@ -282,7 +286,7 @@
34 row = vs->ds->data;
35 old_row = vs->old_data;
37 - for (y = 0; y < vs->height; y++) {
38 + for (y = 0; y < vs->ds->height; y++) {
39 if (vs->dirty_row[y] & width_mask) {
40 int x;
41 char *ptr, *old_ptr;
42 @@ -307,10 +311,8 @@
43 old_row += vs->ds->linesize;
44 }
46 - if (!has_dirty) {
47 - qemu_mod_timer(vs->timer, qemu_get_clock(rt_clock) + VNC_REFRESH_INTERVAL);
48 - return;
49 - }
50 + if (!has_dirty)
51 + goto out;
53 /* Count rectangles */
54 n_rectangles = 0;
55 @@ -348,7 +350,9 @@
56 vnc_flush(vs);
58 }
59 - qemu_mod_timer(vs->timer, qemu_get_clock(rt_clock) + VNC_REFRESH_INTERVAL);
60 +
61 + out:
62 + qemu_mod_timer(vs->timer, now + VNC_REFRESH_INTERVAL);
63 }
65 static void vnc_timer_init(VncState *vs)
66 Index: ioemu/vl.c
67 ===================================================================
68 --- ioemu.orig/vl.c 2006-08-04 10:42:26.723198541 +0100
69 +++ ioemu/vl.c 2006-08-04 10:42:26.921175663 +0100
70 @@ -4589,10 +4589,10 @@
71 /* XXX: better handling of removal */
72 for(ioh = first_io_handler; ioh != NULL; ioh = ioh_next) {
73 ioh_next = ioh->next;
74 - if (FD_ISSET(ioh->fd, &rfds)) {
75 + if (ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
76 ioh->fd_read(ioh->opaque);
77 }
78 - if (FD_ISSET(ioh->fd, &wfds)) {
79 + if (ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
80 ioh->fd_write(ioh->opaque);
81 }
82 }