qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory
@ 2011-05-25 15:56 Alon Levy
  2011-05-26  7:46 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Alon Levy @ 2011-05-25 15:56 UTC (permalink / raw)
  To: qemu-devel, kraxel, yhalperi

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 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index 124295a..07048bc 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -545,7 +545,14 @@ 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. This fix doesn't
+        * affect native mode, where we have modes that require larger amounts
+        * of ram. (The maximum that VBE reports is 1600x1200 32 bit color depth
+        * which fits)
+        */
+        val = MIN(VGA_RAM_SIZE, s->vram_size) / (64 * 1024);
     } else {
         val = 0;
     }
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory
  2011-05-25 15:56 [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory Alon Levy
@ 2011-05-26  7:46 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2011-05-26  7:46 UTC (permalink / raw)
  To: Alon Levy; +Cc: yhalperi, qemu-devel

On 05/25/11 17:56, Alon Levy wrote:
> 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.

Patch looks fine, nevertheless I'd like to root-cause this first, even 
if this is only for a better changelog entry.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-26  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 15:56 [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory Alon Levy
2011-05-26  7:46 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).