From patchwork Tue Jan 3 15:39:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 9495087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1CBF3606A7 for ; Tue, 3 Jan 2017 15:41:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CD2D26E69 for ; Tue, 3 Jan 2017 15:41:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20BC2271BC; Tue, 3 Jan 2017 15:41:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B88727031 for ; Tue, 3 Jan 2017 15:41:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cORBO-00062w-P2; Tue, 03 Jan 2017 15:39:26 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cORBN-00062p-D5 for xen-devel@lists.xenproject.org; Tue, 03 Jan 2017 15:39:25 +0000 Received: from [85.158.143.35] by server-4.bemta-6.messagelabs.com id 92/39-25093-CA5CB685; Tue, 03 Jan 2017 15:39:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXiVRvkorvmaHa EweR+LovvWyYzOTB6HP5whSWAMYo1My8pvyKBNePBcseCFpmK038nMDcwNol1MXJxCAnMZJRY v/I6C4jDIvCSRWLTmZPMII6EQD+rxPJzHUxdjJxATozE4nvP2SHsSolFk+YzgthCAooSX59NZ 4IYtZJJ4tfFhWBFbAJGEstv/GABsUUElCTurZoMVsQsMJNJouVNCytIQlhAV2Jqw3qwSSwCqh JHJx0B28Yr4Cjx6+UrZohtchI3z3WC2ZwCThK7t+9igdjsKPH82EKmCYwCCxgZVjFqFKcWlaU W6Rob6SUVZaZnlOQmZuboGhqY6eWmFhcnpqfmJCYV6yXn525iBAYXAxDsYDy9LvAQoyQHk5Io bzRDdoQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd4lR4BygkWp6akVaZk5wDCHSUtw8CiJ8PqBp HmLCxJzizPTIVKnGI05pj1b/JSJY0fnmqdMQix5+XmpUuK8USClAiClGaV5cINg8XeJUVZKmJ cR6DQhnoLUotzMElT5V4ziHIxKwrzGIFN4MvNK4Pa9AjqFCeiU7QFgp5QkIqSkGhjtMhz7Bb8 HRm/VMzD/G/B3z54jz1ky5s+34HygYhxgfNObRUsiy7hjqjG/z3mh0uBfx+bvUwy6NUnnQvSM 38E+CotzzXeo1UXaetxJKa+9cXKtDu/JaeW90iYFYhcn7Gm2uPp7qYrAn0fT2g/+aX+sH5cbE vKxeGMm+/K/BtwvPtmll+a4ySixFGckGmoxFxUnAgDDzVD9ugIAAA== X-Env-Sender: andr2000@gmail.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1483457964!50848668!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60959 invoked from network); 3 Jan 2017 15:39:24 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-11.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 3 Jan 2017 15:39:24 -0000 Received: by mail-wm0-f68.google.com with SMTP id m203so87124358wma.3 for ; Tue, 03 Jan 2017 07:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cCVGLlJmAV+zhtv874xYoX28sL+FhHdGfxuVQIE32/U=; b=U1Y6HGzcr1vLU0JfbWkA6LOTXM0rtmaEtTaqgkYS8HrXoaeTmbafzmrCq/ncgRCYm+ YzTXT+uu/3KpWBj56A/DNNP2wK9mW/FuFpvzl9w6QtZ878aUdld9O4lUFuRfVzSsP0Lc S/Q/2nXcCyoKGr3BujUPuMTwNOIswvUdhi082j5cfVTKyD5QQA30z5mLex8i3XRiWsIv BBwT44tmfAZnohZHDGq3x1Ibt8rNybEwwaO7+j5Y79keB02UORRVNjm5h4Vr9KkliJ+U b4ADZFfFoWvGXeAfBTEGPr0z8Eb1kEFtEm1JquzQ+KUiqXyS2TE8l5mVnqC91QHUvDKs wpmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cCVGLlJmAV+zhtv874xYoX28sL+FhHdGfxuVQIE32/U=; b=hUF4U+X80r9indjHDpUyAW4sdMoa7X0kTde9VPaXi9OvEC7PvfdIlfRk8jhTm4D4kg Jfk1lid1XcUHvERspns3a2wBIUeg0qkcFI23dFjcJUoLr+vxZhxcy83sT5jO+jgwoZ0U OMIYWaKixdP0sutBOWBLchQuV7Bu8zp0o4t+Qnc/t6MJe6/x3qUWiXQN0VsisnwBOsw5 zvGDBvD2HBfiOi6Nx7lt6nLL5I89z/OQ8/ybufiy17GBRDPaIcY0AvsjCs36FFB3INF8 1iS8ZH09hanhR56o4B0w86/7e4CMprBuzsYlSJLl5K+etCwTMHGy/tOV/CJJzHJZhl3d o/QQ== X-Gm-Message-State: AIkVDXLyb+JX1H4LRhREnYfOzIFihQgW7c6Qdm8MvyJDOsgL95JRfHexkfVRoR0YqiZq5Q== X-Received: by 10.28.105.78 with SMTP id e75mr60221173wmc.55.1483457963720; Tue, 03 Jan 2017 07:39:23 -0800 (PST) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id y3sm63761316wjy.34.2017.01.03.07.39.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jan 2017 07:39:23 -0800 (PST) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org Date: Tue, 3 Jan 2017 17:39:14 +0200 Message-Id: <1483457954-5566-2-git-send-email-andr2000@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483457954-5566-1-git-send-email-andr2000@gmail.com> References: <1483457954-5566-1-git-send-email-andr2000@gmail.com> Cc: lars.kurth@citrix.com, sstabellini@kernel.org, vlad.babchuk@gmail.com, dario.faggioli@citrix.com, julien.grall@arm.com, andrii.anisov@gmail.com, olekstysh@gmail.com, andr2000@gmail.com, al1img@gmail.com, JBeulich@suse.com, joculator@gmail.com Subject: [Xen-devel] [RFC] kbdif: add multi-touch support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Andrushchenko Signed-off-by: Oleksandr Andrushchenko --- xen/include/public/io/kbdif.h | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/xen/include/public/io/kbdif.h b/xen/include/public/io/kbdif.h index 2d2aebd..ad94b53 100644 --- a/xen/include/public/io/kbdif.h +++ b/xen/include/public/io/kbdif.h @@ -45,6 +45,19 @@ */ #define XENKBD_TYPE_POS 4 +/* + * Multi-touch event + * Capable backend sets feature-multi-touch in xenstore. + * Frontend requests feature by setting request-multi-touch in xenstore. + * Frontend supports up to XENKBD_MT_NUM_DEV virtual multi-touch input devices, + * configured by the backend in xenstore under mt-%d folder, %d being + * a sequential number of the virtual input device: + * o num-contacts - number of simultaneous touches supported + * o width - width of the touch area in pixels + * o height - height of the touch area in pixels + */ +#define XENKBD_TYPE_MTOUCH 5 + struct xenkbd_motion { uint8_t type; /* XENKBD_TYPE_MOTION */ @@ -68,6 +81,56 @@ struct xenkbd_position int32_t rel_z; /* relative Z motion (wheel) */ }; +/* number of simultaneously supported multi-touch virtual input devices */ +#define XENKBD_MT_NUM_DEV 4 + +/* Sent when a new touch is made: touch is assigned a unique contact + * ID, sent with this and consequent events related to this touch. + * Contact ID will be reused after XENKBD_MT_EV_UP event. + */ +#define XENKBD_MT_EV_DOWN 0 +/* Touch point has been released */ +#define XENKBD_MT_EV_UP 1 +/* Touch point has changed its coordinate(s) */ +#define XENKBD_MT_EV_MOTION 2 +/* Input synchronization event: shows end of a set of events + * which logically belong together. + */ +#define XENKBD_MT_EV_SYN 3 +/* Touch point has changed its shape. Shape is approximated by an ellipse + * through the major and minor axis lengths: major is the longer diameter + * of the ellipse and minor is the shorter one. Center of the ellipse is + * reported via XENKBD_MT_EV_DOWN/XENKBD_MT_EV_MOTION events. + */ +#define XENKBD_MT_EV_SHAPE 4 +/* Touch point's shape has changed its orientation: calculated as a clockwise + * angle between the major axis of the ellipse and positive Y axis in degrees, + * [-180; +180]. + */ +#define XENKBD_MT_EV_ORIENT 5 + +struct xenkbd_mtouch { + uint8_t type; /* XENKBD_TYPE_MTOUCH */ + uint8_t dev_idx; /* index of the multi-touch device */ + uint8_t event_type; /* XENKBD_MT_EV_??? */ + uint8_t reserved; /* reserved for the future use */ + int32_t contact_id; /* contact ID, [0; num-contacts - 1] */ + union { + /* XENKBD_MT_EV_DOWN/XENKBD_MT_EV_MOTION */ + struct { + int32_t abs_x; /* absolute X position, pixels */ + int32_t abs_y; /* absolute Y position, pixels */ + } pos; + /* XENKBD_MT_EV_SHAPE */ + struct { + uint32_t major; /* length of the major axis, pixels */ + uint32_t minor; /* length of the minor axis, pixels */ + } shape; + /* XENKBD_MT_EV_ORIENT */ + uint16_t orientation; /* clockwise angle of the major axis */ + } u; +}; + #define XENKBD_IN_EVENT_SIZE 40 union xenkbd_in_event @@ -76,6 +139,7 @@ union xenkbd_in_event struct xenkbd_motion motion; struct xenkbd_key key; struct xenkbd_position pos; + struct xenkbd_mtouch mtouch; char pad[XENKBD_IN_EVENT_SIZE]; };