From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTQMS-00030N-3Q for qemu-devel@nongnu.org; Wed, 13 Aug 2008 20:06:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTQMQ-00030B-F5 for qemu-devel@nongnu.org; Wed, 13 Aug 2008 20:06:39 -0400 Received: from [199.232.76.173] (port=33503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTQMQ-000308-Bj for qemu-devel@nongnu.org; Wed, 13 Aug 2008 20:06:38 -0400 Received: from smtp6-g19.free.fr ([212.27.42.36]:48862) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTQMP-0000VF-U1 for qemu-devel@nongnu.org; Wed, 13 Aug 2008 20:06:38 -0400 Received: from smtp6-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp6-g19.free.fr (Postfix) with ESMTP id 4ABF41970A for ; Thu, 14 Aug 2008 02:06:34 +0200 (CEST) Received: from laptop (vaf26-2-82-244-111-82.fbx.proxad.net [82.244.111.82]) by smtp6-g19.free.fr (Postfix) with ESMTP id 29863196F7 for ; Thu, 14 Aug 2008 02:06:34 +0200 (CEST) From: "=?windows-1252?q?Fran=E7ois?= Revol" Date: Thu, 14 Aug 2008 02:07:59 +0200 CEST Message-Id: <1498140435-BeMail@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] [RFC] usb-wacom 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 Hi there. We use QEMU a lot to debug Haiku, http://haiku-os.org/ I also wrote a little php script that use it to demo images online, serving a VNC java applet to connect to it with VNC. http://dev.haiku-os.org/browser/haiku/trunk/3rdparty/mmu=5Fman/onlinedemo/haiku.php It's a bit like what live.OSZoo does, but simpler. To accomodate the VNC setup, I tried to use the usb tablet emulation. It turns out Haiku has a driver for Wacom tablets: http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/kernel/drivers/input/wacom http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/input=5Fserver/devices/wacom However, it didn't really work very well with qemu's usb-wacom code. First, mouse stayed in the top-left corner... Seems coords were set to 0,0 when no button is pressed, which is wrong, most tablets actually sense the stylus even when it's not yet touching the surface. Also, coords were wrong. Our driver takes the pos from the hardware, and scales them from model- dependant hardcoded max values: http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/input=5Fserver/devices/wacom/TabletDevice.cpp#L115 down to [0.0f, 1.0f], which represents the whole screen. Since QEMU reports absolute mouse position scaled from screen size to INT16=5FMAX this didn't really work. Now, I'm not sure those max values are correct for all Penpartner devices, or if they were calibrated on a specific item. Best would be to actually read them from the HID descriptor, but QEMU doesn't provide one, and I read some penpartner tablets actually have wrong descriptors anyway. Finaly, I fixed button handling according to our driver, not sure all drivers handle them the same. pressure indicates left button, and a flag tells about right one. I mapped middle button to the eraser to at least be useful in tablet-aware software though I'm not sure it's the best way. And... oh well seems we don't need to tell we have a contact, the driver assumes it always for penpartner so it seems correct. I left debug macro I used just in case. http://revolf.free.fr/beos/patches/qemu-usb-wacom-for-haiku.diff.txt Now at least it works perfectly with our driver, appart from high cpu usage but that's surely be fixed by polling less often. Comments =3F Fran=E7ois.