From owner-freebsd-usb@freebsd.org Mon Jul 24 20:10:56 2017 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8137ED7EF37 for ; Mon, 24 Jul 2017 20:10:56 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) Received: from nm22-vm1.bullet.mail.bf1.yahoo.com (nm22-vm1.bullet.mail.bf1.yahoo.com [98.139.212.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E85976C71 for ; Mon, 24 Jul 2017 20:10:55 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1500927049; bh=sO2lJB3vT153sovLUyH7I0eKAy6lCpPGTEWvzVauC2A=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=rzS+DehXAQYYouEivybgDIsFWwcK9xnWM6i0eTRxnJ2JvI47TxhjJ5da6gSctDGa3jAdRQZYudMHx1L9M5N2NHbJjqS7coVAaReqcfQt9JKq64f/faTY7pOfqELfx63av+Kt0gA/77jtxBhsiaVP0a1Lvi7/02XBoazw9TwO4gffXZP/QZu63k68d2R8lCB9CeKNPq8vviBsVoxnZRyKIvxcy4GPbjT3VmVPSrwRHwmg4H84m1LlcYm8CMB1X7njvsI/tqdxLz1m5DtSr1+jdD78MDwtfW1OqZRTQI9mScVSKRT+m3GwCG3ROze8WbelYwzCdUjbFPbaudqzFLhVpA== Received: from [98.139.170.179] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 24 Jul 2017 20:10:49 -0000 Received: from [68.142.230.70] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 24 Jul 2017 20:10:49 -0000 Received: from [127.0.0.1] by smtp227.mail.bf1.yahoo.com with NNFMP; 24 Jul 2017 20:10:49 -0000 X-Yahoo-Newman-Id: 703210.81363.bm@smtp227.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FUnTsQMVM1lQ5qjYWhn5k6IIJDVBJA1oWhnQcMCYt6FZ.k3 PwLKhc4S0RjfKaXCdNEHH8aeqnCtfb.OIPUL2.jvvSeI8_ByUtKTtRBP_Hzt mStbrCzKuMV2mBIpOKNp79za8RvV92IHEQvVOWdtG0ktqG13gi8RUFGqSkWD 6zwp63uz7Y.kkYf0TxUiPOcXYKA875yjfQNWQtRlRK5bAW_MdpvGeJTujHMq ak9F0nZllWVi4MfWjfPWv1UejY21nWM7piEnbTW0M_CFDOvYAXyxe48E8v.h .YfcDg1JX4kpBTOIcBIsFko0hDfmzbue8z3dpwEe6_ZEyyvEzjt.PW_Zga05 K2pCbelTPeg8zLwvaIicHwqrinMtQ40ZAqsHqlOAdP8ahhDFbX5LQa2EAP0g JPvuxE2UZWDfluU6DA60S8cpeJUyWifH94FFsDpDue_NPrxr5jU97aAzr9dz ybTi2YVSV5imI9rldqt.z.xvAWwUzzcOM0mCOrgA4sK1Zb0uJfgqE52.y91W DW46hbi40_jUp0npRBUdI712J21tVDrQzLj4k8d6BRc35 X-Yahoo-SMTP: 9sPoSQ2swBBlERuQ.0vs8XLc_MeClW0- Subject: Re: PATCH: uep(4) support for (my) eGalax touchscreen To: freebsd-usb@freebsd.org References: <9be27e1a-aada-f53a-879f-24d7da4f42be@yahoo.com> From: Anthony Jenkins Message-ID: <743ccf34-cbf6-17a8-fa2c-d174ff56abee@yahoo.com> Date: Mon, 24 Jul 2017 16:10:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <9be27e1a-aada-f53a-879f-24d7da4f42be@yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2017 20:10:56 -0000 On 07/24/2017 03:28 PM, Anthony Jenkins via freebsd-usb wrote: > I'm trying to add support for uep(4) to detect and properly emit touch > events to x11-drivers/xf86-input-egalax. What I have works, but has som= e > issues, particularly: > > - close(2)ing the device node causes a USB_ST_ERROR in the > uep_intr_callback(); it's probably from my attempt to port an > initialization control message from Linux > - I massage the touch events from my device into the legacy uep(4) > event structure since my multitouch-supporting touchscreen has 12-bits > of resolution per axis, but legacy uep(4) only had 11 > - For some reason my Y-axis is inverted; I had to subtract its > coordinate from the max Y value. I'll probably add an ioctl(2) to set > axis inversion behavior dynamically rather than hardcode it. > - I capture all the multitouch info from the USB packets, but I don't > know (yet) if xf86-input-egalax can do anything with it > - x11-drivers/xf86-input-egalax's default min/max ranges are "silly" > (500/1500), but I didn't add the trivial patch to it. I'd like to add > an ioctl(2) that lets xf86-input-egalax query uep(4) for axis ranges, > but as I've written my patch, uep(4) doesn't know its ranges until it > gets a touch packet. > - I started adding support for evdev(4) reporting (added header files > and device struct members), but it's nowhere near finished. > - I have no idea how common this eGalax protocol is or how to determin= e > what protocol to use from the driver. Right now I assume a byte 0 of > 0x06 means "multitouch event". > - My x11-servers/xorg-server is patched to associate /dev/uep0 with th= e > xf86-input-egalax driver; I guess I'll have to make that available too.= =20 > My config/devd.c is substantially different from stock. The main problem with uep(4) was either xorg-server or xf86-input-egalax started doing asynchronous I/O on the device node using fcntl(F_SETOWN); the original uep(4) expected userland to open(2)/read(2) the device node. I had to add the FIOSETOWN support, but I don't know if there's a way to remove a process as owner (call fcntl(F_SETOWN, NULL)?). If so, I'll need to handle that case. I can stick this up in the FreeBSD code review site if desired. Anthony > Logging is sort of noisy at the moment when touching the screen, but it= > "Just Works (TM)" with my touchscreen, my slightly-patched > xf86-input-egalax driver and KDE4. > > uep(4) patch: > https://github.com/ScoobiFreeBSD/freebsd/commit/62c11d484d5fb61749240b4= 39612f852c5148222 > x11-servers/xorg-server patch: > https://github.com/ScoobiFreeBSD/freebsd-ports/commit/9465237f83ab8fb27= 249abfe803f94b6b8c3b945 > > Suggestions/comments welcome. Currently looking for help with the > USB_ST_ERROR issue, although I think I may know what's wrong (this is m= y > 1st attempt at USB stack programming). > > Anthony Jenkins > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" --=20 Anthony Jenkins