From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbdBTV1y (ORCPT ); Mon, 20 Feb 2017 16:27:54 -0500 Received: from mo4-p04-ob.smtp.rzone.de ([81.169.146.177]:22481 "EHLO mo4-p04-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbdBTV1w (ORCPT ); Mon, 20 Feb 2017 16:27:52 -0500 X-RZG-CLASS-ID: mo04 X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKID81PEGeJp8= Subject: Re: [PATCH v9 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DBEB6E25-957A-4660-ACFE-D165692FA78F"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Pgp-Agent: GPGMail From: "H. Nikolaus Schaller" In-Reply-To: <201702202208.50498@pali> Date: Mon, 20 Feb 2017 22:27:39 +0100 Cc: Dmitry Torokhov , Sebastian Reichel , Mark Rutland , =?utf-8?Q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Russell King , Arnd Bergmann , Michael Welling , =?utf-8?Q?Mika_Penttil=C3=A4?= , Javier Martinez Canillas , Igor Grinberg , "Andrew F. Davis" , Mark Brown , Jonathan Cameron , Rob Herring , Alexander Stein , Eric Engestrom , Hans de Goede , Benjamin Tissoires , Petr Cvek , Mauro Carvalho Chehab , Hans Verkuil , Nick Dyer , Siebren Vroegindeweij , Michel Verlaan , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, letux-kernel@openphoenux.org, linux-iio@vger.kernel.org, kernel@pyra-handheld.com, Aaro Koskinen , Pavel Machek , Andrey Gelman , Haibo Chen Message-Id: References: <201702202042.15878@pali> <201702202208.50498@pali> To: =?utf-8?Q?Pali_Roh=C3=A1r?= X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_DBEB6E25-957A-4660-ACFE-D165692FA78F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 20.02.2017 um 22:08 schrieb Pali Roh=C3=A1r : >=20 > On Monday 20 February 2017 20:42:15 Pali Roh=C3=A1r wrote: >> Hi Nikolaus! >>=20 >> On Monday 20 February 2017 17:50:04 H. Nikolaus Schaller wrote: >>> Hi Dmitry, >>>=20 >>>> Input driver may set resolution for given axis in units per mm >>>> (or units per radian for rotational axis ABS_RX, ABS_RY, >>>> ABS_RZ), and if you check the binding, you can use >>>> "touchscreen-x-mm" and "touchscreen-y-mm" to specify the size of >>>> entire touch surface and set resolution from it so that >>>> userspace can calculate the proper scaling factor. >>>=20 >>> How is this information exposed by the kernel to user-space? By >>> scanning the DT file or tree? >>=20 >> Set input_abs_set_res() from kernel. And in userspace call EVIOCGABS >> ioctl() on input device. Look at struct input_absinfo, you should >> have all needed information here. This is generic input interface, >> no DT is needed. >=20 > Looking at kernel code... via EVIOCSABS ioctl() you can even set > resolution from userspace for specified input device. >=20 > So this could be potentially used for calibrating input device from > userspace? (In case DT data will not fully match current HW) >=20 >> I hope that XServer is already using it for evdev devices... >>=20 >> For whole implementation look at evtest program. That should be good >> starting point for your userspace implementation. >>=20 >> While I'm watching this discussion... in my opinion kernel should >> just invert input axes (when needed) It is questionable why it should do that at all then. User-Space can also easily do it. Either the driver should provide raw data only or if it does pre-processing (scaling by +/-1), why exclude pre-scaling by other factors? >> and should not do any other >> normalization or integer/floating-point >> re-calibration/re-calculation. If it correctly exports minimum >> value, maximum value and resolution then userspace can correctly >> re-scale input events to units which userspace needs (e.g. mapping >> into LCD screen pixels or whatever is needed). >=20 > -- > Pali Roh=C3=A1r > pali.rohar@gmail.com --Apple-Mail=_DBEB6E25-957A-4660-ACFE-D165692FA78F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYq19LAAoJEIl79TGLgAm644gQALBIU3doHmJLuu/w4V608d7D Y1r6IwKjUc0QbFDu7UufKehYRgW/fN3LMbgl+w/gddudIts+Rntrf2AY/P8q4FS3 cYWJ34WBApV8ITuwxLhfAb0ErGBsxYCA4VMTUJmyj5tiGkXdPqO/Sa0+/4GhSaNe 8gelyT7WintA05hK0vuo5b9StfvJm6Zn/9I53DDFjQtnM113YIa/oJ8HFtybXsc/ tcGOPbihkF/El6pvu+M6z3Nnyf0IJZtu6DEzKuxUwVkYuEE54d8zWlxups4gpsVJ LQ+gu8PlrGjNWYbBnl8nx7AZvEM+rVcr7Y+lrgZ2qQe/UAsM6M90DvMxlfqlvbIp DcRJiFAAoAlr+NWShtVba7T6qohuBkdAasLRE/rYuiILALzDn5XDD5s4px3WqrMC T2Ual/Xhd8Xp8bsEjCicBaJSvdl13YNXYTrk2oe8velvr1t4fHrvOiW0XapDZjBN JwJDH8uS+IDqPfs8WfODTIUayHTAqrM3Tc4CdC8aQQMcMRIE9OOJJabHAKkITdc1 XSmx++KzhzZ8+TFScrrRX7lX8simDl8zOrddlnk7jmE8U4Xg9PL/0/eqEl2zkKy/ FFo9vZo1T45bnw7r01qu3eR+Zwz78JP5A/MwDkXkSHSBONmFDIo9HwlSPlS97+iV JNK/P+YMOGulEA3gmaHB =nfv3 -----END PGP SIGNATURE----- --Apple-Mail=_DBEB6E25-957A-4660-ACFE-D165692FA78F--