From patchwork Wed Jun 8 12:40:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9164497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52ED1604DB for ; Wed, 8 Jun 2016 12:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 396582723E for ; Wed, 8 Jun 2016 12:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E31A28179; Wed, 8 Jun 2016 12:41:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=2.0 tests=BAYES_00,FSL_HELO_HOME, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B4E0D2810E for ; Wed, 8 Jun 2016 12:41:17 +0000 (UTC) Received: from localhost ([::1]:56758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAcnM-0002YK-Go for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 08:41:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAcn4-0002Wv-84 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 08:41:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAcmy-00017r-8a for qemu-devel@nongnu.org; Wed, 08 Jun 2016 08:40:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAcmy-00017m-2m for qemu-devel@nongnu.org; Wed, 08 Jun 2016 08:40:52 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F796C04B303 for ; Wed, 8 Jun 2016 12:40:51 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-123.ams2.redhat.com [10.36.116.123]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u58Ceopv023021; Wed, 8 Jun 2016 08:40:51 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id C722280E4F; Wed, 8 Jun 2016 14:40:49 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 14:40:48 +0200 Message-Id: <1465389648-5179-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 08 Jun 2016 12:40:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qxl: use uint64_t for vram size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This allows for the 64bit vram bar to become larger than 2G (try -device qxl-vga,vram64_size_mb=8192). https://bugzilla.redhat.com/show_bug.cgi?id=1340439 Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 8 ++++---- hw/display/qxl.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index f867cdf..47cc6f4 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1915,7 +1915,7 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl) /* vram (surfaces, 64bit, bar 4+5) */ if (qxl->vram_size_mb != -1) { - qxl->vram_size = qxl->vram_size_mb * 1024 * 1024; + qxl->vram_size = (uint64_t)qxl->vram_size_mb * 1024 * 1024; } if (qxl->vram_size < qxl->vram32_size) { qxl->vram_size = qxl->vram32_size; @@ -2021,9 +2021,9 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp) dprint(qxl, 1, "ram/%s: %d MB [region 0]\n", qxl->id == 0 ? "pri" : "sec", qxl->vga.vram_size / (1024*1024)); - dprint(qxl, 1, "vram/32: %d MB [region 1]\n", + dprint(qxl, 1, "vram/32: %" PRIx64 "d MB [region 1]\n", qxl->vram32_size / (1024*1024)); - dprint(qxl, 1, "vram/64: %d MB %s\n", + dprint(qxl, 1, "vram/64: %" PRIx64 "d MB %s\n", qxl->vram_size / (1024*1024), qxl->vram32_size < qxl->vram_size ? "[region 4]" : "[unmapped]"); @@ -2277,7 +2277,7 @@ static VMStateDescription qxl_vmstate = { static Property qxl_properties[] = { DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * 1024 * 1024), - DEFINE_PROP_UINT32("vram_size", PCIQXLDevice, vram32_size, + DEFINE_PROP_UINT64("vram_size", PCIQXLDevice, vram32_size, 64 * 1024 * 1024), DEFINE_PROP_UINT32("revision", PCIQXLDevice, revision, QXL_DEFAULT_REVISION), diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 2ddf065..39ff004 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -104,9 +104,9 @@ typedef struct PCIQXLDevice { #endif /* vram pci bar */ - uint32_t vram_size; + uint64_t vram_size; MemoryRegion vram_bar; - uint32_t vram32_size; + uint64_t vram32_size; MemoryRegion vram32_bar; /* io bar */