mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-06 01:33:34 +00:00
vmsvga: don't remember pci BAR address in callback any more
We're going to remove the callback, so we can't use it to save the address. Use the pci API instead. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
16a96f288a
commit
7b619b9ae5
@ -52,8 +52,6 @@ struct vmsvga_state_s {
|
|||||||
int on;
|
int on;
|
||||||
} cursor;
|
} cursor;
|
||||||
|
|
||||||
target_phys_addr_t vram_base;
|
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
int scratch_size;
|
int scratch_size;
|
||||||
uint32_t *scratch;
|
uint32_t *scratch;
|
||||||
@ -761,8 +759,11 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
|
|||||||
case SVGA_REG_BYTES_PER_LINE:
|
case SVGA_REG_BYTES_PER_LINE:
|
||||||
return ((s->depth + 7) >> 3) * s->new_width;
|
return ((s->depth + 7) >> 3) * s->new_width;
|
||||||
|
|
||||||
case SVGA_REG_FB_START:
|
case SVGA_REG_FB_START: {
|
||||||
return s->vram_base;
|
struct pci_vmsvga_state_s *pci_vmsvga
|
||||||
|
= container_of(s, struct pci_vmsvga_state_s, chip);
|
||||||
|
return pci_get_bar_addr(&pci_vmsvga->card, 1);
|
||||||
|
}
|
||||||
|
|
||||||
case SVGA_REG_FB_OFFSET:
|
case SVGA_REG_FB_OFFSET:
|
||||||
return 0x0;
|
return 0x0;
|
||||||
@ -1247,14 +1248,13 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
|
|||||||
struct vmsvga_state_s *s = &d->chip;
|
struct vmsvga_state_s *s = &d->chip;
|
||||||
ram_addr_t iomemtype;
|
ram_addr_t iomemtype;
|
||||||
|
|
||||||
s->vram_base = addr;
|
|
||||||
#ifdef DIRECT_VRAM
|
#ifdef DIRECT_VRAM
|
||||||
iomemtype = cpu_register_io_memory(vmsvga_vram_read,
|
iomemtype = cpu_register_io_memory(vmsvga_vram_read,
|
||||||
vmsvga_vram_write, s, DEVICE_NATIVE_ENDIAN);
|
vmsvga_vram_write, s, DEVICE_NATIVE_ENDIAN);
|
||||||
#else
|
#else
|
||||||
iomemtype = s->vga.vram_offset | IO_MEM_RAM;
|
iomemtype = s->vga.vram_offset | IO_MEM_RAM;
|
||||||
#endif
|
#endif
|
||||||
cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
|
cpu_register_physical_memory(addr, s->vga.vram_size,
|
||||||
iomemtype);
|
iomemtype);
|
||||||
|
|
||||||
s->vga.map_addr = addr;
|
s->vga.map_addr = addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user