[Spice-devel] [PATCH spice-protocol] support multiple monitors on a single display channel

Alon Levy alevy at redhat.com
Thu Jul 12 09:49:45 PDT 2012


Adds on device:

RAM
 Header
  monitors_config - pointer

 QXLMonitorsConfig
  count == n
  max_allowed = N >= 0
  QXLHead 1
  ...
  QXLHead n
   id, surface_id, x, y, width, height, flags

IO:
 QXL_IO_MONITORS_CONFIG
  server flushes command ring, then calls server callback for changing monitors config.

New revision to let the driver know about the new io:
 QXL_REVISION_STABLE_V12=0x04,

Adds server/client capability:
 SPICE_DISPLAY_CAP_MONITORS_CONFIG

Server message will be added in spice-server and spice-common.

Version is bumped to 0.12.0 to indicate new IO and structs
---
 configure.ac     |    4 ++--
 spice/enums.h    |    1 +
 spice/protocol.h |    1 +
 spice/qxl_dev.h  |   31 ++++++++++++++++++++++++++++++-
 4 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index bf7d949..07e9c75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
 AC_PREREQ([2.57])
 
 m4_define([SPICE_MAJOR], 0)
-m4_define([SPICE_MINOR], 10)
-m4_define([SPICE_MICRO], 3)
+m4_define([SPICE_MINOR], 12)
+m4_define([SPICE_MICRO], 0)
 
 AC_INIT(spice-protocol, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice-protocol)
 
diff --git a/spice/enums.h b/spice/enums.h
index d3a2141..c4e38aa 100644
--- a/spice/enums.h
+++ b/spice/enums.h
@@ -430,6 +430,7 @@ enum {
     SPICE_MSG_DISPLAY_SURFACE_CREATE,
     SPICE_MSG_DISPLAY_SURFACE_DESTROY,
     SPICE_MSG_DISPLAY_STREAM_DATA_SIZED,
+    SPICE_MSG_DISPLAY_MONITORS_CONFIG,
 
     SPICE_MSG_END_DISPLAY
 };
diff --git a/spice/protocol.h b/spice/protocol.h
index ceba2a1..c0d33e6 100644
--- a/spice/protocol.h
+++ b/spice/protocol.h
@@ -124,6 +124,7 @@ enum {
 
 enum {
     SPICE_DISPLAY_CAP_SIZED_STREAM,
+    SPICE_DISPLAY_CAP_MONITORS_CONFIG,
 };
 
 #include <spice/end-packed.h>
diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
index 741a1f6..8899403 100644
--- a/spice/qxl_dev.h
+++ b/spice/qxl_dev.h
@@ -47,7 +47,8 @@
 enum {
     QXL_REVISION_STABLE_V04=0x01,
     QXL_REVISION_STABLE_V06=0x02,
-    QXL_REVISION_STABLE_V10=0x03
+    QXL_REVISION_STABLE_V10=0x03,
+    QXL_REVISION_STABLE_V12=0x04,
 };
 
 #define QXL_DEVICE_ID_DEVEL 0x01ff
@@ -93,6 +94,8 @@ enum {
     QXL_IO_DESTROY_ALL_SURFACES_ASYNC,
     QXL_IO_FLUSH_SURFACES_ASYNC,
     QXL_IO_FLUSH_RELEASE,
+    /* appended for qxl-4 */
+    QXL_IO_MONITORS_CONFIG_ASYNC,
 
     QXL_IO_RANGE_SIZE
 };
@@ -244,6 +247,12 @@ typedef struct SPICE_ATTR_PACKED QXLRam {
     QXLMemSlot mem_slot;
     QXLSurfaceCreate create_surface;
     uint64_t flags;
+
+    /* appended for qxl-4 */
+
+    /* used by QXL_IO_MONITORS_CONFIG_ASYNC */
+    QXLPHYSICAL monitors_config;
+
 } QXLRam;
 
 typedef union QXLReleaseInfo {
@@ -653,6 +662,26 @@ typedef struct SPICE_ATTR_PACKED QXLImage {
     };
 } QXLImage;
 
+/* A QXLHead is a single monitor output backed by a QXLSurface.
+ * x and y offsets are unsigned since they are used in relation to
+ * the given surface, not the same as the x, y coordinates in the guest
+ * screen reference frame. */
+typedef struct SPICE_ATTR_PACKED QXLHead {
+    uint32_t id;
+    uint32_t surface_id;
+    uint32_t width;
+    uint32_t height;
+    uint32_t x;
+    uint32_t y;
+    uint32_t flags;
+} QXLHead;
+
+typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
+    uint16_t count;
+    uint16_t max_allowed; /* If it is 0 no fixed limit is given by the driver */
+    QXLHead heads[0];
+} QXLMonitorsConfig;
+
 #include <spice/end-packed.h>
 
 #endif /* _H_QXL_DEV */
-- 
1.7.10.1



More information about the Spice-devel mailing list