From patchwork Wed Jul 6 10:04:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9216033 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 35ED0607D9 for ; Wed, 6 Jul 2016 10:11:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F200287F2 for ; Wed, 6 Jul 2016 10:11:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14010287F5; Wed, 6 Jul 2016 10:11:59 +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=-6.9 required=2.0 tests=BAYES_00,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 B358F287F2 for ; Wed, 6 Jul 2016 10:11:58 +0000 (UTC) Received: from localhost ([::1]:60740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKjoD-0005aP-Q9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Jul 2016 06:11:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKjhM-0005Qf-6e for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKjhH-0002Ds-UB for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKjhH-0002Dd-O2 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:47 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 AE90A6315E for ; Wed, 6 Jul 2016 10:04:46 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u66A4jSI014516; Wed, 6 Jul 2016 06:04:46 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 0378F80E30; Wed, 6 Jul 2016 12:04:43 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 6 Jul 2016 12:04:34 +0200 Message-Id: <1467799482-26420-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1467799482-26420-1-git-send-email-kraxel@redhat.com> References: <1467799482-26420-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 06 Jul 2016 10:04:46 +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] [PULL 1/9] 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 Message-id: 1465389648-5179-1-git-send-email-kraxel@redhat.com --- 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 919dc5c..ab96f24 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1914,7 +1914,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; @@ -2020,9 +2020,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]"); @@ -2276,7 +2276,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 */