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