From patchwork Thu May 10 13:24:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Lublin X-Patchwork-Id: 158290 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 4C285B6FB4 for ; Thu, 10 May 2012 23:25:22 +1000 (EST) Received: from localhost ([::1]:47670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSTMt-0003eg-Nk for incoming@patchwork.ozlabs.org; Thu, 10 May 2012 09:25:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSTMi-0003b9-Dj for qemu-devel@nongnu.org; Thu, 10 May 2012 09:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSTMY-0004ni-L9 for qemu-devel@nongnu.org; Thu, 10 May 2012 09:25:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSTMY-0004nY-Cy for qemu-devel@nongnu.org; Thu, 10 May 2012 09:24:58 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4ADOuvJ018661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 May 2012 09:24:56 -0400 Received: from ulublin.csb (dhcp-4-37.tlv.redhat.com [10.35.4.37]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4ADOtFK014967 for ; Thu, 10 May 2012 09:24:55 -0400 From: Uri Lublin To: qemu-devel@nongnu.org Date: Thu, 10 May 2012 16:24:53 +0300 Message-Id: <1336656293-31499-1-git-send-email-uril@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qxl: set size of PCI IO BAR correctly (16) for revision 2 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 Also move it up into switch(qxl->revision) block Signed-off-by: Uri Lublin --- hw/qxl.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 6c11e70..3da3399 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1746,13 +1746,16 @@ static int qxl_init_common(PCIQXLDevice *qxl) switch (qxl->revision) { case 1: /* spice 0.4 -- qxl-1 */ pci_device_rev = QXL_REVISION_STABLE_V04; + io_size = 8; break; case 2: /* spice 0.6 -- qxl-2 */ pci_device_rev = QXL_REVISION_STABLE_V06; + io_size = 16; break; case 3: /* qxl-3 */ default: pci_device_rev = QXL_DEFAULT_REVISION; + io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); break; } @@ -1770,11 +1773,6 @@ static int qxl_init_common(PCIQXLDevice *qxl) memory_region_init_alias(&qxl->vram32_bar, "qxl.vram32", &qxl->vram_bar, 0, qxl->vram32_size); - io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); - if (qxl->revision == 1) { - io_size = 8; - } - memory_region_init_io(&qxl->io_bar, &qxl_io_ops, qxl, "qxl-ioports", io_size); if (qxl->id == 0) {