[Spice-devel] [spice-protocol PATCH 2/2] qxl_dev.h: add client monitors configuration notification to guest

Alon Levy alevy at redhat.com
Mon Sep 10 05:01:00 PDT 2012


so far we have used the agent to notify the guest of a request to change
the monitors configurations (heads) on the qxl device. This patch introduces
a new interrupt and new fields in the qxl rom to notify the guest about
a new request, similarly to how physical hardware notifies the driver.

To avoid overwriting the rom while the guest is reading it there is a
QXL_IO_CLIENT_MONITORS_CONFIG_DONE that is expected after each
interrupt notification.

A guest capability is added, the server will use the old (pass to agent)
behavior unless it is present.
---
 spice/qxl_dev.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h
index 5de0eb8..d36465c 100644
--- a/spice/qxl_dev.h
+++ b/spice/qxl_dev.h
@@ -97,6 +97,7 @@ enum {
     /* appended for qxl-4 */
     QXL_IO_MONITORS_CONFIG_ASYNC,
     QXL_IO_CAPABILITIES_SET,
+    QXL_IO_CLIENT_MONITORS_CONFIG_DONE,
 
     QXL_IO_RANGE_SIZE
 };
@@ -126,6 +127,13 @@ typedef struct SPICE_ATTR_PACKED QXLRect {
     int32_t right;
 } QXLRect;
 
+typedef struct SPICE_ATTR_PACKED QXLURect {
+    uint32_t top;
+    uint32_t left;
+    uint32_t bottom;
+    uint32_t right;
+} QXLURect;
+
 /* qxl-1 compat: append only */
 typedef struct SPICE_ATTR_PACKED QXLRom {
     uint32_t magic;
@@ -152,6 +160,11 @@ typedef struct SPICE_ATTR_PACKED QXLRom {
     /* appended for qxl-4 */
     uint8_t client_present;
     uint8_t client_capabilities[58];
+    struct {
+        uint16_t count;
+        uint8_t  pad[2];
+        QXLURect heads[63];
+    } client_monitors_config;
 } QXLRom;
 
 /* qxl-1 compat: fixed */
@@ -235,6 +248,9 @@ SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, QXL_RELEASE_RING_SIZE);
 #define QXL_INTERRUPT_IO_CMD (1 << 2)
 #define QXL_INTERRUPT_ERROR  (1 << 3)
 #define QXL_INTERRUPT_CLIENT (1 << 4)
+#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG  (1 << 5)
+
+#define QXL_GUEST_CAP_CLIENT_MONITORS_CONFIG_ISR 0
 
 /* qxl-1 compat: append only */
 typedef struct SPICE_ATTR_PACKED QXLRam {
-- 
1.7.12



More information about the Spice-devel mailing list