qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 03/39] vmsvga: don't remember pci BAR address


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v3 03/39] vmsvga: don't remember pci BAR address in callback any more
Date: Fri, 05 Aug 2011 08:54:39 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/04/2011 08:05 AM, Avi Kivity wrote:
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<address@hidden>
Signed-off-by: Avi Kivity<address@hidden>

Reviewed-by: Anthony Liguori <address@hidden>

Regards,

Anthony Liguori

---
  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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]