Patchwork vga: fix mmio vga register mapping

login
register
mail settings
Submitter Gerd Hoffmann
Date Nov. 12, 2012, 9:39 p.m.
Message ID <1352756351-14334-1-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/198491/
State New
Headers show

Comments

Gerd Hoffmann - Nov. 12, 2012, 9:39 p.m.
---
 hw/vga-pci.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/vga-pci.c b/hw/vga-pci.c
index ec29cac..947e35c 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -84,9 +84,10 @@  static void pci_vga_ioport_write(void *ptr, hwaddr addr,
                                  uint64_t val, unsigned size)
 {
     PCIVGAState *d = ptr;
+
     switch (size) {
     case 1:
-        vga_ioport_write(&d->vga, addr, val);
+        vga_ioport_write(&d->vga, addr + 0x3c0, val);
         break;
     case 2:
         /*
@@ -94,8 +95,8 @@  static void pci_vga_ioport_write(void *ptr, hwaddr addr,
          * indexed registers with a single word write because the
          * index byte is updated first.
          */
-        vga_ioport_write(&d->vga, addr, val & 0xff);
-        vga_ioport_write(&d->vga, addr+1, (val >> 8) & 0xff);
+        vga_ioport_write(&d->vga, addr + 0x3c0, val & 0xff);
+        vga_ioport_write(&d->vga, addr + 0x3c1, (val >> 8) & 0xff);
         break;
     }
 }