Message ID | 20230718-feature-lcd-panel-v1-3-e9a85d5374fd@wolfvision.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1851920vqt; Tue, 18 Jul 2023 09:07:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlFLi2m0Tl8wyZbHTV63Fets37dFCJPBcgDdWcare9M73t/8c0voVeHm35tcdX0+fcUaC8+P X-Received: by 2002:a17:90a:eb17:b0:25f:20f:2f7d with SMTP id j23-20020a17090aeb1700b0025f020f2f7dmr14513953pjz.2.1689696442595; Tue, 18 Jul 2023 09:07:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689696442; cv=pass; d=google.com; s=arc-20160816; b=e9/jatPq/YSwW/duuw96CThJ1S3AgdEs1zO/FpMpsozI5JL/S8bCT8SkK/CXnuMgvZ e5NO2cGzurWtqQWxE3a+3VvfJMhtjrzSPtp34VWBEq47NS6etLXfoHAWeVLTiOfaW/7m NwE52qGpv4pwLbdcXPl/9QedilT9VF4VFtrOcQ62r2G1ouQCwQ9jDTGLXQY1YQRJBuJK K5RcZC6zN2UjgTWRLFlptXYDIXcoVA2+kw/uws1FCHwvLpXd4EIRl5iYb+d1U1OUbjHH oEY2tbyFdcGjR/FkjaBf49VJNgmF0N8v2I0lP1tmsP/pH8eIcxxvd8kNb+t/nwGX80je V2Fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:in-reply-to:references :message-id:content-transfer-encoding:subject:date:from :dkim-signature; bh=bahtR5u3eXvX7PUqZt+TFypJQJ9zUX6zk+Qjn5hZJqA=; fh=Tq5vakelb7Evvy1hSU1bJIwKBl0VAr7pcHQ3+RKee2k=; b=wdFuLTjk3NZHCHw7Ws8SAWcAR+jMGbDFdwDs9BQJzn8IQQnYEkKZS4MbIdLPXjqS4P QUtps4WDliuYoFAjVlbI7AFbXhrgVtLIydIIXtM206pB7GKNBqxJZn2WRgDQawVp7KgI f3OKrtEuuZRSqQ07YQJKYmcRnNK147+EMkUvMiF5Ck+RGhjw4Kf5/gzK6a4YnW+hTSzL 5eF6+UUfLtBRTOmU2QKYljgx14R50CDIzzKTT2cER2krmLp+foMwYjQSedsevyMrECHX OvenzMzRL4BEgqKtfb0zMMEPKiqh3Cmw+CBRuNp8c8q53T4EcXjz8dKVnews+tcPdDQ2 xeyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=fpAQ8Df0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a17090abd9600b00258ee17486bsi1799221pjr.160.2023.07.18.09.07.09; Tue, 18 Jul 2023 09:07: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=fpAQ8Df0; 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 S232513AbjGRPcO (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Tue, 18 Jul 2023 11:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233673AbjGRPcJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 11:32:09 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2077.outbound.protection.outlook.com [40.107.105.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D16992; Tue, 18 Jul 2023 08:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L3d08Dsri7bOk3yeHQBb1oPUgieo67JLCUBRaqkkounNBYruQd1SCP6eyRrZVT2BdM4zlOt6+0yCR3FCWZJ/z1PeNjLLdvuEXnqr7GTHJUX09sP1g8LdIsdcfmaLHWc2YcRht/+m1tUUCwjUcLWRnpQnRs+cEDFeLwVn/ZLldUYK5M0xmwwurtXTfrdzAbMMrZvv2QiPfN6WBpeN6xse17CmnvTHvM4uvgllBnfPrE9eoM7Oiuz4DPUafsmALTpR1TSHI+tBeDUiW1pncCv7PKw1J9QkXsn7u4R/apg6+Ja4uIL9lhdYrPiCEEno10e/lUkrt+3jdfaNlfNRwUnDxQ== 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=bahtR5u3eXvX7PUqZt+TFypJQJ9zUX6zk+Qjn5hZJqA=; b=f4GcwWyXjq3eejvlFqLcUt67ujn1KQB2HTVL4hiSZvyCZfHcSn/JUlcEEoJVCbfnWQt8slw0dzX64xyNreUN///R0XP9HwBWmbk6lJzoU2zedTkQxOaK2iu4KIdymxqiF1UJz8W2pFj0CdIpg7qWZhdRZvukyFDpuj538tYKbzxuYtXiuXiJ64+D165Pv9oGY7GRBEQrW98ss6L2OohihHG6QoFITr2TF+OTHF0WqyzLD8TV/lFqcp1tRhNllRzY2VygDI3GkPtCxaIOMFzdmGln/UiR85rGgAZS/KxtvSKnosnW0VJguwhEw2DFHEciFVEUOykatKF+qDRpZWxdcA== 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=bahtR5u3eXvX7PUqZt+TFypJQJ9zUX6zk+Qjn5hZJqA=; b=fpAQ8Df01H0z1pv29U4UcISprs6+8zqkRFRwXftT9IT/cJe8+LVY2RLoc1TihPAQaky64GbFUshF/9Odj1bANaHC0KEn9tx/Dn8H7sjdrEZkcOl52xTk0Q38Y2Xlls6p5AgKjpaOZITfryVmlniZ+CzmnlcGh+Jp0hUJUcqsOm4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by DU2PR08MB10201.eurprd08.prod.outlook.com (2603:10a6:10:496::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul 2023 15:31:56 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4fd7:91a9:a92b:295a]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4fd7:91a9:a92b:295a%4]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023 15:31:56 +0000 From: Michael Riesch <michael.riesch@wolfvision.net> Date: Tue, 18 Jul 2023 17:31:52 +0200 Subject: [PATCH 3/4] drm/panel: sitronix-st7789v: add support for partial mode Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230718-feature-lcd-panel-v1-3-e9a85d5374fd@wolfvision.net> References: <20230718-feature-lcd-panel-v1-0-e9a85d5374fd@wolfvision.net> In-Reply-To: <20230718-feature-lcd-panel-v1-0-e9a85d5374fd@wolfvision.net> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Neil Armstrong <neil.armstrong@linaro.org>, Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Maxime Ripard <mripard@kernel.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Sebastian Reichel <sre@kernel.org>, Gerald Loacker <gerald.loacker@wolfvision.net> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Riesch <michael.riesch@wolfvision.net> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1689694312; l=3168; i=michael.riesch@wolfvision.net; s=20230406; h=from:subject:message-id; bh=jeJJ+u4OpfXsl48pQ7Q1EFWjMOtdcHSSY9AikfRBA2c=; b=knE3W7nh8qLU99h6O3VwPeWN9JwfRa5ph4S01oDDKG8Z/dGP/J2qc2GhE3OSG2D016/1huSXy HC7dMmglbyQCByFB+UnQdTGX1qiPaGPSYjGGn9faqc+FhteFiWOrNB7 X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=G03kuYHL670EcdsWaNfVA7KnHWmkSpj98XziQm/hjbk= X-ClientProxiedBy: VI1PR0102CA0027.eurprd01.prod.exchangelabs.com (2603:10a6:802::40) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DU2PR08MB10201:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f2a0475-97d0-40ac-2246-08db87a41e9b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t9yjwTodAoQGx7mUOA0MWGcdmxEEF6haZGCBmB+2dtsv10J2Trd3imkFCJ07xe6150lZ41C0kOiuKwFYnWbQ8m/4/sCDQgRfjXX2VYe9c6Ppra2pF6kRfsOHfeUN3N0fw+il3KFZk8SfoPtVB4LNmgyTDYUGzslYPDGSbo5IbBiSfwNFwAqicDUxJ5vRSDYlZR+x01NUAGMQ+gHmqAZdry9IYG5saukLb7oIocJ1Dp6Pt7f0Q5m2LRKx7XF9PFFtwx/jpDcxCi62B73hvgeUJ+eoebLuqrMJTMFfHn/R1ipJE/tNKICCqVJnzH4pLaYyd2YvpWrmM0e0zI6y+F4svZ8tBEafrN0f7beGV771oA6gjGbgubhZEwGOP+X+OI7bOWb/hRalU0exkKPw7ewBxd37Mx97WNRJqatJYdRn1qSNtY3utvlV1oiIdgeXfg6eEaCnc01Ci84dcBWCcOwFZtILs2YVya5HGR02wKVs2aXXNO1vPI/jdg+7h8C0lKQXrIRdg3B01voYD4LIwhMCGNE/UBfJQbbS5WZHqD+laxt2aG3u/XS62KHwEPEKq/aWIv3rYSVoy9CyHngfNCzadAVgFhfRdecCdKBD/U8m6r9OAFi3LBfztiNVJ8i2IpUn/ANlmlivKEQ58Csy2+3YDQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(366004)(39840400004)(346002)(451199021)(6486002)(107886003)(52116002)(26005)(6506007)(6512007)(38350700002)(2616005)(83380400001)(86362001)(38100700002)(921005)(186003)(36756003)(8676002)(8936002)(2906002)(41300700001)(478600001)(7416002)(5660300002)(4326008)(6636002)(316002)(66556008)(66946007)(66476007)(44832011)(110136005)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?poZIA1neP2OhgrPFhZNClCniFcOb?= =?utf-8?q?ukVmzRgL+jWlaAMQbXyBcuhxOyo1OErsQPLGnj5sS087RjJU2kUI8lcr7W4ym4uTb?= =?utf-8?q?2Wq1kDFolB/wLXuKK3b2h7l8SpC/KqhHc8zp+6AtJF/8BVJzfc+8ID/ltzFObiesD?= =?utf-8?q?t/G7GgsNi1SeWcKcoLcLARe5WwVlcRJle92AA0AFbh/XUjUu/fuvRg04ev9uMaWlx?= =?utf-8?q?uz5GjkfcPANxGi0hrkm0tz1WUPaRT9LQ+0jlfv82frSBesnTn1nxsOl4Cxxptoz+o?= =?utf-8?q?8ijT+7SzCsvmKkSgFFk2YSM+oGS20hB7zNjWiqVXMiY1QEg+8XFT2yctyURkHZd8j?= =?utf-8?q?DpXLwuZ2j2zRAFwu3nuIe5K9UFL58SGi+vDW/7MQ8eDwbEjcvX0t0LOl04ih34vhS?= =?utf-8?q?opirLD7kEWiidzQgq1NnnPgP3LsXNtc2/dKSoI4465HGYueaVMMMVSzwdncX/GZYp?= =?utf-8?q?swIkhBGlgzatLzQWJLo3lPidClFXchxGYRbw68ezo14Cyhx9e4mwiO5GeE3jK6sGm?= =?utf-8?q?wVS1ZLfVNO28TnyiRQjW5yxKNjXgDC18DpXxap4g9Glg9YvYvXjIxuZe2vhxv2Ppz?= =?utf-8?q?UKZgGmDXylihQHm3v+vSrHObHVRZYftZiZobwY3JsPnp56XAp25G48KSQS4fQH49g?= =?utf-8?q?7V1Pbvtp8EMfMcZ8wu2MXI2cu/ycleQNW2XAPtL6bBTtjEcWzRbifBdHgQPwcmunO?= =?utf-8?q?5pbC3exi5QRKbv5EWDJXfu3BWrYJpI4zXQ5neelCeuinD6rUMWoZaUt3qnzHRAKiw?= =?utf-8?q?+aRNmc4l8ByUYfnbt2csegSah5rlJMqKEi7En3M3jQNxTt30zkN9q5cqKVPAcDOdr?= =?utf-8?q?IRQeqf8zyqtGoxIxaOUOvRLNg8RTdC51PD7hk0QJOT6sAxGbCLB3TlG6drPWss1TL?= =?utf-8?q?hG9RjHIFx030AfPNVts/PmA5XvxHtuwGQh70bjYgqBVimE6vkXVDdsV7r3GP1ksSX?= =?utf-8?q?b6uVc7ZWokCpiQLpPtdoOdAgkpO9RN1WugQ11/M+HllJTP+aAO4BI4tTtQRN2Aw3R?= =?utf-8?q?4W4Ety7LKRIiP29iOBYuRsx+zpwDiFYdj2zFPYxx2xdRIiRs4M9O01Uav/opM+mrZ?= =?utf-8?q?kMkNHm4pWVq0GZug/Ft3fQcvKokrcNNMIMvCzfLs6SdVKeovjB5/NqGxCeQKgJyKf?= =?utf-8?q?UyXSHfI+GUfECIDIytreuKFWPjBWTAAy4943gT4ECaPdukbYy1F3Fyr2kYejwgVeW?= =?utf-8?q?psJRogGHrUHIjaweOiKEs1Dq0EtksGQs58W6C+w6UjIH3XjeQbhSIuHSLH0ebqopW?= =?utf-8?q?h9gf57qq0obZiwZvkWQT4OYE/o5dPUbGLToDcZpP4g+Dh6Q/XTxjE9+5DgXdb2ZVc?= =?utf-8?q?xmyG/XEOBWplgddTmeXEfvAfUgYF+ujQxD1kPVoUOL9Jy4Ji37kpFnh2AX0jfUMYa?= =?utf-8?q?/pentqysUNJwKtqutjpn+0iJqEP1mRsWqhtQlhhDLxaNlEM/g9XGTvRUkPWbl7BA0?= =?utf-8?q?5QXjI7oMDzg9e/P8M8AZbAzyjsu8s1vZ0eLh6yNDEPz6uXtL+2qgpEtihggRpb3Hh?= =?utf-8?q?nDmIGjwsZdDZKrpQM5JG8IlID73+kgKkSw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 5f2a0475-97d0-40ac-2246-08db87a41e9b X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 15:31:56.1902 (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: dC8lpJQzRT6+atZm38LmsJEpK1Gw7Wvr3CrN6FVGxZq/x1Q07NlxSmXnkrLIMCn4c3pfVLICqg2UxbemBCJElZKJmgzVb3WETzwyGdPlBMw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10201 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771775136833839303 X-GMAIL-MSGID: 1771775136833839303 |
Series |
drm/panel: sitronix-st7789v: add support for partial mode
|
|
Commit Message
Michael Riesch
July 18, 2023, 3:31 p.m. UTC
The ST7789V controller features support for the partial mode. Here,
the area to be displayed can be restricted in one direction (by default,
in vertical direction). This is useful for panels that are partially
occluded by design. Add support for the partial mode.
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 38 ++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
Comments
Hi, On Tue, Jul 18, 2023 at 05:31:52PM +0200, Michael Riesch wrote: > The ST7789V controller features support for the partial mode. Here, > the area to be displayed can be restricted in one direction (by default, > in vertical direction). This is useful for panels that are partially > occluded by design. Add support for the partial mode. > > Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> We already had that discussion, but I think we shouldn't treat this any differently than overscan for other output. Maxime
Hi Maxime, On 7/19/23 08:39, Maxime Ripard wrote: > Hi, > > On Tue, Jul 18, 2023 at 05:31:52PM +0200, Michael Riesch wrote: >> The ST7789V controller features support for the partial mode. Here, >> the area to be displayed can be restricted in one direction (by default, >> in vertical direction). This is useful for panels that are partially >> occluded by design. Add support for the partial mode. >> >> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> > > We already had that discussion, but I think we shouldn't treat this any > differently than overscan for other output. Indeed we had that discussion. For reference, it can be found here: https://lore.kernel.org/dri-devel/20230329091636.mu6ml3gvw5mvkhm4@penduick/#t The thing is that I am still clueless how the overscan approach could work. I found some DRM properties related to overscan/margins and I guess userspace needs to set those. On my system weston is running. Is weston in charge of configuring the corresponding output so that the correct margins are applied? If so, how can this be achieved? Will DRM handle the properties generically or does the driver need to do some work as well? In any case it could make sense to write the partial mode registers and enter the effective dimensions. At least I have seen this in other panel drivers. Thanks and best regards, Michael > > Maxime
Hi, On Wed, Aug 02, 2023 at 02:34:28PM +0200, Michael Riesch wrote: > On 7/19/23 08:39, Maxime Ripard wrote: > > On Tue, Jul 18, 2023 at 05:31:52PM +0200, Michael Riesch wrote: > >> The ST7789V controller features support for the partial mode. Here, > >> the area to be displayed can be restricted in one direction (by default, > >> in vertical direction). This is useful for panels that are partially > >> occluded by design. Add support for the partial mode. > >> > >> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> > > > > We already had that discussion, but I think we shouldn't treat this any > > differently than overscan for other output. > > Indeed we had that discussion. For reference, it can be found here: > https://lore.kernel.org/dri-devel/20230329091636.mu6ml3gvw5mvkhm4@penduick/#t > The thing is that I am still clueless how the overscan approach could work. > > I found some DRM properties related to overscan/margins and I guess > userspace needs to set those. On my system weston is running. Is weston > in charge of configuring the corresponding output so that the correct > margins are applied? If so, how can this be achieved? I don't really know Weston, but my guess would be based on some configuration or user feedback, depending on which case we're in. We also set the default using some kernel command-line options. > Will DRM handle the properties generically or does the driver need to do > some work as well? What do you mean by generically? > In any case it could make sense to write the partial mode registers and > enter the effective dimensions. At least I have seen this in other panel > drivers. Sure, it makes sense. It shouldn't come from the DT and be fixed though. Maxime
Hi all, In order to avoid spamming the list, I sparked a discussion in #dri-devel. FTR the log can be found here: https://oftc.irclog.whitequark.org/dri-devel/2023-08-02#32360491; On 8/2/23 14:47, Maxime Ripard wrote: > Hi, > > On Wed, Aug 02, 2023 at 02:34:28PM +0200, Michael Riesch wrote: >> On 7/19/23 08:39, Maxime Ripard wrote: >>> On Tue, Jul 18, 2023 at 05:31:52PM +0200, Michael Riesch wrote: >>>> The ST7789V controller features support for the partial mode. Here, >>>> the area to be displayed can be restricted in one direction (by default, >>>> in vertical direction). This is useful for panels that are partially >>>> occluded by design. Add support for the partial mode. >>>> >>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> >>> >>> We already had that discussion, but I think we shouldn't treat this any >>> differently than overscan for other output. >> >> Indeed we had that discussion. For reference, it can be found here: >> https://lore.kernel.org/dri-devel/20230329091636.mu6ml3gvw5mvkhm4@penduick/#t >> The thing is that I am still clueless how the overscan approach could work. >> >> I found some DRM properties related to overscan/margins and I guess >> userspace needs to set those. On my system weston is running. Is weston >> in charge of configuring the corresponding output so that the correct >> margins are applied? If so, how can this be achieved? > > I don't really know Weston, but my guess would be based on some > configuration or user feedback, depending on which case we're in. > > We also set the default using some kernel command-line options. > >> Will DRM handle the properties generically or does the driver need to do >> some work as well? > > What do you mean by generically? I guess my question can be reduced to "What does the driver have to do to support this overscan thingy?" If the overscan approach is the preferred one, then I'd appreciate some pointers as to how this could work. >> In any case it could make sense to write the partial mode registers and >> enter the effective dimensions. At least I have seen this in other panel >> drivers. > > Sure, it makes sense. It shouldn't come from the DT and be fixed though. However, as indicated in Daniel Vetter's summary of the IRC discussion, the overscan properties may not be the preferred solution in this case. Looking forward to further comments (alternatively, to seeing this patch series getting applied :-)) Best regards, Michael
Hi Michael, On 18/07/2023 17:31, Michael Riesch wrote: > The ST7789V controller features support for the partial mode. Here, > the area to be displayed can be restricted in one direction (by default, > in vertical direction). This is useful for panels that are partial > occluded by design. Add support for the partial mode. Could you send a v2 with a comment in the code as Maxime suggests ? Thanks, Neil > > Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> > --- > drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 38 ++++++++++++++++++++++++-- > 1 file changed, 36 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c > index d16d17f21d92..729d8d7dbf7f 100644 > --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c > +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c > @@ -118,6 +118,9 @@ struct st7789_panel_info { > u32 bus_format; > u32 bus_flags; > bool invert_mode; > + bool partial_mode; > + u16 partial_start; > + u16 partial_end; > }; > > struct st7789v { > @@ -330,9 +333,14 @@ static int st7789v_get_modes(struct drm_panel *panel, > static int st7789v_prepare(struct drm_panel *panel) > { > struct st7789v *ctx = panel_to_st7789v(panel); > - u8 pixel_fmt, polarity; > + u8 mode, pixel_fmt, polarity; > int ret; > > + if (!ctx->info->partial_mode) > + mode = ST7789V_RGBCTRL_WO; > + else > + mode = 0; > + > switch (ctx->info->bus_format) { > case MEDIA_BUS_FMT_RGB666_1X18: > pixel_fmt = MIPI_DCS_PIXEL_FMT_18BIT; > @@ -472,6 +480,32 @@ static int st7789v_prepare(struct drm_panel *panel) > MIPI_DCS_EXIT_INVERT_MODE)); > } > > + if (ctx->info->partial_mode) { > + u8 area_data[4] = { > + (ctx->info->partial_start >> 8) & 0xff, > + (ctx->info->partial_start >> 0) & 0xff, > + ((ctx->info->partial_end - 1) >> 8) & 0xff, > + ((ctx->info->partial_end - 1) >> 0) & 0xff, > + }; > + > + ST7789V_TEST(ret, st7789v_write_command( > + ctx, MIPI_DCS_ENTER_PARTIAL_MODE)); > + > + ST7789V_TEST(ret, st7789v_write_command( > + ctx, MIPI_DCS_SET_PAGE_ADDRESS)); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); > + > + ST7789V_TEST(ret, st7789v_write_command( > + ctx, MIPI_DCS_SET_PARTIAL_ROWS)); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); > + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); > + } > + > ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RAMCTRL_CMD)); > ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RAMCTRL_DM_RGB | > ST7789V_RAMCTRL_RM_RGB)); > @@ -479,7 +513,7 @@ static int st7789v_prepare(struct drm_panel *panel) > ST7789V_RAMCTRL_MAGIC)); > > ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RGBCTRL_CMD)); > - ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_WO | > + ST7789V_TEST(ret, st7789v_write_data(ctx, mode | > ST7789V_RGBCTRL_RCM(2) | > polarity)); > ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_VBP(8))); >
Hi Neil, On 8/4/23 10:41, Neil Armstrong wrote: > Hi Michael, > > On 18/07/2023 17:31, Michael Riesch wrote: >> The ST7789V controller features support for the partial mode. Here, >> the area to be displayed can be restricted in one direction (by default, >> in vertical direction). This is useful for panels that are partial > >> occluded by design. Add support for the partial mode. > > Could you send a v2 with a comment in the code as Maxime suggests ? Sure thing! I must admit that I do not understand his concerns exactly, though. @Maxime: I can prepare a suggestion but feel free to tell me the exact wording at the preferred position. Best regards, Michael > > Thanks, > Neil > >> >> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> >> --- >> drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 38 >> ++++++++++++++++++++++++-- >> 1 file changed, 36 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c >> b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c >> index d16d17f21d92..729d8d7dbf7f 100644 >> --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c >> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c >> @@ -118,6 +118,9 @@ struct st7789_panel_info { >> u32 bus_format; >> u32 bus_flags; >> bool invert_mode; >> + bool partial_mode; >> + u16 partial_start; >> + u16 partial_end; >> }; >> struct st7789v { >> @@ -330,9 +333,14 @@ static int st7789v_get_modes(struct drm_panel >> *panel, >> static int st7789v_prepare(struct drm_panel *panel) >> { >> struct st7789v *ctx = panel_to_st7789v(panel); >> - u8 pixel_fmt, polarity; >> + u8 mode, pixel_fmt, polarity; >> int ret; >> + if (!ctx->info->partial_mode) >> + mode = ST7789V_RGBCTRL_WO; >> + else >> + mode = 0; >> + >> switch (ctx->info->bus_format) { >> case MEDIA_BUS_FMT_RGB666_1X18: >> pixel_fmt = MIPI_DCS_PIXEL_FMT_18BIT; >> @@ -472,6 +480,32 @@ static int st7789v_prepare(struct drm_panel *panel) >> MIPI_DCS_EXIT_INVERT_MODE)); >> } >> + if (ctx->info->partial_mode) { >> + u8 area_data[4] = { >> + (ctx->info->partial_start >> 8) & 0xff, >> + (ctx->info->partial_start >> 0) & 0xff, >> + ((ctx->info->partial_end - 1) >> 8) & 0xff, >> + ((ctx->info->partial_end - 1) >> 0) & 0xff, >> + }; >> + >> + ST7789V_TEST(ret, st7789v_write_command( >> + ctx, MIPI_DCS_ENTER_PARTIAL_MODE)); >> + >> + ST7789V_TEST(ret, st7789v_write_command( >> + ctx, MIPI_DCS_SET_PAGE_ADDRESS)); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); >> + >> + ST7789V_TEST(ret, st7789v_write_command( >> + ctx, MIPI_DCS_SET_PARTIAL_ROWS)); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); >> + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); >> + } >> + >> ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RAMCTRL_CMD)); >> ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RAMCTRL_DM_RGB | >> ST7789V_RAMCTRL_RM_RGB)); >> @@ -479,7 +513,7 @@ static int st7789v_prepare(struct drm_panel *panel) >> ST7789V_RAMCTRL_MAGIC)); >> ST7789V_TEST(ret, st7789v_write_command(ctx, >> ST7789V_RGBCTRL_CMD)); >> - ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_WO | >> + ST7789V_TEST(ret, st7789v_write_data(ctx, mode | >> ST7789V_RGBCTRL_RCM(2) | >> polarity)); >> ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_VBP(8))); >> >
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index d16d17f21d92..729d8d7dbf7f 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -118,6 +118,9 @@ struct st7789_panel_info { u32 bus_format; u32 bus_flags; bool invert_mode; + bool partial_mode; + u16 partial_start; + u16 partial_end; }; struct st7789v { @@ -330,9 +333,14 @@ static int st7789v_get_modes(struct drm_panel *panel, static int st7789v_prepare(struct drm_panel *panel) { struct st7789v *ctx = panel_to_st7789v(panel); - u8 pixel_fmt, polarity; + u8 mode, pixel_fmt, polarity; int ret; + if (!ctx->info->partial_mode) + mode = ST7789V_RGBCTRL_WO; + else + mode = 0; + switch (ctx->info->bus_format) { case MEDIA_BUS_FMT_RGB666_1X18: pixel_fmt = MIPI_DCS_PIXEL_FMT_18BIT; @@ -472,6 +480,32 @@ static int st7789v_prepare(struct drm_panel *panel) MIPI_DCS_EXIT_INVERT_MODE)); } + if (ctx->info->partial_mode) { + u8 area_data[4] = { + (ctx->info->partial_start >> 8) & 0xff, + (ctx->info->partial_start >> 0) & 0xff, + ((ctx->info->partial_end - 1) >> 8) & 0xff, + ((ctx->info->partial_end - 1) >> 0) & 0xff, + }; + + ST7789V_TEST(ret, st7789v_write_command( + ctx, MIPI_DCS_ENTER_PARTIAL_MODE)); + + ST7789V_TEST(ret, st7789v_write_command( + ctx, MIPI_DCS_SET_PAGE_ADDRESS)); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); + + ST7789V_TEST(ret, st7789v_write_command( + ctx, MIPI_DCS_SET_PARTIAL_ROWS)); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[0])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[1])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[2])); + ST7789V_TEST(ret, st7789v_write_data(ctx, area_data[3])); + } + ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RAMCTRL_CMD)); ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RAMCTRL_DM_RGB | ST7789V_RAMCTRL_RM_RGB)); @@ -479,7 +513,7 @@ static int st7789v_prepare(struct drm_panel *panel) ST7789V_RAMCTRL_MAGIC)); ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RGBCTRL_CMD)); - ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_WO | + ST7789V_TEST(ret, st7789v_write_data(ctx, mode | ST7789V_RGBCTRL_RCM(2) | polarity)); ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RGBCTRL_VBP(8)));