From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FSRfB-0008Is-01 for qemu-devel@nongnu.org; Sun, 09 Apr 2006 00:36:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FSRf9-0008I0-Ae for qemu-devel@nongnu.org; Sun, 09 Apr 2006 00:36:36 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSRf9-0008Hv-5G for qemu-devel@nongnu.org; Sun, 09 Apr 2006 00:36:35 -0400 Received: from [32.97.110.153] (helo=e35.co.us.ibm.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FSRjU-00063v-2R for qemu-devel@nongnu.org; Sun, 09 Apr 2006 00:41:04 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k394aUjo001756 for ; Sun, 9 Apr 2006 00:36:30 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k394djn5183306 for ; Sat, 8 Apr 2006 22:39:45 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k394aUOM015790 for ; Sat, 8 Apr 2006 22:36:30 -0600 Received: from [9.65.96.20] (sig-9-65-96-20.mts.ibm.com [9.65.96.20]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k394aTOw015704 for ; Sat, 8 Apr 2006 22:36:29 -0600 Message-ID: <44388F43.20207@us.ibm.com> Date: Sat, 08 Apr 2006 23:36:19 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Absolute USB-HID device musings (was Re: VNC Terminal Server) References: <443802FB.9060700@win4lin.com> <44381AE0.1020106@wasp.net.au> <443825D8.3080602@win4lin.com> In-Reply-To: <443825D8.3080602@win4lin.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I was looking through the Xorg evdev driver and it doesn't appear to support absolute coordinate reporting. evdev is how the USB mouse would show up to userspace. A little googling confirmed it for me: http://lists.freedesktop.org/archives/xorg/2005-September/010140.html USB wacom still seems the most promising to me but I fear getting it to work under Windows will be a pain. Regards, Anthony Liguori Leonardo E. Reiter wrote: > This is by no means a complete patch (do not apply it as it will break > usb-hid.c), but it adjusts the report descriptor in usb-hid.c to > provide position in 16-bits, and in absolute coordinates: > > Index: usb-hid.c > =================================================================== > RCS file: /cvsroot/qemu/qemu/hw/usb-hid.c,v > retrieving revision 1.1 > diff -a -u -r1.1 usb-hid.c > --- usb-hid.c 5 Nov 2005 16:57:08 -0000 1.1 > +++ usb-hid.c 8 Apr 2006 20:56:02 -0000 > @@ -117,7 +117,7 @@ > 0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01, > 0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01, > 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, > - 0x25, 0x7F, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, > + 0x25, 0x7F, 0x75, 0x16, 0x95, 0x02, 0x81, 0x02, > 0xC0, 0xC0, > }; > > According to: > http://72.14.203.104/search?q=cache:wVYUTwc33f8J:www.usb.org/developers/devclass_docs/HID1_11.pdf+usb+hid+specification+absolute+relative&hl=en&gl=us&ct=clnk&cd=1 > > > I'm still trying to figure out how the logical min/max apply if we are > to report absolute (unsigned) positions in 16-bits. Obviously 8-bits > is not enough for absolute coordinates. You could theoretically use > only 12-bits per coordinate but that would make life difficult I > think, and probably unnecessarily frugal in a software emulation. > > It's not clear to me [yet] how the scroll wheel comes into play, and > whether or not it (the dz coordinate) can be kept relative for ease of > implementation. Also the code would need to be changed to report > coordinates in 16-bits rather than 8, and of course made to report > absolute coordinates (like from sdl.c, etc.) Still it looks fairly > easy to implement - the USB spec is pretty simple. > > So to reiterate, my patch does virtually nothing - in fact it will > break usb-hid.c so please don't use it. I was just illustrating how > to get it to report the device as providing 16-bit absolute > coordinates instead of 8-bit relative ones. If anyone wants to chime > in with more info, I'd be glad to make this a discussion. *If* using > the USB HID device only, not any real USB devices, can be done without > slowing down QEMU, then I think this is a great way to get a tablet > emulated without having to deal with drivers on either side. Plus, in > the long run, it probably means other neat stuff like being able to > get away from ISA bus emulation, and also it's portable to other > targets (for example, OS-X on PPC would talk to the USB HID device the > same way theoretically), so it's likely the most portable and cleanest > option. > > Regards, > > Leo Reiter > > Brad Campbell wrote: >> Apparently USB HID supports absolute input devices natively. Given we >> have a HID mouse driver of sorts in qemu I wonder if that is another >> avenue perhaps ? >> >> >