From patchwork Mon Aug 27 17:20:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B8ren_Sandmann?= X-Patchwork-Id: 180271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8F9C12C0096 for ; Tue, 28 Aug 2012 05:29:05 +1000 (EST) Received: from localhost ([::1]:37475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T64XO-0001JD-7L for incoming@patchwork.ozlabs.org; Mon, 27 Aug 2012 14:59:50 -0400 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 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 q7RHIXda003486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Aug 2012 13:18:33 -0400 Received: from dhcp-100-3-184.bos.redhat.com (dhcp-189-4.bos.redhat.com [10.16.189.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7RHIT4J004545; Mon, 27 Aug 2012 13:18:32 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= To: spice-devel@freedesktop.org, qemu-devel@nongnu.org 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 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q7RHIXda003486 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Mon, 27 Aug 2012 14:59:28 -0400 Cc: kraxel@redhat.com, =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Subject: [Qemu-devel] [PATCH] qxl: Add set_client_capabilities() interface to QXLInterface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Søren 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 *sin, uint64_t cookie_token) } } +/* 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 = container_of(sin, PCIQXLDevice, ssd.qxl); + + qxl->shadow_rom.client_present = client_present; + memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps)); + qxl->rom->client_present = 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 = { .base.type = SPICE_INTERFACE_QXL, .base.description = "qxl gpu", @@ -922,6 +938,7 @@ static const QXLInterface qxl_interface = { .flush_resources = interface_flush_resources, .async_complete = interface_async_complete, .update_area_complete = interface_update_area_complete, + .set_client_capabilities = interface_set_client_capabilities, }; static void qxl_enter_vga_mode(PCIQXLDevice *d) @@ -1785,6 +1802,10 @@ static int qxl_init_common(PCIQXLDevice *qxl) io_size = 16; break; case 3: /* qxl-3 */ + pci_device_rev = QXL_REVISION_STABLE_V10; + io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); + break; + case 5: default: pci_device_rev = QXL_DEFAULT_REVISION; io_size = 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) -#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10 +#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V13 /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);