All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] partial fix for cirrus_vga mode switch corruption...
@ 2006-02-02 18:45 Leonardo E. Reiter
  0 siblings, 0 replies; only message in thread
From: Leonardo E. Reiter @ 2006-02-02 18:45 UTC (permalink / raw)
  To: QEMU Developer Mailing List

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

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

[-- Attachment #2: qemu-cirrus_vga-fix.patch --]
[-- Type: text/x-patch, Size: 594 bytes --]

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;

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

only message in thread, other threads:[~2006-02-02 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-02 18:45 [Qemu-devel] [PATCH] partial fix for cirrus_vga mode switch corruption Leonardo E. Reiter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.