Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp110116imm; Mon, 4 Jun 2018 14:01:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPt67d2SeccnTGVfMTKr3VUPFCOASNTJgazVggJkn8ZhO5TmZarx3wAshwDdPzIeQpp96G X-Received: by 2002:aa7:8345:: with SMTP id z5-v6mr15063379pfm.251.1528146085517; Mon, 04 Jun 2018 14:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528146085; cv=none; d=google.com; s=arc-20160816; b=KQ1B1gdHa4iM/Z1V4HD4A+QdwwtUpUCa+77WE1W9OT6ptY91BO3SeCLmjIqGh8Z3ND bUdk3YRYQKxqOORqHKbLtfr38SODnZDf7FibRtdlUW9dClqDketOIHqJv/bMQQSHPvIk 9iqYkhYWjftokmi8OmecaZmaLitprVqClMd7mZu5D0b39fGcw5yoK7uZPyPZY7UVZFYK oda5tIpw2NDKXNvybCjDKmqLysNkeqmBF5IXHnykmicNXxKb9zsTWIiJyx9yoqmz3291 QAktfH6GTckKgUi4q6ZiIc/fzz2hWhtv3kn//wNVA+CcW83bPS4KEm32F3s3+Whc9ny6 cyIQ== 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=/vhFiAqUhv90+3szVCUj+805sbcp5TUIlKPKUMmH84M=; b=AyvLFb49I0Z74+K7cvk6UnMZeeB5ZimqU5kyM0gvn3Q/LXOJftsxXaLOQjPLMFWZHo ri1czzZyLPytt4t3HLiIQJ2cn64jTkJm8+fw0zbn3eLwnRu8wQrs2khS3iYCE6fpFyMY nAoshYCi03pWPWgPrusUrsHTYcVA9kZmVcGr9ULBL71Hc7xafYC32+BO/KfGmbhAu3vv l9Zez88X+YFq/mthCwYBBTH/Ym5uCG5AJjFUm2KD5ib78DLTXpgk8BpuGhlIaR3NQZQW 3ukl/+ARWvd3gjeNElBFIy3oZzraiBHQhZQnSaP3UVquZFngZ/1hEuYIU2dlYjnFihED R3uA== 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 67-v6si48096554pfm.167.2018.06.04.14.00.55; Mon, 04 Jun 2018 14:01:25 -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 S1751284AbeFDU7T (ORCPT + 99 others); Mon, 4 Jun 2018 16:59:19 -0400 Received: from mail-qt0-f169.google.com ([209.85.216.169]:34130 "EHLO mail-qt0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbeFDU7R (ORCPT ); Mon, 4 Jun 2018 16:59:17 -0400 Received: by mail-qt0-f169.google.com with SMTP id d3-v6so118538qto.1 for ; Mon, 04 Jun 2018 13:59:17 -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=/vhFiAqUhv90+3szVCUj+805sbcp5TUIlKPKUMmH84M=; b=IRJ0uxNb4S17eXk5WfC35t13JPQVhzYwQxt25qxtHqtsIxBNKnp0Le9TLJzksQs4Xb QHYuTpIoU7vVA0h4+YhNsAlyS5rY1uZx9cP495Pvbkv3xDEgqj83OfdhCYdOR5i8rSc4 4wQcU2mK6iv7ISC6DHICBPMofNSdZ9O87RnCky0hqs8rdd389FS0QYRHqHmj0HwH7CkN wvUu86EoMBAstrtky783mz70u4iL3UsT6uEx+CamQ9fqSDNVA8Hrc9N1ull3tXYPM16O AOwlBMv4dl6gcgLWYK4HBiACqOIRaZczRoGnDfBs4acbbrWD6FvQuQ9D0ijYC4icStEk FdwA== X-Gm-Message-State: APt69E113Em0li5qeOCRUI762HdljKrvCoCaPhRk3Kj8dkLQup8boklZ 9VlLVp8K94IaEikjPt3Kyz6E5ePbawbBzbgFedm9tg== X-Received: by 2002:a0c:c944:: with SMTP id v4-v6mr21302696qvj.232.1528145956939; Mon, 04 Jun 2018 13:59:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2bc7:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 13:59:16 -0700 (PDT) In-Reply-To: <20180604182658.GC164893@dtor-ws> References: <20170811004500.13740-1-dmitry.torokhov@gmail.com> <20180601184330.GD222005@dtor-ws> <72b7120a-d304-0b2f-d04a-473631623f72@bitmath.org> <20180604172759.GA164893@dtor-ws> <994e5698-fbdf-05c8-b0b6-3df6af1b3dbc@bitmath.org> <20180604182658.GC164893@dtor-ws> From: Benjamin Tissoires Date: Mon, 4 Jun 2018 22:59:16 +0200 Message-ID: Subject: Re: [PATCH 1/2] HID: multitouch: report MT_TOOL_PALM for non-confident touches To: Dmitry Torokhov Cc: Henrik Rydberg , Jiri Kosina , 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 Mon, Jun 4, 2018 at 8:26 PM, Dmitry Torokhov wrote: > On Mon, Jun 04, 2018 at 07:55:57PM +0200, Henrik Rydberg wrote: >> Hi Dmitry, >> >> > > > Logically, the confidence state is a property of a contact, not a new type >> > > > of contact. Trying to use it in any other way is bound to lead to confusion. >> > > > >> > > > Problem is that MT_TOOL_PALM has been introduced in the kernel since >> > > > v4.0 (late 2015 by a736775db683 "Input: add MT_TOOL_PALM"). >> > > > It's been used in the Synaptics RMI4 driver since and by hid-asus in late 2016. >> > > > I can't find any other users in the current upstream tree, but those >> > > > two are already making a precedent and changing the semantic is a >> > > > little bit late :/ >> > I am sorry I did not respond and lost track of this issue back then, but >> > I disagree with Henrik here. While confidence is a property of contact, >> > so is the type of contact and it can and will change throughout life of >> > a contact, especially if we will continue adding new types, such as, for >> > example, thumb. In this case the firmware can transition through >> > finger->thumb or finger->thumb->palm or finger->palm as the nature of >> > contact becomes better understood. Still it is the same contact and we >> > should not attempt to signal userspace differently. >> We agree that the contact should stay the same, but the fear, and I think >> somewhere along the blurry history of this thread, the problem was that >> userspace interpreted the property change as a new contact (lift up/double >> click/etc). Finger/thumb/palm is one set of hand properties, but what about >> Pen? It would be hard for an application to consider a switch from finger to >> pen as the same contact, which is where the natural implementation starts to >> diverge from the intention. > > I think the userspace has to trust our tracking ID to decide whether it > is a same contact or not. The current issue is that kernel is forcing > tracking ID change on tool type change, and one of the 2 patches that I > posted fixed that, allowing us to keep the tracking ID for finger->palm > transitions. I think I missed those 2 patches, can you point a LKML link? Also, note that libevdev discards the tracking ID change now (it shouts at the user in the logs). So that means that it will now be hard to force libevdev to trust the kernel again for the tracking ID. The current rule is: - tracking ID >= 0 -> new touch - any subsequent tracking ID >= 0 -> discarded - tracking ID == -1 -> end of touch > > I think it is kernel task to not signal transitions that do not make > sense, such as finger->pen or palm->pen etc. I fully agree, though there is currently no such guard in the kernel (maybe it's part of your series). I am worried about the RMI4 F12 driver that automatically forward the info from the firmware, so if the firmware does something crazy, it will be exported to user space. But I guess it might be better to treat that on a per driver basis. > >> >> > We could introduce the ABS_MT_CONFIDENCE (0/1 or even 0..n range), to >> > complement ABS_MT_TOOL, but that would not really solve the issue with >> > Wacom firmware (declaring contact non-confident and releasing it right >> > away) and given MS explanation of the confidence as "contact is too big" >> > MT_TOOL_PALM fits it perfectly. >> Indeed, the Wacom firmware seems to need some special handling, which should >> be fine by everyone. I do think it would make sense to add >> ABS_MT_TOOL_TOO_BIG, or something, and use it if it exists. This would apply Except we are already running out of ABS_* axes. >> also to a pen lying down on a touchpad, for instance. > > OK, I can see that for Pens, if we have firmware that would recognize > such condition, it would be weird to report PALM. We could indeed have > ABS_MT_TOOL_TOO_BIG, but on the other hand it is still a pen (as long as > the hardware can recognize it as such). Maybe we'd be better off just > having userspace going by contact size for pens. Peter, any suggestions > here? I don't think we have size handling in the tablet implementation in libinput. I do not see it as a big issue to add such axes from a libinput point of view. However, there is no existing hardware that would provide such information, so I guess this will be a 'no' until actual hardware comes in. Also note that the MT_TOOL_PEN implementation is limited (even non-existant if I remember correctly). Peter and I do not have access to any device that support such multi pen, so AFAICT, there is no code to handle this in libinput. One last point from libinput, the pen device would need to be on its separate kernel node for the protocol to be smoothly handled. So basically, even the transition from MT_TOOL_FINGER to MT_TOOL_PEN would not be handled properly right now. The Pen event will be treated as a touch. Cheers, Benjamin > > Thanks. > > -- > Dmitry