qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.4 0/1] qxl: allow to specify head limit to qxl driver
@ 2015-07-16 15:34 Gerd Hoffmann
  2015-07-16 15:34 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
  2015-07-16 17:30 ` [Qemu-devel] [PULL for-2.4 0/1] " Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2015-07-16 15:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

A single spice patch, adding a new parameter to specify the number
of heads for qxl (assuming spice-server version is new enough).

please pull,
  Gerd

The following changes since commit 2d5ee9e7a7dd495d233cf9613a865f63f88e3375:

  Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150716' into staging (2015-07-16 10:40:23 +0100)

are available in the git repository at:


  git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150716-1

for you to fetch changes up to 567161fdd47aeb6987e700702f6bbfef04ae0236:

  qxl: allow to specify head limit to qxl driver (2015-07-16 17:31:05 +0200)

----------------------------------------------------------------
qxl: allow to specify head limit to qxl driver

----------------------------------------------------------------
Frediano Ziglio (1):
      qxl: allow to specify head limit to qxl driver

 hw/display/qxl.c | 26 +++++++++++++++++++++-----
 hw/display/qxl.h |  3 +++
 2 files changed, 24 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] qxl: allow to specify head limit to qxl driver
  2015-07-16 15:34 [Qemu-devel] [PULL for-2.4 0/1] qxl: allow to specify head limit to qxl driver Gerd Hoffmann
@ 2015-07-16 15:34 ` Gerd Hoffmann
  2015-07-16 17:30 ` [Qemu-devel] [PULL for-2.4 0/1] " Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2015-07-16 15:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Frediano Ziglio

From: Frediano Ziglio <fziglio@redhat.com>

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).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/qxl.c | 26 +++++++++++++++++++++-----
 hw/display/qxl.h |  3 +++
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index f87a5ee..4e5ff69 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -271,6 +271,12 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
                     QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
                     0));
     } else {
+#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
+        if (qxl->max_outputs) {
+            spice_qxl_set_monitors_config_limit(&qxl->ssd.qxl,
+                                                qxl->max_outputs);
+        }
+#endif
         qxl->guest_monitors_config = qxl->ram->monitors_config;
         spice_qxl_monitors_config_async(&qxl->ssd.qxl,
                 qxl->ram->monitors_config,
@@ -991,6 +997,7 @@ static int interface_client_monitors_config(QXLInstance *sin,
     PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
     QXLRom *rom = memory_region_get_ram_ptr(&qxl->rom_bar);
     int i;
+    unsigned max_outputs = ARRAY_SIZE(rom->client_monitors_config.heads);
 
     if (qxl->revision < 4) {
         trace_qxl_client_monitors_config_unsupported_by_device(qxl->id,
@@ -1013,17 +1020,23 @@ static int interface_client_monitors_config(QXLInstance *sin,
     if (!monitors_config) {
         return 1;
     }
+
+#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
+    /* limit number of outputs based on setting limit */
+    if (qxl->max_outputs && qxl->max_outputs <= max_outputs) {
+        max_outputs = qxl->max_outputs;
+    }
+#endif
+
     memset(&rom->client_monitors_config, 0,
            sizeof(rom->client_monitors_config));
     rom->client_monitors_config.count = monitors_config->num_of_monitors;
     /* monitors_config->flags ignored */
-    if (rom->client_monitors_config.count >=
-            ARRAY_SIZE(rom->client_monitors_config.heads)) {
+    if (rom->client_monitors_config.count >= max_outputs) {
         trace_qxl_client_monitors_config_capped(qxl->id,
                                 monitors_config->num_of_monitors,
-                                ARRAY_SIZE(rom->client_monitors_config.heads));
-        rom->client_monitors_config.count =
-            ARRAY_SIZE(rom->client_monitors_config.heads);
+                                max_outputs);
+        rom->client_monitors_config.count = max_outputs;
     }
     for (i = 0 ; i < rom->client_monitors_config.count ; ++i) {
         VDAgentMonConfig *monitor = &monitors_config->monitors[i];
@@ -2274,6 +2287,9 @@ 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),
+#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
+        DEFINE_PROP_UINT16("max_outputs", PCIQXLDevice, max_outputs, 0),
+#endif
         DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index deddd54..2ddf065 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -99,6 +99,9 @@ typedef struct PCIQXLDevice {
     QXLModes           *modes;
     uint32_t           rom_size;
     MemoryRegion       rom_bar;
+#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
+    uint16_t           max_outputs;
+#endif
 
     /* vram pci bar */
     uint32_t           vram_size;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL for-2.4 0/1] qxl: allow to specify head limit to qxl driver
  2015-07-16 15:34 [Qemu-devel] [PULL for-2.4 0/1] qxl: allow to specify head limit to qxl driver Gerd Hoffmann
  2015-07-16 15:34 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
@ 2015-07-16 17:30 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-07-16 17:30 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 16 July 2015 at 16:34, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> A single spice patch, adding a new parameter to specify the number
> of heads for qxl (assuming spice-server version is new enough).
>
> please pull,
>   Gerd
>
> The following changes since commit 2d5ee9e7a7dd495d233cf9613a865f63f88e3375:
>
>   Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150716' into staging (2015-07-16 10:40:23 +0100)
>
> are available in the git repository at:
>
>
>   git://anongit.freedesktop.org/spice/qemu tags/pull-spice-20150716-1
>
> for you to fetch changes up to 567161fdd47aeb6987e700702f6bbfef04ae0236:
>
>   qxl: allow to specify head limit to qxl driver (2015-07-16 17:31:05 +0200)
>
> ----------------------------------------------------------------
> qxl: allow to specify head limit to qxl driver
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-16 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 15:34 [Qemu-devel] [PULL for-2.4 0/1] qxl: allow to specify head limit to qxl driver Gerd Hoffmann
2015-07-16 15:34 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
2015-07-16 17:30 ` [Qemu-devel] [PULL for-2.4 0/1] " Peter Maydell

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).