Commit e7f3dcc4a7e60291d206669dc1cb10285351e35c

Authored by aliguori
1 parent 6152e2ae

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
Showing 1 changed file with 5 additions and 5 deletions
hw/vga.c
... ... @@ -2258,12 +2258,10 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
2258 2258 cpu_register_physical_memory(addr, s->bios_size, s->bios_offset);
2259 2259 } else {
2260 2260 cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
  2261 + s->map_addr = addr;
  2262 + s->map_end = addr + s->vram_size;
  2263 + vga_dirty_log_start(s);
2261 2264 }
2262   -
2263   - s->map_addr = addr;
2264   - s->map_end = addr + VGA_RAM_SIZE;
2265   -
2266   - vga_dirty_log_start(s);
2267 2265 }
2268 2266  
2269 2267 void vga_common_init(VGAState *s, int vga_ram_size)
... ... @@ -2493,6 +2491,8 @@ static void pci_vga_write_config(PCIDevice *d,
2493 2491  
2494 2492 vga_dirty_log_stop(s);
2495 2493 pci_default_write_config(d, address, val, len);
  2494 + if (s->map_addr && pvs->dev.io_regions[0].addr == -1)
  2495 + s->map_addr = 0;
2496 2496 vga_dirty_log_start(s);
2497 2497 }
2498 2498  
... ...