From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1mpP-00026a-17 for qemu-devel@nongnu.org; Mon, 10 Dec 2007 12:54:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1mpM-00023p-UU for qemu-devel@nongnu.org; Mon, 10 Dec 2007 12:54:02 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1mpM-00023f-PT for qemu-devel@nongnu.org; Mon, 10 Dec 2007 12:54:00 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1mpM-0005n6-Ll for qemu-devel@nongnu.org; Mon, 10 Dec 2007 12:54:00 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id lBAHpdJI006757 for ; Mon, 10 Dec 2007 12:51:39 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lBAHpdwl137672 for ; Mon, 10 Dec 2007 12:51:39 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lBAHpdQH019487 for ; Mon, 10 Dec 2007 12:51:39 -0500 Received: from [9.67.27.204] (wecm-9-67-27-204.wecm.ibm.com [9.67.27.204]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lBAHpceW019441 for ; Mon, 10 Dec 2007 12:51:38 -0500 Message-ID: <475D7CAB.9070300@us.ibm.com> Date: Mon, 10 Dec 2007 11:51:39 -0600 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080502050205000809080006" Subject: [Qemu-devel] [PATCH][VNC] Fix fragments due to incomplete dirty tracking in CGA mode Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080502050205000809080006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080502050205000809080006 Content-Type: text/x-patch; name="vnc-fragments.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vnc-fragments.diff" 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); --------------080502050205000809080006--