aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 14:26:37 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 14:26:37 +0000
commite7f3dcc4a7e60291d206669dc1cb10285351e35c (patch)
treef327cfd1ddcffbd3f406948ce4052cd08523d8b1 /hw/vga.c
parent6152e2ae4344ec8c849393da3f76f2263cc55766 (diff)
vga: Fix inconsistent tracking of map_addr (Jan Kiszka)
Only track video RAM mapping in map_addr and use the correct RAM size. Furthermore, make sure the reset the address in case unmapping took place via PCI reconfiguration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7140 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/vga.c b/hw/vga.c
index b53b743e61..a4831682fc 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2258,12 +2258,10 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
cpu_register_physical_memory(addr, s->bios_size, s->bios_offset);
} else {
cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
+ s->map_addr = addr;
+ s->map_end = addr + s->vram_size;
+ vga_dirty_log_start(s);
}
-
- s->map_addr = addr;
- s->map_end = addr + VGA_RAM_SIZE;
-
- vga_dirty_log_start(s);
}
void vga_common_init(VGAState *s, int vga_ram_size)
@@ -2493,6 +2491,8 @@ static void pci_vga_write_config(PCIDevice *d,
vga_dirty_log_stop(s);
pci_default_write_config(d, address, val, len);
+ if (s->map_addr && pvs->dev.io_regions[0].addr == -1)
+ s->map_addr = 0;
vga_dirty_log_start(s);
}