From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYbbu-0004Eq-7e for qemu-devel@nongnu.org; Fri, 11 Apr 2014 09:35:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYbbn-0003rm-0Y for qemu-devel@nongnu.org; Fri, 11 Apr 2014 09:35:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYbbm-0003qJ-PK for qemu-devel@nongnu.org; Fri, 11 Apr 2014 09:35:06 -0400 Message-ID: <1397223298.22291.121.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Fri, 11 Apr 2014 15:34:58 +0200 In-Reply-To: <20110202044825.GB27032@barra.bne.redhat.com> References: <4D416F07.6060604@redhat.com> <20110202044825.GB27032@barra.bne.redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] paravirtual mouse/tablet, v5 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Hutterer Cc: spice-devel , "qemu-devel@nongnu.org" , "Michael S. Tsirkin" On Mi, 2011-02-02 at 14:48 +1000, Peter Hutterer wrote: ^^^^^^^^^^ FYI: It's been a while ... > 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? ... but there is working code now, doing exactly that. There is a new virtio input device, which basically sends evdev events over virtio. specs: http://www.kraxel.org/cgit/virtio-spec/log/?h=virtio-input linux kernel: http://www.kraxel.org/cgit/linux/log/?h=virtio-input qemu (also containing some unrelated qemu input stuff): http://www.kraxel.org/cgit/qemu/log/?h=rebase/input-wip Of course it's not limited to a mouse, there is a virtio keyboard too, and we can pass through any host input device to the guest. cheers, Gerd [ leaving full quote below for those which might look at it for historical interest ] > * 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