This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH] Fix for minor video corruption on a Windows guest

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix for minor video corruption on a Windows guest
From: "Donald D. Dugger" <donald.d.dugger@xxxxxxxxx>
Date: Tue, 9 May 2006 12:47:43 -0700
Delivery-date: Tue, 09 May 2006 12:49:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
If you change the video resolution on a Windows XP guest such that it uses
fewer bytes of VRAM (either by using fewer bytes per pixel or by lowering the
resolution) then some window backgrounds will become corrupted.  This happens
because the Windows XP Cirrus Logic driver assumes that VRAM is initialized
to 0xff whenever the video mode switches between VGA and SVGA.

This patch fixes this problem by resetting VRAM whenever a VGA/SVGA mode switch

Signed-off-by: Donald.D.Dugger@xxxxxxxxx

Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
Ph: (303)440-1368

diff -r b6c5920e5d99 tools/ioemu/hw/cirrus_vga.c
--- a/tools/ioemu/hw/cirrus_vga.c       Thu Apr  6 18:58:39 2006 +0100
+++ b/tools/ioemu/hw/cirrus_vga.c       Thu May  4 10:59:06 2006 -0600
@@ -1187,6 +1187,17 @@ cirrus_hook_write_sr(CirrusVGAState * s,
        s->hw_cursor_y = (reg_value << 3) | (reg_index >> 5);
     case 0x07:                 // Extended Sequencer Mode
+       /* Win2K seems to assume that the VRAM is set to 0xff
+        *   whenever VGA/SVGA mode changes 
+        */
+       if ((s->sr[0x07] ^ reg_value) & CIRRUS_SR7_BPP_SVGA)
+           memset(s->vram_ptr, 0xff, s->real_vram_size);
+       s->sr[0x07] = reg_value;
+       printf("cirrus: handled outport sr_index %02x, sr_value %02x\n",
+              reg_index, reg_value);
+       break;
     case 0x08:                 // EEPROM Control
     case 0x09:                 // Scratch Register 0
     case 0x0a:                 // Scratch Register 1
@@ -3021,10 +3032,6 @@ static void cirrus_init_common(CirrusVGA
     s->cr[0x27] = device_id;
-    /* Win2K seems to assume that the pattern buffer is at 0xff
-       initially ! */
-    memset(s->vram_ptr, 0xff, s->real_vram_size);
     s->cirrus_hidden_dac_lockindex = 5;
     s->cirrus_hidden_dac_data = 0;

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix for minor video corruption on a Windows guest, Donald D. Dugger <=