qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][VNC] Fix fragments due to incomplete dirty tracking in CGA mode
@ 2007-12-10 17:51 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2007-12-10 17:51 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

Dirty tracking is done in the VNC server by splitting the framebuffer 
into 16-pixel blocks and then updating a bitmap when a dpy->update() 
occurs.  If dpy->update() is called with an x st (x % 16) != 0, then the 
very last block dirtied by the update could potentially not be tracked.

This is really only visible when in CGA mode or when using the VMware 
VGA driver since they are the only ones that generate updates where x != 
0.  The attached patch addresses this.

Reproducing the fragments isn't 100% reliable but I was able to find a 
somewhat reliable way to reproduce (holding in backspace when editting a 
grub entry) and confirmed that this patch fixes the problem.

Regards,

Anthony Liguori

[-- Attachment #2: vnc-fragments.diff --]
[-- Type: text/x-patch, Size: 602 bytes --]

Index: qemu/vnc.c
===================================================================
--- qemu.orig/vnc.c	2007-12-10 11:39:04.000000000 -0600
+++ qemu/vnc.c	2007-12-10 11:42:57.000000000 -0600
@@ -258,6 +258,13 @@
 
     h += y;
 
+    /* round x down to ensure the loop only spans one 16-pixel block per,
+       iteration.  otherwise, if (x % 16) != 0, the last iteration may span
+       two 16-pixel blocks but we only mark the first as dirty
+    */
+    w += (x % 16);
+    x -= (x % 16);
+
     for (; y < h; y++)
 	for (i = 0; i < w; i += 16)
 	    vnc_set_bit(vs->dirty_row[y], (x + i) / 16);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-10 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-10 17:51 [Qemu-devel] [PATCH][VNC] Fix fragments due to incomplete dirty tracking in CGA mode Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).