From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZMGP-0006Ng-2F for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:47:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZMGM-00021P-0W for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:47:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZMGL-00021B-PA for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:47:17 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAGDlHK7008294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Nov 2012 08:47:17 -0500 From: Gerd Hoffmann Date: Fri, 16 Nov 2012 14:47:15 +0100 Message-Id: <1353073635-19703-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1353073635-19703-1-git-send-email-kraxel@redhat.com> References: <1353073635-19703-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] vga: fix mmio vga register mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann --- hw/vga-pci.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) 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; } } -- 1.7.1