From patchwork Tue Jun 9 08:49:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 482234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 937C41406A8 for ; Tue, 9 Jun 2015 23:30:17 +1000 (AEST) Received: from localhost ([::1]:35125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2Jba-0004lP-DC for incoming@patchwork.ozlabs.org; Tue, 09 Jun 2015 09:30:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2FEI-0006RU-UP for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:49:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2FEE-0006hK-NS for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:49:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2FEE-0006gX-Ig for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:49:50 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6D1BE344F7C; Tue, 9 Jun 2015 08:49:48 +0000 (UTC) Received: from rhwork.redhat.com (vpn1-5-250.ams2.redhat.com [10.36.5.250]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t598nk4B010273; Tue, 9 Jun 2015 04:49:46 -0400 From: Frediano Ziglio To: fziglio@redhat.com, Gerd Hoffmann , spice-devel@lists.freedesktop.org Date: Tue, 9 Jun 2015 09:49:44 +0100 Message-Id: <1433839784-5634-1-git-send-email-fziglio@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Tue, 09 Jun 2015 09:29:46 -0400 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] RFC: qxl: allow to specify head limit to qxl driver 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 patch allow to limit number of heads using qxl driver. By default qxl driver is not limited on any kind on head use so can decide to use as much heads. libvirt has this as a video card parameter (actually set to 1 but not used). This parameter will allow to limit setting a use can do (which could be confusing). This patch rely on some change in spice-protocol which are not still accepted. See http://lists.freedesktop.org/archives/spice-devel/2015-June/020160.html. Main question and stop over are parameter name. Consider that this parameter is actually more a hint to drivers. I'm looking anyway to a way to enforce this in spice-server. Signed-off-by: Frediano Ziglio --- hw/display/qxl.c | 6 ++++++ hw/display/qxl.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index b220e2d..e9ccd30 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -327,6 +327,11 @@ static void init_qxl_rom(PCIQXLDevice *d) rom->log_level = cpu_to_le32(d->guestdebug); rom->modes_offset = cpu_to_le32(sizeof(QXLRom)); + if (d->max_heads && d->max_heads <= 64) { + rom->flags = cpu_to_le64(QXL_ROM_FLAG_MAX_HEADS); + rom->max_heads = cpu_to_le16(d->max_heads); + } + rom->slot_gen_bits = MEMSLOT_GENERATION_BITS; rom->slot_id_bits = MEMSLOT_SLOT_BITS; rom->slots_start = 1; @@ -2278,6 +2283,7 @@ static Property qxl_properties[] = { DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1), DEFINE_PROP_UINT32("vgamem_mb", PCIQXLDevice, vgamem_size_mb, 16), DEFINE_PROP_INT32("surfaces", PCIQXLDevice, ssd.num_surfaces, 1024), + DEFINE_PROP_UINT16("max_heads", PCIQXLDevice, max_heads, 0), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/display/qxl.h b/hw/display/qxl.h index deddd54..d785761 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -99,6 +99,7 @@ typedef struct PCIQXLDevice { QXLModes *modes; uint32_t rom_size; MemoryRegion rom_bar; + uint16_t max_heads; /* vram pci bar */ uint32_t vram_size;