From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbAfo-0003pM-IV for qemu-devel@nongnu.org; Wed, 21 Nov 2012 08:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbAfk-0000Ls-5q for qemu-devel@nongnu.org; Wed, 21 Nov 2012 08:49:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbAfj-0000LT-V2 for qemu-devel@nongnu.org; Wed, 21 Nov 2012 08:49:00 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qALDmwH9016973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Nov 2012 08:48:59 -0500 From: Gerd Hoffmann Date: Wed, 21 Nov 2012 14:48:56 +0100 Message-Id: <1353505736-26577-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1353505736-26577-1-git-send-email-kraxel@redhat.com> References: <1353505736-26577-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