From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Alon Levy Date: Thu, 16 Feb 2012 19:45:55 +0200 Message-Id: <1329414355-26909-1-git-send-email-alevy@redhat.com> Subject: [Qemu-devel] [PATCH] hw/qxl: allow vram to be sized to 4096 bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com 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); -- 1.7.9