Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1140153rwb; Thu, 18 Aug 2022 20:23:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ep9NQo+IsXq6N/pZVyTCn3GuZw55zDhbQ+rS6U0AOjRfmv0OYVldt0sLz2E5Bid7heRTc X-Received: by 2002:a17:903:41c6:b0:16f:3d1:f63 with SMTP id u6-20020a17090341c600b0016f03d10f63mr5362501ple.50.1660879396931; Thu, 18 Aug 2022 20:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660879396; cv=none; d=google.com; s=arc-20160816; b=slvJZmeWx2s8Dpe4WR9C6lbaDZ2Gf13kq1MlP8yCYtkj8VyCeOVqYd/y/+gXS/wbea ERW6uilm20LGXPgHcmZs1KEsj2mpHIpTXxbYn53a+XbPbpgCgGi3mcz+WT5YItIhFbLg wc9N8rlSpKfpKWWbDgvi0GIbMRl+puEziWSn0WzFa8JPVY1JdwE3iyqouScthq2N5W5X masexOpKl7rui3ywkkBatFh3NyIC8DMq+GHi7dcQKt3qrPNQ5ccPwuXzYjgoprpgjYVU 8ArubPLJiIvzWOu3kW5meWbNmAEV+u48SetMPkiosQV/uqFMXBfiGD7rZ/NxyA0ESj2h qGBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=cjS4FB8Xn6Fk5xAao9JqkTW7r45Ht24vCAy8MBxAcDg=; b=H/2iRsrMaLv0kbItd3AcKulDdLIAUg1MBoKlEM433AInLugj2UipFe4L0IA/ESRrxs 7/A4Dh9xR5KXpl/aHj3kpuJ7/wfIW9baLuuIMOAm+PeKRUqMpOS03UrgnoLksLfHZdIc IgjL3k0tsyP4Uoaq2Ashb6KbMmW9tqMnw4VExss71K+rLWsuFfy1dvfwr0wI9E9GKpo/ 3hvA9rxbWNoLzadZDAPfshuhwelQndbUebqIHGueROr6iBszbJ2wQMLIPGqenaH1KE8n fgqVcsw/S8HcFZlcaRk52LrZtLrjII6phU+nezEUN8H/X8uYJgQl0x78Sh/7kF4TKGjY 4Sjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=GXFQhoiC; 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=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a170903244c00b0016d785ef6ebsi3100954pls.104.2022.08.18.20.23.06; Thu, 18 Aug 2022 20:23:16 -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=@connolly.tech header.s=protonmail header.b=GXFQhoiC; 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=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344497AbiHSCpk (ORCPT + 99 others); Thu, 18 Aug 2022 22:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245111AbiHSCpZ (ORCPT ); Thu, 18 Aug 2022 22:45:25 -0400 Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 953515AC7C for ; Thu, 18 Aug 2022 19:45:23 -0700 (PDT) Date: Fri, 19 Aug 2022 02:45:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1660877121; x=1661136321; bh=cjS4FB8Xn6Fk5xAao9JqkTW7r45Ht24vCAy8MBxAcDg=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=GXFQhoiClE+wIsNtirNqWGkUIhyt2vHNQUIb1DLN/4kynuj6gdg9JLnRlDHmFkL// Yo6RfjO8EDz3z2X6TE5k36eV/cIRyfx+2OJNz8+Qrjkj4yT9NHe2Mg/SJMsOvv+3MB IebDwT28S7DKbtSPYWewq/qNvcjg0kyMOLSVR69Y= To: Konrad Dybcio , Joel Selvaraj , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski From: Caleb Connolly Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Reply-To: Caleb Connolly Subject: Re: [PATCH 0/5] Add support for Xiaomi Poco F1 EBBG variant Message-ID: In-Reply-To: References: Feedback-ID: 10753939:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/07/2022 21:43, Konrad Dybcio wrote: > > > On 8.07.2022 13:12, Joel Selvaraj wrote: >> There are two variants of Xiaomi Poco F1. >> - Tianma variant with NOVATEK NT36672A panel + touchscreen manufactured >> by Tianma >> - EBBG variant with Focaltech FT8719 panel + touchscreen manufactured >> by EBBG >> >> The current sdm845-xiaomi-beryllium.dts represents tianma panel variant. >> >> To add support for the EBBG variant, let's split this into 3 files, >> - sdm845-xiaomi-beryllium-common.dtsi which contains all the common node= s >> - sdm845-xiaomi-beryllium-tianma.dts for the tianma variant >> - sdm845-xiaomi-beryllium-ebbg.dts for the ebbg variant >> >> Note: >> ----- >> Both the panels are already upstreamed and the split is based on them. >> There were patches earlier for both the touchscreens, but they are not >> accepted upstream yet. Once they are accepted, we will add them to >> respective variants. > Hi, > > I believe this is not the correct approach. This may work short-term, but > you will have to prepare 2 separate images for the device and mistaking t= hem > may cause irreversible hw damage at worst, or lots of user complaining at= best. > Instead, I think it's about time we should look into implementing dynamic= panel > detection. > > Qualcomm devices do this by parsing the command line [1], as LK/XBL > gives you a nice-ish string to work with that you can simply match > against a label. Other vendors may use custom mechanisms, such as > a resistor / GPIO to determine which panel (or generally hw config), > but implementing this mechanism would make upstreaming of lots of other > devices easier.. Regarding dynamic panel detection. A mechanism for choosing DT nodes based = on some generic (read: extensible) matching feature would be pretty neat.... e.g. matching cmdline: panel { =09compatible =3D "some,w3ird-panel"; =09/* Only attempt to probe a driver for this node if cmdline contains =09 * this string. How this is described and the type(s) of matching to =09 * use could be defined. =09 */ =09match-if-cmdline =3D "msm_drm.dsi_display0=3Dsome_w3ird-panel"; }; or perhaps GPIO state: panel { =09compatible =3D "some,w3ird-panel"; =09/* Only attempt to probe a driver for this node if GPIO 43 on tlmm is hi= gh, =09 * and GPIO 44 is low. =09 */ =09match-if-gpios =3D <&tlmm 43 GPIO_ACTIVE_HIGH>, <&tlmm 44 GPIO_ACTIVE_LO= W>; }; This certainly introduces the temptation to do awful things... > > This issue concerns many phones (and well, devices in general), as > they are seldom made with only one configuration due to supply chain > strategies. It would be really nice to solve this in-kernel, chainloading a bootloader = sometimes kinda sucks. > > > Konrad > > [1] https://github.com/LineageOS/android_kernel_xiaomi_sdm845/blob/lineag= e-19.1/drivers/gpu/drm/msm/dsi-staging/dsi_display.c -- Kind Regards, Caleb