Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp848489pxy; Wed, 5 May 2021 15:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqfOZdaL8bfz2Tzi44HUTnNvVTDBmS2Sd7aFQ7TybyNMz8nAoAil5z9Hm9ffFmZX50fGzr X-Received: by 2002:a17:906:fb0e:: with SMTP id lz14mr1028294ejb.424.1620254722447; Wed, 05 May 2021 15:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620254722; cv=none; d=google.com; s=arc-20160816; b=b7Qac6k6fxX7KAthm9I5BbmGZY3c1dE56oxycfNI0+3JqisJ9g0omXRg8TBS6JZKkd cUjw9IgNdW13JcY+PENPg312OjoSqEQ5/xUnEHGMCsBqQjG0B6PKYr9lJCKEMS6kJFA2 p7smFih8LQPQmG1rLBEgDnsaVrJX0GkM4bVYZQ9ivZ5K/gzeozDiB1WqXGMVEOVHtVWM wq9777n/ymmm5RO01MgW5lzS4bliuuToPARupWWXzBiLYaRojcnK8+CG4XmRJ+qqpvqJ uaozy8HSHf3z+0PKv/4bRiL5c5/HXKklU5C6qMA63qQ1JyIcdlYstcyaqJQ1hElScbfd wbNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w5N6/9oYwoZXAaPvP6TF/tjNWe1jjwUxNQ6sP8+/4Vg=; b=hSxTalen52Tx6Zo+qd5c6c/AoYhGtYv/o7H6t5tKkTukE18cCW5Y3kZBt1RCWyJJws dZlf6/ek6esP+99L4/QtPI8iFdbtw06lT8NKQhLGNDnCEZVy3pexkb+yK5sIPotCmEbh I3HsTwS92hXafhVOgrpbRgtjSJKnrLXkyHkVuotSd/KD19tKc6QgNBD4k2OEAAHalTlf FNkpYBNZN9Y9TMI2kKpKPB7unfWf7Bv+E/OUipAuwN5q+xG8pRWukrs7wsBUrgQToOGw Kk+CEIEz1bVefSd+hRCvv1MqVtQA99AGrvOIcCALLG0U2hSyHQRZyAgYGv0Vlc0Q/M4/ 3C/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oQ8zwKeO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si615011edw.46.2021.05.05.15.44.59; Wed, 05 May 2021 15:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=oQ8zwKeO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbhEEWo4 (ORCPT + 99 others); Wed, 5 May 2021 18:44:56 -0400 Received: from mout02.posteo.de ([185.67.36.66]:44007 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbhEEWoz (ORCPT ); Wed, 5 May 2021 18:44:55 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id EAD3E240100 for ; Thu, 6 May 2021 00:43:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620254637; bh=pYv3Au9IXevKATgUIKODXyVpuytFP9QKuUl4LWhUdno=; h=Date:From:To:Cc:Subject:From; b=oQ8zwKeOeY+wH7UnX3o1wfyQtIz9TBvd9vNeWWZ/hwMnnizMvLq9GbLvKZFi4MQjZ XaXkxA/5b7uJIf/jt5ifbZjLFfuoLoMkKKqFr1Vjy89CA2b+EMFdiG7oGgcnR0YAAQ PTMYmGxqTk9KRannZHpy/rBKP/tUSivaUGrmH/71K+Dr+A3hSBDd86WB0FX6o3Rp5U NG+wPh028tBgT/4ZjHb2kIAcHYbUyg3wsqBSLzJM1im2ZsOgWVZtzlq2fEsdl5lDx6 qvOcCGOHPiSWviSbz8mp3W9jWY9MsustVJzZc82DzmsspuLkcIHWMaIwsOK6bqbWOt X9p8z90we/Ifw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FbBZz4Bs1z9rxF; Thu, 6 May 2021 00:43:55 +0200 (CEST) Date: Wed, 5 May 2021 22:43:55 +0000 From: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= To: Emmanuel Gil Peyrot Cc: linux-input@vger.kernel.org, Ash Logan , Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , Jiri Kosina , Benjamin Tissoires , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] HID: wiiu-drc: Implement touch reports Message-ID: References: <20210502232836.26134-1-linkmauve@linkmauve.fr> <20210502232836.26134-3-linkmauve@linkmauve.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lEF1dgD/uX8Hblg6" Content-Disposition: inline In-Reply-To: <20210502232836.26134-3-linkmauve@linkmauve.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lEF1dgD/uX8Hblg6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, some more comments below. Enjoy :) On Mon, May 03, 2021 at 01:28:33AM +0200, Emmanuel Gil Peyrot wrote: > There is a 100=C3=97200 inaccessible border on each side, and the Y axis = is > inverted, these are the two main quirks of this touch panel. Does that mean 100 px borders left and right, and 200 px borders top and bottom? 100=C3=97200 evokes the image of a rectangle of that size, which I found confusing for a moment. >=20 > I=E2=80=99ve been testing with weston-simple-touch mostly, but it also wi= th the > rest of Weston. >=20 > Signed-off-by: Ash Logan > Signed-off-by: Emmanuel Gil Peyrot > --- > drivers/hid/hid-wiiu-drc.c | 83 +++++++++++++++++++++++++++++++++++--- > 1 file changed, 78 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/hid/hid-wiiu-drc.c b/drivers/hid/hid-wiiu-drc.c > index 018cbdb53a2c..77e70827c37d 100644 > --- a/drivers/hid/hid-wiiu-drc.c > +++ b/drivers/hid/hid-wiiu-drc.c > @@ -49,13 +49,27 @@ > =20 > #define BUTTON_POWER BIT(25) > =20 > +/* Touch constants */ > +/* Resolution in pixels */ > +#define RES_X 854 > +#define RES_Y 480 > +/* Display/touch size in mm */ > +#define WIDTH 138 > +#define HEIGHT 79 > +#define NUM_TOUCH_POINTS 10 > +#define MAX_TOUCH_RES (1 << 12) > +#define TOUCH_BORDER_X 100 > +#define TOUCH_BORDER_Y 200 [...] > + /* touch */ > + /* Average touch points for improved accuracy. */ > + x =3D y =3D 0; > + for (i =3D 0; i < NUM_TOUCH_POINTS; i++) { > + base =3D 36 + 4 * i; > + > + x +=3D ((data[base + 1] & 0xF) << 8) | data[base]; > + y +=3D ((data[base + 3] & 0xF) << 8) | data[base + 2]; > + } > + x /=3D NUM_TOUCH_POINTS; > + y /=3D NUM_TOUCH_POINTS; Given that there are 10 possible touch points: Does the gamepad actually support multitouch (usefully)? If so, I think it would be better to report all touch points individually to userspace, to allow for multitouch gestures; userspace can still implement averaging if desired. Thanks, Jonathan --lEF1dgD/uX8Hblg6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEvHAHGBBjQPVy+qvDCDBEmo7zX9sFAmCTH6MACgkQCDBEmo7z X9vPEw//fnzygV7B/u+Z+ZCU+HZDFVNVkP99lGWvOQvYeBFgrQiAfmckK0uYMnoJ pfaUQQJFFhctDLvrRbg4xUEfeLxzCmIULANB1Z9NydCLt+Kyl0aF33AQ98o+i//c RHDgTR2knyIxPW9Srh35lYJln16JuU5OEd0ADwN0lJMeM/QQgh7IiEooUtDHsKAs TrGfsBCCN828ucY1aJFlc4TPebOKeoAgu5oK/ZlzOmnV4l7iUh2FZ0SHlAPn+w5F 3BUbMsFnofLYhW6dzGKe7LeocubVa7K3qZLIBZCQleuEgJTBPBEosGX6hJmvbYU5 xUGPQ32QVJFBIHgaZKuPJUGZNKo/az5mwReo2Xk0FN4GhBErURHGTdb4AXUdhNbR sH8LVUrRBK6Oz7LN98kDPr54XZtt797weF9yABdaDDc+PxNfJEIdHL4fpJaqe5SN v/pBI6v1REj6n8vjO9QGyH3wk4Ee6WO6r0TTdvXxgXF1QHPTPcNRbYObRaswgDeZ tSDM1mwe6SqtvtT6TgrmCjl54bOcIqaQpFoYqKnIa59T4Soqjg0ruB7ZRaKVFd7J jQALSwEe4Z6wkYFPCJb+qlnhb/6MQxU841e58QNA08QCzD7FDDc3nJGJz8cvG1Yv zIfFwZX43NlzhMfrNQejnwvvwxNUaUd3er1PWTXdkIhzlWVM3wQ= =yjsD -----END PGP SIGNATURE----- --lEF1dgD/uX8Hblg6--