aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-03-25 11:38:52 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-04-08 11:11:21 +0200
commitaf92284bec7ddbd76ddd105c40718627dda3407e (patch)
treed20ac2408da1ac8c49f60f3c56410c674170ad4e /hw/vga.c
parent2db7ad59fc51ac948a0574bea00bfe389b624e8b (diff)
downloadqemu-af92284bec7ddbd76ddd105c40718627dda3407e.zip
qemu-af92284bec7ddbd76ddd105c40718627dda3407e.tar.gz
qemu-af92284bec7ddbd76ddd105c40718627dda3407e.tar.bz2
update bochs vbe interface
The bochs vbe interface got a new register a while back, which specifies the linear framebuffer size in 64k units. This patch adds support for the new register to qemu. With this patch applied vgabios 0.6c works with qemu. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 6a1a059..bb65677 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -522,7 +522,7 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
VGACommonState *s = opaque;
uint32_t val;
- if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
+ if (s->vbe_index < VBE_DISPI_INDEX_NB) {
if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_GETCAPS) {
switch(s->vbe_index) {
/* XXX: do not hardcode ? */
@@ -542,6 +542,8 @@ static uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
} else {
val = s->vbe_regs[s->vbe_index];
}
+ } else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) {
+ val = s->vram_size / (64 * 1024);
} else {
val = 0;
}
@@ -1955,7 +1957,7 @@ void vga_common_reset(VGACommonState *s)
#ifdef CONFIG_BOCHS_VBE
s->vbe_index = 0;
memset(s->vbe_regs, '\0', sizeof(s->vbe_regs));
- s->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID0;
+ s->vbe_regs[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID5;
s->vbe_start_addr = 0;
s->vbe_line_offset = 0;
s->vbe_bank_mask = (s->vram_size >> 16) - 1;