Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3594345imm; Mon, 4 Jun 2018 06:19:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKz4iPqIKJXQIUaOR+os5nv4jiazr0u4xfrAZUw1b5tFoL92WAvUYLZyrOJWI4mM2QnyEIO X-Received: by 2002:a65:554b:: with SMTP id t11-v6mr17485155pgr.130.1528118376181; Mon, 04 Jun 2018 06:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528118376; cv=none; d=google.com; s=arc-20160816; b=MeWJGtRLpjBh+fRLG4H7mFpyodOHTxDIT8EREBcCU7cE/CGj4A1KrOUiL5oQA+UW1F YefGzi/sjjxywHTgGT3XNdXIxo0SFCow952wB1DYBjTXX5+OIfseNerZhuzw61/iAo0h D5tk1sTD0ey2bbGWnX3LEI9Mv0b/oqu9/J6iLgrvgBsJzKqb6rxOZs0Mq/Wnf6I9OFkT bEuGRMXXef6CCMo1HS47Qmb8eQs5i38cTmg4svipKSUAurSuv/wzr3AepBtZK8h1O5tD eRau70IWAx27uS2qIdCkmQlVMrw2oAL2Wdd7mrb/6kL286VdTg6x0Hkt32YbAt6MVagK VjnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=k29Xb3f0O1UwsakLJ1GQgfnE/TqMaM0V54e5jzKsyFI=; b=Wrpnbv1BanbKG9pGf3RrHPaLhK5mwuJufRK8Xili71xu4pnK7TXwcSYK2fKHM5blHk Fe1wpFqR+FRSl2mAuL/hMhRAmwWDjBYf8QYnViQTk+N+FDAbNHFJ3PFKL7uTWh+JcDzI MLDvmMfSaW/7d4P43mtWSNjkbwIvFwN8uKNWCAF4VRh5hzncW1zl46cJ+Cl5kXqEqC0O +MMzdCcz3bMsnhJKGfJt2shPV2crfPmpgRIEO0EL5msUbHB+0xXQW23ttU+6BJCjccc6 c9Zf53RsWTNL3ToLrnYfsz2npjJLE/Arpm0RA5KaZmxfRFYGMH1oMrfChGAfdi53Skqq a9Xg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14-v6si5102919pfe.149.2018.06.04.06.19.22; Mon, 04 Jun 2018 06:19:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211AbeFDNSQ (ORCPT + 99 others); Mon, 4 Jun 2018 09:18:16 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:44033 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbeFDNSO (ORCPT ); Mon, 4 Jun 2018 09:18:14 -0400 Received: by mail-qt0-f195.google.com with SMTP id l33-v6so3513855qta.11 for ; Mon, 04 Jun 2018 06:18:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=k29Xb3f0O1UwsakLJ1GQgfnE/TqMaM0V54e5jzKsyFI=; b=Fa8kU9oWZH7PjUj7xJJus9izU39tp6HlOJMJ5m2l6J17Paiu200vwEk1G8RGUFMWLO Kgttz2FWWZYbuwGGY4293BnRkduhNNbSoJu+GJgUMM9HM56hpKnP5i267e1eD+pKui+3 G5rA0fyGUNGJGGZj7t1oO2vRZVGsu0zgbRD77eNjUTaJ5uQgAs1LcgKs6yGwpYkbc1II H8f2oJMBXyuJYqs28DPK29bLZulOmIyGGejpy+pT06XvM7h44f8VmdgT9FMPuNoEU1SB rSqIn9Wm4Iug1SdoqcOF3PlaNzNCSJ5pn/Zgi72ggHawJTZSBWCKKv//o1Hc/4GRyDij 0/uA== X-Gm-Message-State: APt69E3FLXACcYcU0Up28q34uQQ+VzVbTT2c23BrGRS2aaY7+u7dUm92 BvOy5fc0SNuo4xVRirM9MOowNwRO7pPnkCl/MgtTEQ== X-Received: by 2002:ac8:5398:: with SMTP id x24-v6mr19385457qtp.81.1528118293275; Mon, 04 Jun 2018 06:18:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2bc7:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 06:18:12 -0700 (PDT) In-Reply-To: <20180601184330.GD222005@dtor-ws> References: <20170811004500.13740-1-dmitry.torokhov@gmail.com> <20180601184330.GD222005@dtor-ws> From: Benjamin Tissoires Date: Mon, 4 Jun 2018 15:18:12 +0200 Message-ID: Subject: Re: [PATCH 1/2] HID: multitouch: report MT_TOOL_PALM for non-confident touches To: Dmitry Torokhov Cc: Jiri Kosina , Henrik Rydberg , Jason Gerecke , Dennis Kempin , Andrew de los Reyes , "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 1, 2018 at 8:43 PM, Dmitry Torokhov wrote: > On Fri, Jun 01, 2018 at 04:16:09PM +0200, Benjamin Tissoires wrote: >> On Fri, Aug 11, 2017 at 2:44 AM, Dmitry Torokhov >> wrote: >> > According to Microsoft specification [1] for Precision Touchpads (and >> > Touchscreens) the devices use "confidence" reports to signal accidental >> > touches, or contacts that are "too large to be a finger". Instead of >> > simply marking contact inactive in this case (which causes issues if >> > contact was originally proper and we lost confidence in it later, as >> > this results in accidental clicks, drags, etc), let's report such >> > contacts as MT_TOOL_PALM and let userspace decide what to do. >> > Additionally, let's report contact size for such touches as maximum >> > allowed for major/minor, which should help userspace that is not yet >> > aware of MT_TOOL_PALM to still perform palm rejection. >> > >> > An additional complication, is that some firmwares do not report >> > non-confident touches as active. To cope with this we delay release of >> > such contact (i.e. if contact was active we first report it as still >> > active MT+TOOL_PALM and then synthesize the release event in a separate >> > frame). >> >> I am not sure I agree with this part. The spec says that "Once a >> device has determined that a contact is unintentional, it should clear >> the confidence bit for that contact report and all subsequent >> reports." >> So in theory the spec says that if a touch has been detected as a >> palm, the flow of events should not stop (tested on the PTP of the >> Dell XPS 9360). >> >> However, I interpret a firmware that send (confidence 1, tip switch 1) >> and then (confidence 0, tip switch 0) a simple release, and the >> confidence bit should not be relayed. > > This unfortunately leads to false clicks: you start with finger, so > confidence is 1, then you transition the same touch to palm (use your > thumb and "roll" your hand until heel of it comes into contact with the > screen). The firmware reports "no-confidence" and "release" in the same > report and userspace seeing release does not pay attention to confidence > (i.e. it does exactly "simple release" logic) and this results in UI > interpreting this as a click. With splitting no-confidence > (MT_TOOL_PALM) and release event into separate frames we help userspace > to recognize that the contact should be discarded. After further thoughts, I would consider this to be a firmware bug, and not how the firmware is supposed to be reporting palm. For the precision touchpads, the spec says that the device "should clear the confidence bit for that contact report and all subsequent reports.". And it is how the Dell device I have here reports palms. The firmware is not supposed to cut the event stream. There is a test for that: https://docs.microsoft.com/en-us/previous-versions/windows/hardware/hck/dn456905%28v%3dvs.85%29 which tells me that I am right here for PTP. The touchscreen spec is blurrier however. > >> >> Do you have any precise example of reports where you need that feature? > > It was observed on Pixelbooks which use Wacom digitizers IIRC. Pixelbooks + Wacom means that it was likely a touchscreen. I am right guessing the device did not went through Microsoft certification process? I am in favor of splitting the patch in 2. One for the generic processing of confidence bit, and one for this spurious release. For the spurious release, I'm more in favor of explicitly quirking the devices in need of such quirk. If you agree, I'll rebase your patch on top of my series as rebasing my series on top of yours will take more effort. I am trying to be cautious in the generic path because I want to merge the cleanest multitouch implementation in hid-core/hid-input, and leave all the quirks in hid-multitouch for the devices in need. Cheers, Benjamin > > Thanks. > > -- > Dmitry