 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC] kbdif: add multi-touch support
 First of all, thank you for comments On 01/04/2017 03:03 AM, Stefano Stabellini wrote: On Tue, 3 Jan 2017, Oleksandr Andrushchenko wrote:From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx> Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx> --- 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 pixelsPlease write down the max width and height supported by the protocol, keeping in mind that motion events below use int32_t for coordinates. I will put "width(height) of the... in pixels, 32-bit signed integer" Are there any benefits of this compared to just setting up multiple kbd connections, one per multi-touch device? The only benefit I can think of is saving few pages. Well, not only saving a few pages, but somewhat simplifying handling of the protocol on both back and front ends. But, you are probably right as current protocol is capable of holding (XENKBD_IN_RING_SIZE - XENKBD_IN_RING_OFFS) / XENKBD_IN_EVENT_SIZE == (2048 - 1024) / 40 = 25 incoming events which may not be enough for multiple mt devices delivering hundreds of events per second. Will set-up dedicated rings per mt device then. Will also remove uint8_t dev_idx; /* index of the multi-touch device */ as every device will have its own ring. Will extend XenStore configuration for mt devices with: o page-ref (?) o page-gref o event-channel as it is done by the Linux xen-kbdfront driver. BTW, is there any reason we need "page-ref"? My understanding is that the pair of page-gref + event-channel is enough to establish and uniquely identify the connection. 
 Instead of setting the number of mt devices front can easily find this value by reading "mt-%d" XenStore entries. The requirement in the protocol is that "...%d being a sequential number of the virtual input device". Thus, first entry which we fail to sequentially read will indicate end of configured devices. Of course, xenbus_scanf return value needs to be checked if it has failed because there is no such value in XenStore or for any other reason. +/* 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.Will be reused or can be reused? I would probably say "may be reused" as it depends on how and if new touches/contacts are made Please provide an example of a Contact ID lifecycle. Do you want it to be described in the protocol or just here? If the latter then, for example, as Wayland documentation describes it [1]: "Touch interactions can consist of one or more contacts. For each contact, a series of events is generated, starting with a down event, followed by zero or more motion events, and ending with an up event. Events relating to the same contact point can be identified by the ID of the sequence." So, if there is contact/touch a free Contact ID is assigned to this contact(sequence) and it is "released" when contact is done, e.g. after up event. From this point contact ID may be reused. I was basing the mt additions to the protocol on Wayland [1], Linux [2] and Windows [3] multi-touch support, so those may better explain the idea What is the max Contact ID? /* contact ID, [0; num-contacts - 1] */ num-contacts - number of simultaneous touches supported 
 Could you please elaborate more on this, this is not clear to me. #define XENKBD_IN_EVENT_SIZE 40union xenkbd_in_event 
Related question: what if I also extend existing
xenkbd_motion/key/position by adding uint32(8?)_t dev_idx
at the bottom of the structures, e.g.
struct xenkbd_motion {
    uint8_t type;        /* XENKBD_TYPE_MOTION */
    int32_t rel_x;        /* relative X motion */
    int32_t rel_y;        /* relative Y motion */
    int32_t rel_z;        /* relative Z motion (wheel) */
    uint32_t dev_idx; or uint8_t dev_idx;
};
This way:
1. Existing fronts/backs will not be affected
2. New fronts/backs may use this field to serve
multiple keyboards and/or pointer devices via single ring
Should I make this change as a dedicated patch or do you think
it can be in the same one for mt?
Thank you,
Oleksandr
[1] 
https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2196[2] https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt[3] https://msdn.microsoft.com/en-us/library/jj151564(v=vs.85).aspx#optional_hid_usages _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel 
 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |