qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH][VNC] Fix fragments due to incomplete dirty tracking


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH][VNC] Fix fragments due to incomplete dirty tracking in CGA mode
Date: Mon, 10 Dec 2007 11:51:39 -0600
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

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
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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]