From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T62xQ-0000gE-8G for qemu-devel@nongnu.org; Mon, 27 Aug 2012 13:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T62xO-000864-VE for qemu-devel@nongnu.org; Mon, 27 Aug 2012 13:18:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T62xO-00085r-Gd for qemu-devel@nongnu.org; Mon, 27 Aug 2012 13:18:34 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 27 Aug 2012 13:20:40 -0400 Message-Id: <1346088041-17062-4-git-send-email-sandmann@cs.au.dk> In-Reply-To: <1346088041-17062-1-git-send-email-sandmann@cs.au.dk> References: <1346088041-17062-1-git-send-email-sandmann@cs.au.dk> 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: spice-devel@freedesktop.org, qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?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 | 21 +++++++++++++++++++++ hw/qxl.h | 2 +- 2 files changed, 22 insertions(+), 1 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index c2dd3b4..690743a 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -901,6 +901,22 @@ static void interface_async_complete(QXLInstance *si= n, uint64_t cookie_token) } } =20 +/* 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); +} + static const QXLInterface qxl_interface =3D { .base.type =3D SPICE_INTERFACE_QXL, .base.description =3D "qxl gpu", @@ -922,6 +938,7 @@ 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, + .set_client_capabilities =3D interface_set_client_capabilities, }; =20 static void qxl_enter_vga_mode(PCIQXLDevice *d) @@ -1785,6 +1802,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 5: 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..a130f19 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_V13 =20 /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); --=20 1.7.4