From f11ac1cace1097d0ed8778472028b6f9292d2766 Mon Sep 17 00:00:00 2001 Message-Id: From: Soren Sandmann Date: Wed, 10 Oct 2012 19:15:44 +0200 Subject: [PATCH 1/3] qxl: Add set_client_capabilities() interface to QXLInterface RH-Author: Soren Sandmann Message-id: <1349896546-17500-2-git-send-email-ssp@redhat.com> Patchwork-id: 42944 O-Subject: [PATCH RHEL6.4 qemu-kvm v2 1/3] qxl: Add set_client_capabilities() interface to QXLInterface Bugzilla: 860017 RH-Acked-by: Gerd Hoffmann RH-Acked-by: Hans de Goede RH-Acked-by: Alon Levy This new interface lets spice server inform the guest whether (a) a client is connected (b) what capabilities the client has There is a fixed number (464) of bits reserved for capabilities, and when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt is generated. Signed-off-by: Soren Sandmann Signed-off-by: Gerd Hoffmann (Cherry-picked from c10018d6c77c94a8c703b9e4f026da74cad73d9e) BZ: 860017 Upstream-status: applied Cc: Hans de Goede Cc: Gerd Hoffmann Cc: Alon Levy Cc: Paolo Bonzini --- hw/qxl.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) Signed-off-by: Michal Novotny --- hw/qxl.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hw/qxl.c b/hw/qxl.c index 05abe91..dc5f4bb 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -863,6 +863,26 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token) } } +#if SPICE_SERVER_VERSION >= 0x000b04 + +/* called from spice server thread context only */ +static void interface_set_client_capabilities(QXLInstance *sin, + uint8_t client_present, + uint8_t caps[58]) +{ + PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl); + + qxl->shadow_rom.client_present = client_present; + memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps)); + qxl->rom->client_present = client_present; + memcpy(qxl->rom->client_capabilities, caps, sizeof(caps)); + qxl_rom_set_dirty(qxl); + + qxl_send_events(qxl, QXL_INTERRUPT_CLIENT); +} + +#endif + static const QXLInterface qxl_interface = { .base.type = SPICE_INTERFACE_QXL, .base.description = "qxl gpu", @@ -884,6 +904,9 @@ static const QXLInterface qxl_interface = { .flush_resources = interface_flush_resources, .async_complete = interface_async_complete, .update_area_complete = interface_update_area_complete, +#if SPICE_SERVER_VERSION >= 0x000b04 + .set_client_capabilities = interface_set_client_capabilities, +#endif }; static void qxl_enter_vga_mode(PCIQXLDevice *d) -- 1.7.11.7