[PATCH] vga: VBE: report maximum VGA_MEM_SIZE memory

Alon Levy alevy at redhat.com
Wed May 25 06:40:44 PDT 2011


When using -vga qxl the amount reported is minimally 32 MiB, making windows
guests come up in a 16 color mode. With this change they work correctly, coming
up with the full range of VBE supported modes.

This patch changes just the reported memory size by VBE
(VBE_DISPI_INDEX_VIDEO_MEMORY_64K) and not the actual vram_size like my
previous try.
---
 hw/vga.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index d5bc582..499042a 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -545,7 +545,11 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
             val = s->vbe_regs[s->vbe_index];
         }
     } else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) {
-        val = s->vram_size / (64 * 1024);
+       /*
+        * windows xp guests don't like larger then VGA_RAM_SIZE (8 MiB),
+        * wrongly setting the display to 4 bit color depth.
+        */
+        val = MIN(VGA_RAM_SIZE, s->vram_size) / (64 * 1024);
     } else {
         val = 0;
     }
-- 
1.7.5.2


--dWYAkE0V1FpFQHQ3--


More information about the Spice-devel mailing list