Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3871767imm; Mon, 4 Jun 2018 10:36:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJ6IcTBICrunYIRr3EDPIp/G7lASzKLqcQO7g86xVy4wFz5NjNTsgkXcUciO/9dZwVWAa4 X-Received: by 2002:a63:798f:: with SMTP id u137-v6mr18166369pgc.202.1528133789177; Mon, 04 Jun 2018 10:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528133789; cv=none; d=google.com; s=arc-20160816; b=UrM4Oa87jLqjlSkVuGbNij/Xrw7lSe9Cj+SZC94rusS4x7hRO6yRbsknfqIuac4cOP 3Mb5VMqsp5u7Ev6XRDwmcmmleVuAp05UsUYK6nlamZtvMy84WFgdGI2U7reMumcRpiIt WrMWHnKQt51qWrMDi6Ey/TMLbkGRhwx/ehqv17fvLsh/bSTbvVx21gb0+tWCwt0yFPIx BoyQNVrXAA0bq7X008DVbs+KRN3Fh0lpupA+VKnmdRIAZJd9YXVRw4VzOrFw2kAJKJaA l8BTO+aUhgj7IsD2Q/vjFEjjQI/g79pEi+KKsA4gXk3VpXLce+RlzntaZVJQhtVExtWl /aEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KEkyTY1zW9BLsPidA8eGo1IiL6IzsVvg57+729LTakM=; b=j9yoB/X0RQue4RcKIo7Gp123Td3SGDHVt9YeV18p2HAVBHV5VCMTSbmChPflDbhqEr 1n5sgWQLMaFOsprBAg2Spl9dH/xMtDaSeojWRaEm3CrH3PjRKYwBDhzvBIGgEyJqybLi fFB5Yf72+iYtztmUR0wimQrMalPWQiOeCtBtasuPmJtPpKWRBEoT8Kkpre36mAtPBu/8 Cbr5XG3Zr5Rk586ouPAZEu7Id3hcyPM9smlDvFXTgnFnyr5QpZgtqA+CA7/vObyZg/t+ VX81Eb+ZaoVzYNFY6sapVOLePZjPR//3IJ8e7etRqlIgxsRGElnFZo5cKwCYHvSaUM8C UMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j3oULFF+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si5212988plm.181.2018.06.04.10.35.43; Mon, 04 Jun 2018 10:36:29 -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=@gmail.com header.s=20161025 header.b=j3oULFF+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751289AbeFDRdq (ORCPT + 99 others); Mon, 4 Jun 2018 13:33:46 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:43707 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbeFDRdn (ORCPT ); Mon, 4 Jun 2018 13:33:43 -0400 Received: by mail-pg0-f68.google.com with SMTP id p8-v6so14740937pgq.10; Mon, 04 Jun 2018 10:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KEkyTY1zW9BLsPidA8eGo1IiL6IzsVvg57+729LTakM=; b=j3oULFF+nHsvBHJKwagb5RgViEWJp/MKprMaN02FX9GumAFzerKYgpY2z9kPJ9rmnP is5Ghg+RysQRN88xmN0ERYD4L5UlHeNEjC+fYKjq2im8BLr+PbdiQDxrgqgTPtXhXLs2 HSFKawyzMn3/TrW3yWVhSumC7RBw1gALB0xOBlw8cd6pdeNJZw4xIvmC5uh2BUhseFK6 Mk2HZUUtW2qPWnROoDyEf/4x48Sxo9O9COGcvQ9sH8ue+6wrkAz0Oa/5wpua7hz8RMDm OHXoQpDpn9YzfdBr6C6EtW3J6Ftyal8qMtHA87oA1TO4L60BZ/ltBRn+tvtRh0diLBlr Zfiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KEkyTY1zW9BLsPidA8eGo1IiL6IzsVvg57+729LTakM=; b=BrpMj2cqnzwsCla3tAyk+Ce2unflrs6FFq8uaveEYpGDAQ8dVfIIjZYigZUtwviIEG g94LtqZQaeVqUssl5ketQzIkH9v2vf5qQrZLlLfQKemM5WMsU5oSknUl0szFkke7XkKo UFwixNln4CPVx98QdWS8L00ulDB9T1P0lS8iWHgKAMl+BD6yRWCGXjf6ED98y+W/w/wN CBjLffJGQeumkSkcBdkHRbcptGQT71ajQwxJEbLGiIdVXevlY9UoKbUrRLbaUIz7R3Cf 3P9lztjHmA/YdGRImSk5fLIv0FmnAnsTV2z7qRSwx3Yxtifx2We7SfF3gr4hkWsgK00a XqGw== X-Gm-Message-State: ALKqPwcYsrIbms9zx2FtHz/jkFBUrGJxsEJ+JqOWabhS60k4yvs3l7fp GChHCn2QZsoIer0MmIlEiFc= X-Received: by 2002:a63:ad08:: with SMTP id g8-v6mr17676730pgf.74.1528133623012; Mon, 04 Jun 2018 10:33:43 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id a7-v6sm69837144pgc.68.2018.06.04.10.33.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 10:33:41 -0700 (PDT) Date: Mon, 4 Jun 2018 10:33:39 -0700 From: Dmitry Torokhov To: Benjamin Tissoires Cc: Jiri Kosina , Henrik Rydberg , Jason Gerecke , Dennis Kempin , Andrew de los Reyes , "open list:HID CORE LAYER" , lkml Subject: Re: [PATCH 1/2] HID: multitouch: report MT_TOOL_PALM for non-confident touches Message-ID: <20180604173339.GB164893@dtor-ws> References: <20170811004500.13740-1-dmitry.torokhov@gmail.com> <20180601184330.GD222005@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 04, 2018 at 03:18:12PM +0200, Benjamin Tissoires wrote: > 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. OK, that is great to know. > > > > >> > >> 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? That would be correct ;) At least the firmware that is shipping with Pixlebooks hasn't, I do now if anyone else sourced these Wacom parts for their MSWin devices. > > 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. Hmm, I am not sure about having specific quirk. It will be hard for users to accurately diagnose the issue if firmware is broken in this way so we could add a new quirk for a new device. > > 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. That would be great. > > 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 Thanks. -- Dmitry