Received: from eggs.gnu.org ([208.118.235.92]:33333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8trC-0002T7-1M for qemu-devel@nongnu.org; Tue, 04 Sep 2012 10:12:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8tr2-0005VK-I7 for qemu-devel@nongnu.org; Tue, 04 Sep 2012 10:11:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8tr2-0005V4-9D for qemu-devel@nongnu.org; Tue, 04 Sep 2012 10:11:48 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q84EBk25032481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Sep 2012 10:11:47 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Tue, 4 Sep 2012 10:14:48 -0400 Message-Id: <1346768089-14774-1-git-send-email-sandmann@cs.au.dk> In-Reply-To: <5045D424.6030903@redhat.com> References: <5045D424.6030903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/2] qxl: Add set_client_capabilities() interface to QXLInterface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com Cc: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= From: S=C3=B8ren Sandmann Pedersen 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 --- hw/qxl.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index c2dd3b4..572daa9 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -901,6 +901,26 @@ static void interface_async_complete(QXLInstance *si= n, uint64_t cookie_token) } } =20 +#if SPICE_SERVER_VERSION >=3D 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 =3D container_of(sin, PCIQXLDevice, ssd.qxl); + + qxl->shadow_rom.client_present =3D client_present; + memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps)); + qxl->rom->client_present =3D 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 =3D { .base.type =3D SPICE_INTERFACE_QXL, .base.description =3D "qxl gpu", @@ -922,6 +942,9 @@ static const QXLInterface qxl_interface =3D { .flush_resources =3D interface_flush_resources, .async_complete =3D interface_async_complete, .update_area_complete =3D interface_update_area_complete, +#if SPICE_SERVER_VERSION >=3D 0x000b04 + .set_client_capabilities =3D interface_set_client_capabilities, +#endif }; =20 static void qxl_enter_vga_mode(PCIQXLDevice *d) --=20 1.7.4