Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20397528rwd; Thu, 29 Jun 2023 01:31:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FY3Ns7Yl1PqBQI59nZRL62eZc0qIDVLYysb28H9AxSm8HBL/KO3ojFYL3YhjpL5f9TSNt X-Received: by 2002:a17:902:aa83:b0:1b7:d4a0:639 with SMTP id d3-20020a170902aa8300b001b7d4a00639mr14012361plr.31.1688027482752; Thu, 29 Jun 2023 01:31:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688027482; cv=pass; d=google.com; s=arc-20160816; b=MYUiFrTYs0xoIRr4Jf8SW2vps8Oo5BGm5g66H0j+2/ayEKXXlbFTfz6NLU8WoU8o1e XwbkbR5lspRuCXXbPGsnff/puS34Y6PaAUApzKg7U6+wucp+4RbOXnDEhIUpwoJFTXgg v1cjJiqlfmhnLsA4KoFqeFejpPTxVjGScMwUja7HXIi1yLzMp9e8xgxW4CS86khEjy0x 02Qlz1Y0gjDWaxo19bk89OOlxC+sWJ2ENFIwkmreVjpktsEMePR95QlMtYo2XclsxRAF 9phhfvusqe9LyEvUVs7Xw1fzLEs3mI85yxr6htXKtI+QYz5DThWzbDdoYrU+uuEhQwoJ s6PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=eSI2Qmu64zQHLVJ57XQ4ze1rlixAColllgajHlYDBfg=; fh=C1KklLkocLL/qILosLMRMHyklCy1j64p2iGkQY3O8e8=; b=jn8ns1KArgGDx5xn0vAtg++QiGwu4HKFkGWEER/r7OZFLRR4D//MSaYOJn3DSZihOI +Mls1sRKxsLjHFFaM0OVkVEz3HsNxxP7EAPXYa4x0ha7qb/YWEU8W7iXVnwic7ckM2Cc FXfcHCgsa0codtWaZboeJsC+wzv4ubI2fBTRyAify6ZLneoIL1gdp2aly335htYR+y5R 1gEvApOJRY5yueZx8fd0HgySWVa2zcLT6WeS5PGyttdl0L/qqMctcoiJd9Vu9n4KocM6 JsLDcwqUngcXZG+4LpzTXJyyrVhoTB58migK244CKc8O7tsEZIPFre1gn7dqe2kdjwmi k9kw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=tAZBDV9W; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a170902bd0b00b001a4fc13dfa5si9968017pls.276.2023.06.29.01.31.10; Thu, 29 Jun 2023 01:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=tAZBDV9W; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbjF2Hyf (ORCPT + 99 others); Thu, 29 Jun 2023 03:54:35 -0400 Received: from mail-vi1eur02on2048.outbound.protection.outlook.com ([40.107.241.48]:31489 "EHLO EUR02-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232422AbjF2HxT (ORCPT ); Thu, 29 Jun 2023 03:53:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QEFqPCs6uE6RPpPVvAAKnAxOP6jsa1r0CuRVCtoG5zQK/QYN+3gA5X/xLtMYCxG+Ic8X4y+HKbMSeonmhb7h8aFJMgoeqEcDNy3GVTFflBlXCk5YASKqI0uEOXHdKbt73x9Q/URHxKiyBGdRuI2Jl3vplrZS0qWcOdPiweNwl/jGzHfFKuBxyPW39Bhvjt5ZiIXV2AsPza7TyvJn3uSSY1UoQLiY+A46lwj2qiYkOh4Zyh5tz5FlbqriV8WZkae7M7+SZBJmZBF/T1SguONFOU71nwmJG2ycgU07SwWrd9lZjalPsqjG1CLW2OmhyKwpfCo8rSNLAp9eeB5xYOY5/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eSI2Qmu64zQHLVJ57XQ4ze1rlixAColllgajHlYDBfg=; b=Wlf6Kfc0/9JLpIJo4gNiF4ANFCtg7ICbnb5ytQjY/aLzmgXuN/XTuMgjmeZgM16nAXpCeaqmV5sF/hpnhg3CCoiBmRVD7lR62ghL9pZi7sdiHobj0dcGjtnZSjjLzTO51qkQao1/EGsqU8MqerJ7S+7NCBPsh01PguTY5xtlJzGg/eVYy/BWzIZgK8f4IPiEqlLsZ0WbiaZsUBe9lDbZFeK+Es8w3jGWJYXjFhGeGewwEu85Nh7JDcemfkjtkJCamYehzli3N0G/ybIHg56tG6ORJ0D2Lv1mi07/gb2WevK5AUq3rRLECcCpyhR0tIPn7b2VD2Ohr8w7nhSGtU2nqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eSI2Qmu64zQHLVJ57XQ4ze1rlixAColllgajHlYDBfg=; b=tAZBDV9WDHhBsG5rpfn+vKQ0Ni983ngk06sZtdmgz90UIKkijssZJ7s0KYcxARUrl1ziSlYDqWVcpYY3r6Ssu4RPEPteoLKbd2IOEjPJOS6NOlggJyLw3DHABBUDW3Onq8Xj1ipwknPfJl1gDr2Q4UxWrimyg5D+sWO49yNQ//0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DB3PR08MB9009.eurprd08.prod.outlook.com (2603:10a6:10:43f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 29 Jun 2023 07:53:15 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::bd0e:a139:9e67:b86d%4]) with mapi id 15.20.6544.019; Thu, 29 Jun 2023 07:53:15 +0000 Message-ID: Date: Thu, 29 Jun 2023 09:53:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 1/4] Input: ts-overlay - Add touchscreen overlay object handling To: Jeff LaBundy Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , Bastian Hecht , Michael Riesch , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org References: <20230510-feature-ts_virtobj_patch-v3-0-b4fb7fc4bab7@wolfvision.net> <20230510-feature-ts_virtobj_patch-v3-1-b4fb7fc4bab7@wolfvision.net> <89cbb534-9371-c2be-0bad-776b51476ce8@wolfvision.net> <543b2d74-eac4-3856-17c6-0654459a91b4@wolfvision.net> Content-Language: en-US From: Javier Carrasco In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR06CA0155.eurprd06.prod.outlook.com (2603:10a6:803:a0::48) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DB3PR08MB9009:EE_ X-MS-Office365-Filtering-Correlation-Id: 45cd38f6-dcfa-4c55-4c68-08db7875e4ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XsEROJ+dGk1JHA6AKyNim52G3JGqL+UY0Iq7Mh93U0E6PGrK/eEw9/ZTI0c5MW5LuIJVqPWMiOrHoWEH+JX5gS5aPQQqEi5Dq5ib9tzXfKQWJKpUe8CVCRWZCwsu77pjoE56NVaWouV/6HTtOsJ4006A7mk/26iyGud1KZXgJlxek+IRzzPEM60rGjWqg24TgyxkwxBKDW4GiIDaa6uh0tG/IGtwr3AJ33LD0CjrHYpkqAHoaHIVXfCJ+xKeaw4yLepRM7GQ3G0byoatqpd7tTi/GgQoU9Bv2NjkJRU6B7Zscu690WCbhqTx8nqN/ket5yeqiWji7pobEpHNE4vYbndI5lad3HtAkBxdegn2mFqdhVdkp9eAAdxmVjnL5EHvnAhAKnNM7h466U47sKjZUlPnlFO1TMhAK0HYyY7K2WQhAwCXtIfhy0/vItUstr96jkmkPgTLWQKlCotpViCkpWmKlMUhkxDArexMjHAb+iRh8KkTudMvNgoHhqkFrzeqLSXQB2X+fImbDln22j0q5Ymvo9V2os906dhjI/qHXeQlh2Yj4J9LRK2h2Qr9BUJeE8Oiz+fjoeS9X8k/520JbKYSgJ+beqEsNll3qZlPWxZdHNWq3CJNzS+r45hCnC9Etvi9gXUjzsGrvnyIwNEjYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39840400004)(376002)(366004)(84040400005)(451199021)(31686004)(7416002)(66946007)(316002)(44832011)(66476007)(6916009)(66556008)(478600001)(4326008)(36756003)(8936002)(66899021)(8676002)(5660300002)(86362001)(31696002)(2906002)(54906003)(41300700001)(6486002)(53546011)(6506007)(6512007)(6666004)(186003)(83380400001)(38100700002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Mjh3VmJjcmRvWXZnSytaNlZLTWVTSHMyNjFCK25GQjI1dmhrSDI1VGpWT01M?= =?utf-8?B?TzgrV3JiclJwN0xlRGh4WXFEM0RxNzNNVmNRK0xzMDkrdlBlTGdyZWpyV1NF?= =?utf-8?B?QkFuSFFRZnZNeGNlUzhUNGJCamdTcThFZGRNRzc1Yk9qSHZheEtuZWNGcDA4?= =?utf-8?B?aTUrV2NnZXM3UjkyQ2tYeHRjNzB0bzFuT3liMmU5VStsOG9wa29FOWtyUXNo?= =?utf-8?B?Q3o4Y285OEtaU3dsUFBVZjNLRC96eTBRRGtld3pEZGJrRnhCd0VaN2tCejRU?= =?utf-8?B?bW5TVHNWNHBkQk9WcEt5M1JEejRUMHI1V3JiNkloSXVNR2NRcW8yYjJBMFZs?= =?utf-8?B?Z0tEOFBOVUVBQ3J0d2JSY2cwRllGZ1pJUjBJcWdCWkFEVy9ObjZFekFQbWh5?= =?utf-8?B?MUd6RnFKK0NUSkh5ZFY3cUdDbGJhcEhBNkJ4VitW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7+1DQAGh4Bdhy4cpgHpMlwNU5e8=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 45cd38f6-dcfa-4c55-4c68-08db7875e4ce X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 07:53:14.9755 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Rpr6jMMXp28RmAryHxrU+FDnpcePvNtiCISUDCh46FBr2jA1FXz0QPiRNIzsTGbaSS6/00fapQqTV4f+8wATd4hd5ljAJLd8zGgu2+sa7nc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB9009 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jeff, On 29.06.23 05:29, Jeff LaBundy wrote: > Hi Javier, > > On Wed, Jun 28, 2023 at 08:44:51AM +0200, Javier Carrasco wrote: > > [...] > >>>>>> +static const char *const ts_overlay_names[] = { >>>>>> + [TOUCHSCREEN] = "overlay-touchscreen", >>>>> >>>>> I'm a little confused why we need new code for this particular function; it's >>>>> what touchscreen-min-x/y and touchscreen-size-x/y were meant to define. Why >>>>> can't we keep using those? >>>>> >>>> According to the bindings, touchscreen-min-x/y define the minimum >>>> reported values, but the overlay-touchscreen is actually setting a new >>>> origin. Therefore I might be misusing those properties. On the other >>>> hand touchscreen-size-x/y would make more sense, but I also considered >>>> the case where someone would like to describe the real size of the >>>> touchscreen outside of the overlay node as well as the clipped size >>>> inside the node. In that case using the same property twice would be >>>> confusing. >>>> So in the end I thought that the origin/size properties are more precise >>>> and applicable for all objects and not only the overlay touchscreen. >>>> These properties are needed for the buttons anyways and in the future >>>> more overlay would use the same properties. >>> >>> Ah, I understand now. touchscreen-min-x/y define the lower limits of the axes >>> reported to input but they don't move the origin. I'm aligned with the reason >>> to introduce this function. >>> >>> This does beg the question as to whether we need two separate types of children >>> and related parsing code. Can we not simply have one overlay definition, and >>> make the decision as to whether we are dealing with a border or virtual button >>> based on whether 'linux,code' is present? >>> >> A single overlay definition would be possible, but in case more objects >> are added in the future, looking for single properties and then deciding >> what object it is might get messy pretty fast. You could end up needing >> a decision tree and the definition in the DT would get more complex. >> >> Now the decision tree is straightforward (linux,code -> button), but >> that might not always be the case. In the current implementation there >> are well-defined objects and adding a new one will never affect the >> parsing of the rest. >> Therefore I would like to keep it more readable and easily extendable. > > As a potential customer of this feature, I'm ultimately looking to describe > the hardware as succinctly as possible. Currently we have two overlay types, > a border and button(s). The former will never have linux,code defined, while > the latter will. From my naive perspective, it seems redundant to define the > overlay types differently when their properties imply the difference already. > > Ultimately it seems we are simply dealing with generic "segments" scattered > throughout a larger touch surface. These segments start to look something > like the following: > > struct touch_segment { > unsigned int x_origin; > unsigned int y_origin; > unsigned int x_size; > unsigned int y_size; > unsigned int code; > }; > > You then have one exported function akin to touchscreen_parse_properties() that > simply walks the parent device looking for children named "touch-segment-0", > "touch-segment-1", etc. and parses the five properties, with the fifth (keycode) > being optional. > > And then, you have one last exported function akin to touchscreen_report_pos() > that processes the touch coordinates. If the coordinates are in a given segment > and segment->code == KEY_RESERVED (i.e. linux,code was never given), then this > function simply passes the shifted coordinates to touchscreen_report_pos(). > > If however segment->code != KEY_RESERVED, it calls input_report_key() based on > whether the coordinates are within the segment. If this simplified solution > shrinks the code enough, it may even make sense to keep it in touchscreen.c > which this new feature is so tightly coupled to anyway. > > I'm sure the devil is in the details however, and I understand the value in > future-proofing. Can you help me understand a potential future case where this > simplified view would break, and the existing definitions would be better? > > Kind regards, > Jeff LaBundy I agree that your approach would reduce the code and then moving this feature to touchscreen.c would be reasonable. So if in the end that is the desired solution, I will go for it. But there are some points where I think the bit of extra code would be worth it. From a DT perspective, I can imagine some scenarios where a bunch of segments scattered around would be messy. An example would be a keypad with let's say N=9 buttons. It could be described easily with a buttons node and the keys inside. Understanding what the node describes would be straightforward as well, let alone N being much bigger. You could argue that the buttons node could have segments inside instead of buttons, but in the case where a cropped touchscreen is also described, you would end up with a segment outside the buttons node and the rest inside. That would reduce the parsing savings. Some labeling would help in that case, but that would be not as clear as the current implementation. There is another point that I will just touch upon because I have no experience in the matter. I have seen that some keys use the 'linux,input-type' property to define themselves as keys, switches, etc. If that property or any other that I do not know is necessary for other implementations, the button object will cover them better than a generic segment where half of the properties would be meaningless in some scenarios. Buttons/keys are so ubiquitous that a dedicated object for them does not look that bad imho. But as I said, I do not want to make a strong statement here because I have seen that you maintain several bindings where this properties are present and I am not the right person to explain that to you... or actually anyone else out there :) Talking about the code itself, having a structure for buttons is handy because you can keep track of the button status (e.g. pressed) and in the end it is just a child of the base shape that is used for the overlay touchscreen. The same applies to any function that handles buttons: they just wrap around the shape functions and add the button-specific management. So if the parsing is taken aside, the code does not get much savings from that side and it is again much more readable and comprehensible. Thank you for your efforts to improve these patches and the constructive discussion. Best regards, Javier Carrasco