Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5400681ybi; Tue, 28 May 2019 12:22:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKDl7SDFWYp/CzHtDrfVVY8NpbLQ2V/V9M2IHe13ucz8X5JHZSEfDDnMHDZhIxkfIiodb2 X-Received: by 2002:aa7:9356:: with SMTP id 22mr43710716pfn.188.1559071376715; Tue, 28 May 2019 12:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559071376; cv=none; d=google.com; s=arc-20160816; b=RLVkXgjN3QfhxbNElxw4YUKAZSwlaupkLZUmcfc5jPoQf95rf7JzkK+b54lfB6Qsmi d7o7hnqjnhR5QSFLIu5B9INuZpz1YwpPwT4aIACtCAUvFh3pu2NBIxekbSLl6ao93ARC IqWLtloeMG7DgE6nQ+BAnOe7XEPozT0DF9dxjoGnrbOPRFIZx/uYVkrHsgWdTPJjLwbf qIZW5NMgVdRoPhnEpHK3KTt6IM2NSV9aScehY5s8NlFeUsEwSPHyK3Occf1p6bW/YQhs WckH5A99fEIaAQwJ+wVEl6JKA9w788abnqHQWgzxLr2mECEIVFkDfJUE2pPWAiDMH3ec VmXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OqpexmVIKfsSkeW7hmtnhVKKfuuGya/sOg3ZfntORRU=; b=MUrT3pmbFXHYih9rgOzcHjokDi+xJcQPWmInjIRrJFZAO1iR7+RLDCWMSA5abxjACD 6ho/oPOker8Cwdd0bqBhqKqyyVgfRwpjkKCYG5o+mvlox6VXbp/Tn7Cr6GW7W9zSSvQw J3C5NEI+WfOrpd+8cFvKE06nCzrrD5ZNMrAg5ATAccmKyT4JtiR3OjjmLs6NDX8thAPA 7inJxOws1eFEphh4n7SmTiRDmCdHsYqLYCUlkpnbqUoIcEc4/86wlG88O5fl6iNyWUqN L7T4CwqTS1aK6MWKOGItK1rpXTWZqEKIAPDihvt4OQrbNoZbnxB3FW5NOj+m0IeYA9iZ vIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VodMu0yh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si22507171plo.429.2019.05.28.12.22.41; Tue, 28 May 2019 12:22:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VodMu0yh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727917AbfE1SNp (ORCPT + 99 others); Tue, 28 May 2019 14:13:45 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:36204 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbfE1SNo (ORCPT ); Tue, 28 May 2019 14:13:44 -0400 Received: by mail-yb1-f195.google.com with SMTP id y2so5431349ybo.3 for ; Tue, 28 May 2019 11:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=OqpexmVIKfsSkeW7hmtnhVKKfuuGya/sOg3ZfntORRU=; b=VodMu0yhrGnCVbNkgm5tlDgPMsXnAXDomdWv8QS4b9vlsNi7ToWufDvlLlPJz2v8xj IQ/WNbRlith2/cUER8VYTKT9r1p+4sjc1hRNb6bifRXi6jo/AX6guQdLXHVgJhVFtjiH qQYe3EUxB9+WSPSxWEhHN6+jamT0NYHcHUeHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=OqpexmVIKfsSkeW7hmtnhVKKfuuGya/sOg3ZfntORRU=; b=j1ESRfIrOYmBomiGzKSt4/YOHpW0PnKcVprmcU6Egq3anMal4vpW8euXABSLi2W2Es El7Z+MpYb5ToBERjf4A70kqjH3OrAzlkce45B7LUpRqEJz/vXqqAQbSnRD+HDTNr4sRu u1IXulH0REMY6ZVOvbi+tDFVyZGuVS5G1FggFgCcb8lZ21QcznuqVfKWwsCn6U9R0d2L zU/oxk2U2CiFtR05kJB23aDjUd87MaFcZAB20Y8HgGNbPXbBwPaqV6Qd5lLBr7o2zOUk qx74IyevOqHCQlgVliAA29wvjh0mFLGyfbhctXJ60V3xRlqgumdASCkTz5IAByxZMPBi K0MQ== X-Gm-Message-State: APjAAAVUaGETa5cyUSag19pTV8lGuP0Ffz6TC4i9rhCB/Wuf+nURc7jF 9HNrhW3R8qJKTW9NBxr6XtivANVzoio= X-Received: by 2002:a25:b95:: with SMTP id 143mr8420121ybl.28.1559067223119; Tue, 28 May 2019 11:13:43 -0700 (PDT) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com. [209.85.222.178]) by smtp.gmail.com with ESMTPSA id v128sm3804131ywf.14.2019.05.28.11.13.41 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 11:13:42 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id p18so24056441qkk.0 for ; Tue, 28 May 2019 11:13:41 -0700 (PDT) X-Received: by 2002:a05:620a:12d9:: with SMTP id e25mr15891334qkl.279.1559067221416; Tue, 28 May 2019 11:13:41 -0700 (PDT) MIME-Version: 1.0 References: <20190521132712.2818-1-benjamin.tissoires@redhat.com> <20190521132712.2818-9-benjamin.tissoires@redhat.com> <00f901d5143f$f5ea8420$e1bf8c60$@emc.com.tw> <20190528012101.GA193221@dtor-ws> In-Reply-To: <20190528012101.GA193221@dtor-ws> From: Harry Cutts Date: Tue, 28 May 2019 11:13:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 08/10] Input: elan_i2c - export true width/height To: Dmitry Torokhov Cc: =?UTF-8?B?5buW5bSH5qau?= , Benjamin Tissoires , Rob Herring , Aaron Ma , Hans de Goede , "open list:HID CORE LAYER" , lkml , devicetree@vger.kernel.org, seobrien@chromium.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 May 2019 at 18:21, Dmitry Torokhov w= rote: > > Hi Benjamin, KT, > > On Mon, May 27, 2019 at 11:55:01AM +0800, =E5=BB=96=E5=B4=87=E6=A6=AE wro= te: > > Hi > > > > -----Original Message----- > > From: Benjamin Tissoires [mailto:benjamin.tissoires@redhat.com] > > Sent: Friday, May 24, 2019 5:37 PM > > To: Dmitry Torokhov; KT Liao; Rob Herring; Aaron Ma; Hans de Goede > > Cc: open list:HID CORE LAYER; lkml; devicetree@vger.kernel.org > > Subject: Re: [PATCH v2 08/10] Input: elan_i2c - export true width/heigh= t > > > > On Tue, May 21, 2019 at 3:28 PM Benjamin Tissoires wrote: > > > > > > The width/height is actually in the same unit than X and Y. So we > > > should not tamper the data, but just set the proper resolution, so > > > that userspace can correctly detect which touch is a palm or a finger= . > > > > > > Signed-off-by: Benjamin Tissoires > > > > > > -- > > > > > > new in v2 > > > --- > > > drivers/input/mouse/elan_i2c_core.c | 11 ++++------- > > > 1 file changed, 4 insertions(+), 7 deletions(-) > > > > > > diff --git a/drivers/input/mouse/elan_i2c_core.c > > > b/drivers/input/mouse/elan_i2c_core.c > > > index 7ff044c6cd11..6f4feedb7765 100644 > > > --- a/drivers/input/mouse/elan_i2c_core.c > > > +++ b/drivers/input/mouse/elan_i2c_core.c > > > @@ -45,7 +45,6 @@ > > > #define DRIVER_NAME "elan_i2c" > > > #define ELAN_VENDOR_ID 0x04f3 > > > #define ETP_MAX_PRESSURE 255 > > > -#define ETP_FWIDTH_REDUCE 90 > > > #define ETP_FINGER_WIDTH 15 > > > #define ETP_RETRY_COUNT 3 > > > > > > @@ -915,12 +914,8 @@ static void elan_report_contact(struct elan_tp_d= ata *data, > > > return; > > > } > > > > > > - /* > > > - * To avoid treating large finger as palm, let's redu= ce the > > > - * width x and y per trace. > > > - */ > > > - area_x =3D mk_x * (data->width_x - ETP_FWIDTH_REDUCE)= ; > > > - area_y =3D mk_y * (data->width_y - ETP_FWIDTH_REDUCE)= ; > > > + area_x =3D mk_x * data->width_x; > > > + area_y =3D mk_y * data->width_y; > > > > > > major =3D max(area_x, area_y); > > > minor =3D min(area_x, area_y); @@ -1123,8 +1118,10 @@ > > > static int elan_setup_input_device(struct elan_tp_data *data) > > > ETP_MAX_PRESSURE, 0, 0); > > > input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, > > > ETP_FINGER_WIDTH * max_width, 0, 0); > > > + input_abs_set_res(input, ABS_MT_TOUCH_MAJOR, data->x_res); > > > input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, > > > ETP_FINGER_WIDTH * min_width, 0, 0); > > > + input_abs_set_res(input, ABS_MT_TOUCH_MINOR, data->y_res); > > > > I had a chat with Peter on Wednesday, and he mentioned that this is dan= gerous as Major/Minor are max/min of the width and height. And given that w= e might have 2 different resolutions, we would need to do some computation = in the kernel to ensure the data is correct with respect to the resolution. > > > > TL;DR: I don't think we should export the resolution there :( > > > > KT, should I drop the patch entirely, or is there a strong argument for= keeping the ETP_FWIDTH_REDUCE around? > > I suggest you apply the patch, I have no idea why ETP_FWIDTH_REDUCE exi= sted. > > Our FW team know nothing about ETP_FWIDTH_REDUCE ether. > > > > The only side effect will happen on Chromebook because such computation= have stayed in ChromeOS' kernel for four years. > > Chrome's finger/palm threshold may be different from other Linux distri= bution. > > We will discuss it with Google once the patch picked by chrome and caus= e something wrong. > > Chrome has logic that contact with maximum major/minor is treated as a > palm, so here the driver (which originally came from Chrome OS) > artificially reduces the contact size to ensure that palm rejection > logic does not trigger. > > I'm adding Harry to confirm whether we are still using this logic and to > see if we can adjust it to be something else. I'm not very familiar with our touchpad code, so adding Sean O'Brien, who i= s.