qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] partial fix for cirrus_vga mode switch corruption..


From: Leonardo E. Reiter
Subject: [Qemu-devel] [PATCH] partial fix for cirrus_vga mode switch corruption...
Date: Thu, 02 Feb 2006 13:45:05 -0500
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

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

reply via email to

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