From patchwork Wed Nov 21 13:48:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 200761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77D2D2C0082 for ; Thu, 22 Nov 2012 00:49:23 +1100 (EST) Received: from localhost ([::1]:41809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbAg5-0003yk-Jz for incoming@patchwork.ozlabs.org; Wed, 21 Nov 2012 08:49:21 -0500 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 Received: from rincewind.home.kraxel.org (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qALDmvD8017783; Wed, 21 Nov 2012 08:48:57 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id D63AA40B03; Wed, 21 Nov 2012 14:48:56 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/2] vga: fix mmio vga register mapping X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org --- 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; } }