From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216AbdBTVI6 (ORCPT ); Mon, 20 Feb 2017 16:08:58 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34828 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbdBTVIz (ORCPT ); Mon, 20 Feb 2017 16:08:55 -0500 From: Pali =?utf-8?q?Roh=C3=A1r?= To: "H. Nikolaus Schaller" Subject: Re: [PATCH v9 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Date: Mon, 20 Feb 2017 22:08:50 +0100 User-Agent: KMail/1.13.7 (Linux/3.13.0-108-generic; KDE/4.14.2; x86_64; ; ) Cc: Dmitry Torokhov , Sebastian Reichel , Mark Rutland , =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Russell King , Arnd Bergmann , Michael Welling , Mika =?utf-8?q?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 References: <201702202042.15878@pali> In-Reply-To: <201702202042.15878@pali> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1744452.UVGmpsnQfS"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201702202208.50498@pali> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart1744452.UVGmpsnQfS Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. Looking at kernel code... via EVIOCSABS ioctl() you can even set=20 resolution from userspace for specified input device. So this could be potentially used for calibrating input device from=20 userspace? (In case DT data will not fully match current HW) > 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) 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). =2D-=20 Pali Roh=C3=A1r pali.rohar@gmail.com --nextPart1744452.UVGmpsnQfS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAlirWuIACgkQi/DJPQPkQ1LF6ACbBrF6PHJA3rBGfSzDBZ7i0gYp ugYAn16sy9AkgXOzJBfvTjJGEI0Q6AUc =dm6m -----END PGP SIGNATURE----- --nextPart1744452.UVGmpsnQfS--