Blame 0213-qxl-Add-set_client_capabilities-interface-to-QXLInte.patch

Hans de Goede c8dfc6
From 44eab2c48c8b090fff8b7ded39b40dae6c6ce003 Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp@redhat.com>
Hans de Goede c8dfc6
Date: Tue, 4 Sep 2012 10:14:48 -0400
Hans de Goede c8dfc6
Subject: [PATCH 213/215] qxl: Add set_client_capabilities() interface to
Hans de Goede c8dfc6
 QXLInterface
Hans de Goede c8dfc6
Hans de Goede c8dfc6
This new interface lets spice server inform the guest whether
Hans de Goede c8dfc6
Hans de Goede c8dfc6
(a) a client is connected
Hans de Goede c8dfc6
(b) what capabilities the client has
Hans de Goede c8dfc6
Hans de Goede c8dfc6
There is a fixed number (464) of bits reserved for capabilities, and
Hans de Goede c8dfc6
when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt
Hans de Goede c8dfc6
is generated.
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Hans de Goede c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede c8dfc6
---
Hans de Goede c8dfc6
 hw/qxl.c | 23 +++++++++++++++++++++++
Hans de Goede c8dfc6
 1 file changed, 23 insertions(+)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/hw/qxl.c b/hw/qxl.c
Hans de Goede c8dfc6
index 8725f67..2aa5848 100644
Hans de Goede c8dfc6
--- a/hw/qxl.c
Hans de Goede c8dfc6
+++ b/hw/qxl.c
Hans de Goede c8dfc6
@@ -944,6 +944,26 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
+#if SPICE_SERVER_VERSION >= 0x000b04
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
+/* called from spice server thread context only */
Hans de Goede c8dfc6
+static void interface_set_client_capabilities(QXLInstance *sin,
Hans de Goede c8dfc6
+                                              uint8_t client_present,
Hans de Goede c8dfc6
+                                              uint8_t caps[58])
Hans de Goede c8dfc6
+{
Hans de Goede c8dfc6
+    PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
+    qxl->shadow_rom.client_present = client_present;
Hans de Goede c8dfc6
+    memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps));
Hans de Goede c8dfc6
+    qxl->rom->client_present = client_present;
Hans de Goede c8dfc6
+    memcpy(qxl->rom->client_capabilities, caps, sizeof(caps));
Hans de Goede c8dfc6
+    qxl_rom_set_dirty(qxl);
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
+    qxl_send_events(qxl, QXL_INTERRUPT_CLIENT);
Hans de Goede c8dfc6
+}
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
+#endif
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
 static const QXLInterface qxl_interface = {
Hans de Goede c8dfc6
     .base.type               = SPICE_INTERFACE_QXL,
Hans de Goede c8dfc6
     .base.description        = "qxl gpu",
Hans de Goede c8dfc6
@@ -965,6 +985,9 @@ static const QXLInterface qxl_interface = {
Hans de Goede c8dfc6
     .flush_resources         = interface_flush_resources,
Hans de Goede c8dfc6
     .async_complete          = interface_async_complete,
Hans de Goede c8dfc6
     .update_area_complete    = interface_update_area_complete,
Hans de Goede c8dfc6
+#if SPICE_SERVER_VERSION >= 0x000b04
Hans de Goede c8dfc6
+    .set_client_capabilities = interface_set_client_capabilities,
Hans de Goede c8dfc6
+#endif
Hans de Goede c8dfc6
 };
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
 static void qxl_enter_vga_mode(PCIQXLDevice *d)
Hans de Goede c8dfc6
-- 
Hans de Goede c8dfc6
1.7.12
Hans de Goede c8dfc6