From patchwork Sun Sep 2 21:35:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B8ren_Sandmann_Pedersen?= X-Patchwork-Id: 181291 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 9BC972C0095 for ; Mon, 3 Sep 2012 14:21:42 +1000 (EST) Received: from localhost ([::1]:48650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8OAO-0005Zn-LE for incoming@patchwork.ozlabs.org; Mon, 03 Sep 2012 00:21:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Hmi-0003t6-Hg for qemu-devel@nongnu.org; Sun, 02 Sep 2012 17:32:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8Hmh-0006Qe-3c for qemu-devel@nongnu.org; Sun, 02 Sep 2012 17:32:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Hmg-0006Pw-Qj for qemu-devel@nongnu.org; Sun, 02 Sep 2012 17:32:47 -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 q82LWiG8016592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 Sep 2012 17:32:44 -0400 Received: from dhcp-100-3-184.bos.redhat.com (dhcp-189-4.bos.redhat.com [10.16.189.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q82LWgWn007933; Sun, 2 Sep 2012 17:32:44 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= To: qemu-devel@nongnu.org, spice-devel@lists.freedesktop.org Date: Sun, 2 Sep 2012 17:35:22 -0400 Message-Id: <1346621726-11313-3-git-send-email-ssp@redhat.com> In-Reply-To: <1346621726-11313-1-git-send-email-ssp@redhat.com> References: <5040688D.5070707@redhat.com> <1346621726-11313-1-git-send-email-ssp@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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, 03 Sep 2012 00:21:26 -0400 Cc: kraxel@redhat.com, =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Subject: [Qemu-devel] [PATCH-v2 spice-protocol 2/2] Add new client_present and client capabilities fields to QXLRom 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 The client_present field is a byte that is set of non-zero when a client is connected and to zero when no client is connected. The client_capabilities[58] array contains 464 bits that indicate the capabilities of the client. Each bit corresponds to a SPICE_DISPLAY_CAP_* capability. In particular, if the client has capability C, then bit (C % 8) in byte (C / 8) is set. The capability bits only have a defined meaning when a client is connected, ie., when client_present is non-zero. The number 58 was chosen to fill out a cache line in QXLRom. A new QXL_INTERRUPT_CLIENT interrupt is defined, which will be raised whenever a client connects or disconnects. --- spice/qxl_dev.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h index 1292767..50784dc 100644 --- a/spice/qxl_dev.h +++ b/spice/qxl_dev.h @@ -148,7 +148,9 @@ typedef struct SPICE_ATTR_PACKED QXLRom { uint8_t slot_gen_bits; uint8_t slot_id_bits; uint8_t slot_generation; - uint8_t padding[3]; /* Padding to 32bit align */ + /* appended for qxl-4 */ + uint8_t client_present; + uint8_t client_capabilities[58]; } QXLRom; /* qxl-1 compat: fixed */ @@ -231,6 +233,7 @@ SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, QXL_RELEASE_RING_SIZE); #define QXL_INTERRUPT_CURSOR (1 << 1) #define QXL_INTERRUPT_IO_CMD (1 << 2) #define QXL_INTERRUPT_ERROR (1 << 3) +#define QXL_INTERRUPT_CLIENT (1 << 4) /* qxl-1 compat: append only */ typedef struct SPICE_ATTR_PACKED QXLRam {