From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55084 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkUrW-0003bM-6O for qemu-devel@nongnu.org; Wed, 02 Feb 2011 00:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkUrU-0006Zs-4N for qemu-devel@nongnu.org; Wed, 02 Feb 2011 00:02:37 -0500 Received: from leo.clearchain.com ([199.73.29.74]:46387 helo=mail.clearchain.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkUrT-0006Yu-Iq for qemu-devel@nongnu.org; Wed, 02 Feb 2011 00:02:36 -0500 Date: Wed, 2 Feb 2011 14:48:25 +1000 From: Peter Hutterer Message-ID: <20110202044825.GB27032@barra.bne.redhat.com> References: <4D416F07.6060604@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D416F07.6060604@redhat.com> Subject: [Qemu-devel] Re: paravirtual mouse/tablet, v5 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: spice-devel , "qemu-devel@nongnu.org" sorry, late again. conference last week. On Thu, Jan 27, 2011 at 02:11:35PM +0100, Gerd Hoffmann wrote: > Next revision the pvmouse protocol. It is quite different now, I've > decided to move to a model with one message per updated value, > simliar to the linux input layer. There isn't a "mouse move" > message any more. A mouse move event will be three messages now: > one to update X, one to update Y and a third sync message to mark > the end of the message block. That should be *alot* easier to > extend in the future. I like this approach, it's a lot more flexible and quite close to what the linux kernel already does. Having said that, I'm thinking why not do exactly what the linux kernel does? * the kernel has a stable API that has a number of users and is well understood, plus * it allows for code re-use on the consumer side * you'd need to do protocol conversion anyway. having the same API means at least one platform (i.e. linux) can skip the conversion. * MT is being worked on by a number of people and two protocols that cater for current hardware (with and without HW tracking features). trying to duplicate this means we'll likely re-do the same mistakes. fwiw, this protocol is already quite similar MSG_SYNC is SYN_REPORT MSG_POINT is SYN_MT_REPORT AXIS x is the same as EV_ABS + ABS_X there may be some optimization for networks of course if you want to change the message format but at least the principle seems sound enough. > Header file is attached. Comments are welcome. > > thanks, > Gerd > #ifndef __QEMU_PVMOUSE__ > #define __QEMU_PVMOUSE__ 1 > > /* > * qemu patavirtual mouse/tablet interface > * > * quick overview > * ============== > * > * device initialization > * --------------------- > * > * (1) host sends INIT with supported feature bits > * (2) guests sends ACK to ack the features it is > * able to handle (and willing to use). what's the effect of a guest not able to handle certain features? The host filters them? > * (3) host sends a INFO message for each button and > * each axis supported. More INFO messages might > * follow for features added to the protocol later > * on if enabled by the INIT+ACK handshake. > * A SYNC message marks the end of the device > * information messages. > * > * input event reporting > * --------------------- > * > * host sends one or more BTN_DOWN, BTN_UP and AXIS messages, > * followed by a SYNC. A button press would be just BTN_DOWN+SYNC. > * A mouse move would be two AXIS messages (one for x, one for y) > * followed by SYNC. fwiw, kernel doesn't have BTN_DOWN events but rather BTN_FOO 0 or 1 events (for released and pressed, respectively). Same for keys, which also allows keys to have a value of 2 for autorepeat. it provides more symmetry as well because currently you have AXIS BTN_DOWN