From: Frediano Ziglio <fziglio@redhat.com>
To: fziglio@redhat.com, Gerd Hoffmann <kraxel@redhat.com>,
spice-devel@lists.freedesktop.org
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] RFC: qxl: allow to specify head limit to qxl driver
Date: Tue, 9 Jun 2015 09:49:44 +0100 [thread overview]
Message-ID: <1433839784-5634-1-git-send-email-fziglio@redhat.com> (raw)
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 <fziglio@redhat.com>
---
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;
--
2.1.0
next reply other threads:[~2015-06-09 8:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 8:49 Frediano Ziglio [this message]
2015-06-09 9:12 ` [Qemu-devel] [PATCH] RFC: qxl: allow to specify head limit to qxl driver Gerd Hoffmann
2015-06-09 9:26 ` Frediano Ziglio
2015-06-09 9:43 ` Gerd Hoffmann
2015-06-09 15:03 ` Frediano Ziglio
2015-06-09 9:50 ` [Qemu-devel] [Spice-devel] " Daniel P. Berrange
2015-06-09 11:15 ` Christophe Fergeau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433839784-5634-1-git-send-email-fziglio@redhat.com \
--to=fziglio@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=spice-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).