From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ab3-000667-Lk for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8aaz-00087Q-09 for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:38:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8aay-00087J-Ll for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:37:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q83HbtsS028542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Sep 2012 13:37:55 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Mon, 3 Sep 2012 13:40:54 -0400 Message-Id: <1346694054-22370-1-git-send-email-sandmann@cs.au.dk> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] 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?= 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 | 27 +++++++++++++++++++++++++++ hw/qxl.h | 2 +- 2 files changed, 28 insertions(+), 1 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index c2dd3b4..ffe1a76 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) @@ -1785,6 +1808,10 @@ static int qxl_init_common(PCIQXLDevice *qxl) io_size =3D 16; break; case 3: /* qxl-3 */ + pci_device_rev =3D QXL_REVISION_STABLE_V10; + io_size =3D msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); + break; + case 4: default: pci_device_rev =3D QXL_DEFAULT_REVISION; io_size =3D msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); diff --git a/hw/qxl.h b/hw/qxl.h index 172baf6..98d5a64 100644 --- a/hw/qxl.h +++ b/hw/qxl.h @@ -128,7 +128,7 @@ typedef struct PCIQXLDevice { } = \ } while (0) =20 -#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10 +#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V12 =20 /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); --=20 1.7.4