From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPP-0003Rx-C0 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9WPI-0001HG-Ny for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPI-0001Ga-Ea for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:44 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q867LhOx020590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Sep 2012 03:21:43 -0400 From: Gerd Hoffmann Date: Thu, 6 Sep 2012 09:21:39 +0200 Message-Id: <1346916100-12958-14-git-send-email-kraxel@redhat.com> In-Reply-To: <1346916100-12958-1-git-send-email-kraxel@redhat.com> References: <1346916100-12958-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 13/14] 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 Cc: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= , Gerd Hoffmann 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 Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) 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 *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", @@ -965,6 +985,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.1