From patchwork Wed Nov 9 13:37:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 124552 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 89A9E1007D9 for ; Thu, 10 Nov 2011 00:38:18 +1100 (EST) Received: from localhost ([::1]:35658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO8M2-0001iJ-23 for incoming@patchwork.ozlabs.org; Wed, 09 Nov 2011 08:38:14 -0500 Received: from eggs.gnu.org ([140.186.70.92]:48526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO8Lx-0001iC-DF for qemu-devel@nongnu.org; Wed, 09 Nov 2011 08:38:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RO8Lm-000890-Lf for qemu-devel@nongnu.org; Wed, 09 Nov 2011 08:38:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO8Lm-00088h-Ah for qemu-devel@nongnu.org; Wed, 09 Nov 2011 08:37:58 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA9Dbum3026843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Nov 2011 08:37:56 -0500 Received: from localhost.localdomain (vpn-8-213.rdu.redhat.com [10.11.8.213]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pA9DbsGo011915; Wed, 9 Nov 2011 08:37:55 -0500 From: Alon Levy To: kraxel@redhat.com Date: Wed, 9 Nov 2011 15:37:52 +0200 Message-Id: <1320845872-29054-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org 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 --- Causes endless ooms for the linux driver, but it's mainly meant for the windows driver, where it was tested (with a previous patch I can't find, but this one is simple enough and equivalent). hw/qxl.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 41500e9..592842b 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1559,10 +1559,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);