ia64/xen-unstable

changeset 10034:25da74e2f8fb

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@intel.com
author kaf24@firebug.cl.cam.ac.uk
date Wed May 10 16:05:24 2006 +0100 (2006-05-10)
parents 8685b64538fa
children 50989084d4d0
files tools/ioemu/hw/cirrus_vga.c
line diff
     1.1 --- a/tools/ioemu/hw/cirrus_vga.c	Wed May 10 16:01:34 2006 +0100
     1.2 +++ b/tools/ioemu/hw/cirrus_vga.c	Wed May 10 16:05:24 2006 +0100
     1.3 @@ -1187,6 +1187,17 @@ cirrus_hook_write_sr(CirrusVGAState * s,
     1.4  	s->hw_cursor_y = (reg_value << 3) | (reg_index >> 5);
     1.5  	break;
     1.6      case 0x07:			// Extended Sequencer Mode
     1.7 +	/* Win2K seems to assume that the VRAM is set to 0xff
     1.8 +	 *   whenever VGA/SVGA mode changes 
     1.9 +	 */
    1.10 +	if ((s->sr[0x07] ^ reg_value) & CIRRUS_SR7_BPP_SVGA)
    1.11 +	    memset(s->vram_ptr, 0xff, s->real_vram_size);
    1.12 +	s->sr[0x07] = reg_value;
    1.13 +#ifdef DEBUG_CIRRUS 
    1.14 +	printf("cirrus: handled outport sr_index %02x, sr_value %02x\n",
    1.15 +	       reg_index, reg_value);
    1.16 +#endif
    1.17 +	break;
    1.18      case 0x08:			// EEPROM Control
    1.19      case 0x09:			// Scratch Register 0
    1.20      case 0x0a:			// Scratch Register 1
    1.21 @@ -3021,10 +3032,6 @@ static void cirrus_init_common(CirrusVGA
    1.22      }
    1.23      s->cr[0x27] = device_id;
    1.24  
    1.25 -    /* Win2K seems to assume that the pattern buffer is at 0xff
    1.26 -       initially ! */
    1.27 -    memset(s->vram_ptr, 0xff, s->real_vram_size);
    1.28 -
    1.29      s->cirrus_hidden_dac_lockindex = 5;
    1.30      s->cirrus_hidden_dac_data = 0;
    1.31