From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F4jVI-0007Xw-6c for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:48:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F4jVG-0007VG-5C for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:48:23 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F4jVF-0007Uz-Ub for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:48:22 -0500 Received: from [216.145.243.178] (helo=td01009.thindesktop.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F4jU8-0005VT-3D for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:47:12 -0500 Received: from c-24-30-92-59.hsd1.ga.comcast.net ([24.30.92.59] helo=[10.1.0.1]) by td01009.thindesktop.net with esmtpa (Exim 4.52) id 1F4jS6-0003my-9n for qemu-devel@nongnu.org; Thu, 02 Feb 2006 12:45:06 -0600 Message-ID: <43E25331.9090903@win4lin.com> Date: Thu, 02 Feb 2006 13:45:05 -0500 From: "Leonardo E. Reiter" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060904030002050104090704" Subject: [Qemu-devel] [PATCH] partial fix for cirrus_vga mode switch corruption... Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developer Mailing List This is a multi-part message in MIME format. --------------060904030002050104090704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The attached patch corrects display mode switch corruption in Windows 2000 and XP guests when using cirrus_vga. I'm not sure it's correct and it's certainly a hack, but apparently win2k/xp are expecting the video RAM to be reset to all 1's after mode switches. After lots of trial and error, I discovered that setting the vram to all 1's should only be done on mode switches to 8bpp or higher depth. The only drawback to applying this patch as is, is that when switching back from the monitor, the Windows guest's screen will be reset to solid white. Using the monitor in graphics mode is not a priority for me, but it should be easy to put a check in the code to avoid the memset() if the user is switching back from the monitor rather than Windows itself doing a mode switch. I've found that on rare occasion, even with this patch, mode switches still cause display corruption. For the most part however, the attached hack does the job. Regards, Leo Reiter -- Leonardo E. Reiter Vice President of Product Development, CTO Win4Lin, Inc. Virtual Computing from Desktop to Data Center Main: +1 512 339 7979 Fax: +1 512 532 6501 http://www.win4lin.com --------------060904030002050104090704 Content-Type: text/x-patch; name="qemu-cirrus_vga-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-cirrus_vga-fix.patch" Index: hw/vga.c =================================================================== RCS file: /cvsroot/qemu/qemu/hw/vga.c,v retrieving revision 1.41 diff -a -u -r1.41 vga.c --- hw/vga.c 3 Jul 2005 14:00:51 -0000 1.41 +++ hw/vga.c 27 Jan 2006 20:42:31 -0000 @@ -1364,6 +1364,8 @@ if (disp_width != s->last_width || height != s->last_height) { + if (cirrus_vga_enabled && s->get_bpp(s) >= 8) + memset(s->vram_ptr, 0xff, s->vram_size); dpy_resize(s->ds, disp_width, height); s->last_scr_width = disp_width; s->last_scr_height = height; --------------060904030002050104090704--