From: Søren Sandmann Pedersen Date: Tue, 4 Sep 2012 14:14:48 +0000 (-0400) Subject: qxl: Add set_client_capabilities() interface to QXLInterface X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~3605^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c10018d6c77c94a8c703b9e4f026da74cad73d9e;p=sdk%2Femulator%2Fqemu.git qxl: Add set_client_capabilities() interface to QXLInterface 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 --- diff --git a/hw/qxl.c b/hw/qxl.c index 8725f67..2aa5848 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -944,6 +944,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", @@ -965,6 +985,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)