From patchwork Thu Feb 16 17:45:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 141651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D4479B6F99 for ; Fri, 17 Feb 2012 04:46:20 +1100 (EST) Received: from localhost ([::1]:52276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry5PO-00086A-LO for incoming@patchwork.ozlabs.org; Thu, 16 Feb 2012 12:46:18 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry5PE-00085D-3x for qemu-devel@nongnu.org; Thu, 16 Feb 2012 12:46:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry5P8-0004i9-9S for qemu-devel@nongnu.org; Thu, 16 Feb 2012 12:46:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry5P7-0004i0-VH for qemu-devel@nongnu.org; Thu, 16 Feb 2012 12:46:02 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1GHk03j028226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Feb 2012 12:46:00 -0500 Received: from garlic.redhat.com (vpn-203-217.tlv.redhat.com [10.35.203.217]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1GHju1v017303; Thu, 16 Feb 2012 12:45:57 -0500 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Thu, 16 Feb 2012 19:45:55 +0200 Message-Id: <1329414355-26909-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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] hw/qxl: allow vram to be sized to 4096 bytes 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 This allows us to reduce the size of the surfaces bar minimally while not breaking current drivers. To completely disable the bar, or make it zero sized, would break them. Signed-off-by: Alon Levy --- hw/qxl.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index ac69125..b1a2daa 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1556,10 +1556,12 @@ static int qxl_init_common(PCIQXLDevice *qxl) init_qxl_rom(qxl); init_qxl_ram(qxl); - if (qxl->vram_size < 16 * 1024 * 1024) { + /* a request of 0 vram_size is translated to the smallest vram that doesn't + * break current off screen surfaces using drivers */ + if (qxl->vram_size > 0 && qxl->vram_size < 16 * 1024 * 1024) { qxl->vram_size = 16 * 1024 * 1024; } - if (qxl->revision == 1) { + if (qxl->revision == 1 || qxl->vram_size == 0) { qxl->vram_size = 4096; } qxl->vram_size = msb_mask(qxl->vram_size * 2 - 1);