qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org, kraxel@redhat.com, yhalperi@redhat.com
Subject: [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory
Date: Wed, 25 May 2011 18:56:05 +0300	[thread overview]
Message-ID: <1306338965-6119-1-git-send-email-alevy@redhat.com> (raw)

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

             reply	other threads:[~2011-05-25 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 15:56 Alon Levy [this message]
2011-05-26  7:46 ` [Qemu-devel] [RFCv2] vga: VBE: report maximum VGA_MEM_SIZE memory Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306338965-6119-1-git-send-email-alevy@redhat.com \
    --to=alevy@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yhalperi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).