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

[Xen-changelog] [xen-3.0-testing] Reset Cirrus device model `VRAM' whenever a VGA/SVGA mode switch occurs.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 11a431a8b3d98f991d4d22b47baa226b1cd12e2a
# Parent  2fd3c0eb04eaeab3aa3c5d357e9b198e823b564c
Reset Cirrus device model `VRAM' whenever a VGA/SVGA mode switch occurs.

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.

Signed-off-by: Donald.D.Dugger@xxxxxxxxx
xen-unstable changeset:   9966:25da74e2f8fbf3664fb793c1fb9cde26a485292a
xen-unstable date:        Wed May 10 16:05:24 2006 +0100

[HVM][DM] Cleaner way of clearing VGA memory on mode changes (thanks to
Fabrice Bellard on the QEMU project). This patch clears the
memory in the BIOS call rather than when the Cirrus Logic register changes,
which more closely matches what happens on the real hardware.

Signed-off-by: Don Dugger <donald.d.dugger@xxxxxxxxx>
xen-unstable changeset:   10291:2fd2fd4b7c6a93e80b107dab9241d5790ba12f6f
xen-unstable date:        Wed Jun  7 14:13:22 2006 +0100
---
 tools/firmware/vgabios/clext.c |   46 +++++++++++++++++++++++++++++++++++++++++
 tools/ioemu/hw/cirrus_vga.c    |    4 ---
 2 files changed, 46 insertions(+), 4 deletions(-)

diff -r 2fd3c0eb04ea -r 11a431a8b3d9 tools/firmware/vgabios/clext.c
--- a/tools/firmware/vgabios/clext.c    Wed Jun 07 13:39:07 2006 +0100
+++ b/tools/firmware/vgabios/clext.c    Wed Jun 07 14:17:26 2006 +0100
@@ -525,6 +525,13 @@ cirrus_set_video_mode_extended:
 cirrus_set_video_mode_extended:
   call cirrus_switch_mode
   pop ax ;; mode
+  test al, #0x80
+  jnz cirrus_set_video_mode_extended_1
+  push ax
+  mov ax, #0xffff ; set to 0xff to keep win 2K happy
+  call cirrus_clear_vram
+  pop ax
+cirrus_set_video_mode_extended_1:
   and al, #0x7f
 
   push ds
@@ -992,6 +999,13 @@ cirrus_vesa_02h_1:
   jnz cirrus_vesa_02h_3
   call cirrus_enable_16k_granularity
 cirrus_vesa_02h_3:
+  test bx, #0x8000 ;; no clear
+  jnz cirrus_vesa_02h_4
+  push ax
+  xor ax,ax
+  call cirrus_clear_vram
+  pop ax
+cirrus_vesa_02h_4:
   pop ax
   push ds
 #ifdef CIRRUS_VESA3_PMINFO
@@ -1460,6 +1474,38 @@ cirrus_get_start_addr:
   pop  bx
   ret
 
+cirrus_clear_vram:
+  pusha
+  push es
+  mov si, ax
+
+  call cirrus_enable_16k_granularity
+  call cirrus_extbios_85h
+  shl al, #2
+  mov bl, al
+  xor ah,ah
+cirrus_clear_vram_1:
+  mov al, #0x09
+  mov dx, #0x3ce
+  out dx, ax
+  push ax
+  mov cx, #0xa000
+  mov es, cx
+  xor di, di
+  mov ax, si
+  mov cx, #8192
+  cld
+  rep
+      stosw
+  pop ax
+  inc ah
+  cmp ah, bl
+  jne cirrus_clear_vram_1
+
+  pop es
+  popa
+  ret
+
 cirrus_extbios_handlers:
   ;; 80h
   dw cirrus_extbios_80h
diff -r 2fd3c0eb04ea -r 11a431a8b3d9 tools/ioemu/hw/cirrus_vga.c
--- a/tools/ioemu/hw/cirrus_vga.c       Wed Jun 07 13:39:07 2006 +0100
+++ b/tools/ioemu/hw/cirrus_vga.c       Wed Jun 07 14:17:26 2006 +0100
@@ -3021,10 +3021,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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.