[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 19/56] vmsvga: don't remember pci BAR address in ca
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [RFC v3 19/56] vmsvga: don't remember pci BAR address in callback any more |
Date: |
Sun, 10 Jul 2011 21:14:32 +0300 |
We're going to remove the callback, so we can't use it to save the
address. Use the pci API instead.
Signed-off-by: Avi Kivity <address@hidden>
---
hw/vmware_vga.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 354c221..190b005 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -52,8 +52,6 @@ struct vmsvga_state_s {
int on;
} cursor;
- target_phys_addr_t vram_base;
-
int index;
int scratch_size;
uint32_t *scratch;
@@ -761,8 +759,11 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t
address)
case SVGA_REG_BYTES_PER_LINE:
return ((s->depth + 7) >> 3) * s->new_width;
- case SVGA_REG_FB_START:
- return s->vram_base;
+ case SVGA_REG_FB_START: {
+ 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:
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;
ram_addr_t iomemtype;
- s->vram_base = addr;
#ifdef DIRECT_VRAM
iomemtype = cpu_register_io_memory(vmsvga_vram_read,
vmsvga_vram_write, s, DEVICE_NATIVE_ENDIAN);
#else
iomemtype = s->vga.vram_offset | IO_MEM_RAM;
#endif
- cpu_register_physical_memory(s->vram_base, s->vga.vram_size,
+ cpu_register_physical_memory(addr, s->vga.vram_size,
iomemtype);
s->vga.map_addr = addr;
--
1.7.5.3
- Re: [Qemu-devel] [RFC v3 31/56] ac97: convert to memory API, (continued)
[Qemu-devel] [RFC v3 17/56] usb-ohci: convert to MemoryRegion, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 08/56] memory: I/O address space support, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 07/56] memory: late initialization of ram_addr, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 16/56] sysbus: add MemoryRegion based memory management API, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 06/56] memory: rename MemoryRegion::has_ram_addr to ::terminates, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 12/56] pc: convert pc_memory_init() to memory API, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 19/56] vmsvga: don't remember pci BAR address in callback any more,
Avi Kivity <=
[Qemu-devel] [RFC v3 10/56] ioport: register ranges by byte aligned addresses always, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 53/56] pci: convert pci rom to memory API, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 23/56] cirrus: simplify vga window mmio access functions, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 04/56] Internal interfaces for memory API, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 33/56] eepro100: convert to memory API, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 22/56] cirrus: simplify bitblt BAR access functions, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 14/56] pci: pass address space to pci bus when created, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 05/56] memory: abstract address space operations, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 27/56] exec.c: fix initialization of system I/O memory region, Avi Kivity, 2011/07/10
[Qemu-devel] [RFC v3 01/56] Hierarchical memory region API, Avi Kivity, 2011/07/10