From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8bH9-0000BZ-83 for qemu-devel@nongnu.org; Mon, 03 Sep 2012 14:21:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8bH7-0004HU-6e for qemu-devel@nongnu.org; Mon, 03 Sep 2012 14:21:31 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:56031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8bH6-0004HI-UT for qemu-devel@nongnu.org; Mon, 03 Sep 2012 14:21:29 -0400 Date: Mon, 3 Sep 2012 14:21:27 -0400 (EDT) From: Alon Levy Message-ID: <1378362483.25717138.1346696487785.JavaMail.root@redhat.com> In-Reply-To: <1346694054-22370-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: Re: [Qemu-devel] [PATCH] qxl: Add set_client_capabilities() interface to QXLInterface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: =?utf-8?Q?S=C3=B8ren?= Sandmann Pedersen , qemu-devel@nongnu.org > From: S=C3=B8ren Sandmann Pedersen >=20 > This new interface lets spice server inform the guest whether >=20 > (a) a client is connected > (b) what capabilities the client has >=20 > There is a fixed number (464) of bits reserved for capabilities, and > when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt > is generated. >=20 > Signed-off-by: Soren Sandmann > --- > hw/qxl.c | 27 +++++++++++++++++++++++++++ > hw/qxl.h | 2 +- > 2 files changed, 28 insertions(+), 1 deletions(-) >=20 > 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 > *sin, 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, > +=09=09=09=09=09 uint8_t client_present, > +=09=09=09=09=09 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 */ > +=09pci_device_rev =3D QXL_REVISION_STABLE_V10; > +=09io_size =3D msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); > +=09break; > + 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 QXL_REVISION_STABLE_V12 is only defined in latest spice-protocol, too new f= or the qemu required version. Gerd, maybe it's a good idea to require spice-protocol 0.12.1, now that it'= s released? this will remove a lot of cruft. > =20 > /* qxl.c */ > void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int > group_id); > -- > 1.7.4 >=20 >=20 >=20