From patchwork Fri Aug 4 13:02:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 131179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp267128vqb; Fri, 4 Aug 2023 06:36:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb13S1n2+x/gKrdOX89lmagYWnwSbJt4sUVEeEqghYP58YY0RGVvrcRA0CcFRUQ8Uz1Np9 X-Received: by 2002:a05:6a00:21cb:b0:653:de9a:d933 with SMTP id t11-20020a056a0021cb00b00653de9ad933mr1761793pfj.17.1691156165371; Fri, 04 Aug 2023 06:36:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691156165; cv=pass; d=google.com; s=arc-20160816; b=yIRJjz6ZhwBKtIes7vSPUmfXy7VFBKzTM1cWsCOTT4CZ8D5tF4O4R5neOuX/hNbSkK y0i+eGQ4fC/THHUjjyIHXkISbLkKZJW2rpVDzVX9duTmiL3u21yWJEczvD3MiE4XzgZX 5OuuT828BmxkQCgUoWhqddAQ2tGFgzespjxt7952/J/kOR0Hm5DaGuuLhdoDJfvPGNzW qXSf9CipmBuPC9cf/VWkAfNWFV83LZcFUj6IT20gZBI1YQOH+NAxsCRVPdVdTHMK4RYs a+LccFXqSXdidG1TEy1CWm7m0pMlrzE2fuFne0IFgbnD3X2MhUJTjPNWkeN3x3LPR9iq mlww== 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=ac5f6Oxahs92G9BhJ5ffEeT3JoNdmuQaXl2k1ppr2BE=; fh=Tq5vakelb7Evvy1hSU1bJIwKBl0VAr7pcHQ3+RKee2k=; b=gc42BKMC5ZSNM8wL5QLhQdeCtyvcAv7YUsjyo+I15jAQFqlsCspu7YnyiWcAQ5gZBJ 9DsaQ5rLduTGZxQ68gFUY0b66MjgaCdriUxXPwGyDMn8eROsiGjkiAZVE77U8EnCw6nU Fnv0dVr7i/12hFTwfdVRETuMNE22TyoXE+/cofJn9W3KzaZ+m9bitTSvAkBqbCbE8vZX t2nGaZjh2fwx3tN7n9JKc2QrEpdIc7eKv4WzasV3VIdlO0woocx5hQdxGcB5GoUZEfrt NzasGa1Okw0tWXlDJvytmaBl3LrEJjlPQ8r65RifHcrnnGradGALNNV8mUVtT8Gjjlwc ZkvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=I1CdbpaG; 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 j63-20020a638b42000000b005346b8dae84si1761046pge.787.2023.08.04.06.35.50; Fri, 04 Aug 2023 06:36:05 -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=I1CdbpaG; 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 S230169AbjHDNDB (ORCPT + 99 others); Fri, 4 Aug 2023 09:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbjHDNCw (ORCPT ); Fri, 4 Aug 2023 09:02:52 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2068.outbound.protection.outlook.com [40.107.247.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FEC46B3; Fri, 4 Aug 2023 06:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SIJBGjJ6fvrZlrxYk+rx8//0rJSQRQu0blypwbcBaA4Q5H72iGar6aacPYAf6IkhZz3AjvS4vU2laTKj+NUkva/MpD5RrV6p0zxzXCUBSh/aS4QCcoNRJHVbDaZ/2Fu4fw2/YeQjAFoq1rv5Xjfjf0Dp+CBsXS/2rED7UJdmnbAi8k1D3mihFyGqYpq2bwAZr99WZ6gP3EgZkhhZzHu9YPW8CsXQgjIvlw8fSjKbZ4geH7ZgTLkPMSPLRgpFY4FMP3rEwLF2KpGl+2a9lbWO5/DSCu8NGbPoQQyVp1Ix8cRS6lT0XFddIDx9UTsU6jM8fKUfBdkd7DEd85i34AVgfw== 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=ac5f6Oxahs92G9BhJ5ffEeT3JoNdmuQaXl2k1ppr2BE=; b=oMgiqd+jtxkGA6b5pmatc/xN0DLGA8ZXUTH6HgJsM6T0V48+iBH4Q4q+1zP6O9cdhmcYfZtG8kRvYn7PCeBwAq7RqHPPslZHcnbLuItW/kXWPMyGFMCmD+1Tys0KqQuIcAnYkN1ia9rvjrEzy3Z/jeTGm5KqDO3X70mpxlsvUiFg3n+HsyySNB1C82s+xUa4ROjo7EgpzPkCbHj7sPQ3QVq4eErvNLBAm1Mr7XtSUVPVvR9XYZJ6B2YuEcn591WOhPrQIWVXOC+gSNRICmgKedXIlVDl0iNxjnkpf1AqY9kX5OggG64JBGiB8O9w1KYIIyusEpODQ5ZJhKfzi0NgDw== 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=ac5f6Oxahs92G9BhJ5ffEeT3JoNdmuQaXl2k1ppr2BE=; b=I1CdbpaGDTObP8QAZYz311fqZvgNT87qQmg7hFXHqRmcO5wDrhT8x06LZ4oavMNjDCUvpGaDnF3oNR+cIj9/yPsbA+bKLn3WPcX/gvj2/96yWiQLUly6B5DaQrbeImuR7V/iFSR3YGt27GqrskrCBZzjUadXCZq1Md/Qpbkj+98= 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 AM0PR08MB5348.eurprd08.prod.outlook.com (2603:10a6:208:189::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 13:02:43 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::9d1a:4539:a8f8:dd60]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::9d1a:4539:a8f8:dd60%7]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 13:02:43 +0000 From: Michael Riesch Date: Fri, 04 Aug 2023 15:02:34 +0200 Subject: [PATCH v2 3/4] drm/panel: sitronix-st7789v: add support for partial mode Message-Id: <20230718-feature-lcd-panel-v2-3-2485ca07b49d@wolfvision.net> References: <20230718-feature-lcd-panel-v2-0-2485ca07b49d@wolfvision.net> In-Reply-To: <20230718-feature-lcd-panel-v2-0-2485ca07b49d@wolfvision.net> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Maxime Ripard , Miquel Raynal , Sebastian Reichel , Gerald Loacker Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Riesch X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1691154158; l=3358; i=michael.riesch@wolfvision.net; s=20230425; h=from:subject:message-id; bh=ERJqwsd6TIo7l2Xda5AeUy5M5qXLm/Xs9Pw5gkTdYyM=; b=BMpuow4bAQ075j/GfP1eaSmmbD/fciXGPyZ2qc5mqLHkxj2BJ6IffNKcp7OnJU0q9t6FaGqMP jdiCQDVWOaiD2+veOQq49+EbY4jJtkjUsRDZbFt/FhgSNRFsJsdsZ91 X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=1QQdXA2QbwdxaQn/VQK0hz04C8IBYhDowbK0hlNU4Ng= X-ClientProxiedBy: VI1P189CA0023.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::36) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AM0PR08MB5348:EE_ X-MS-Office365-Filtering-Correlation-Id: ffea3589-37f0-4ade-7056-08db94eb170f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MMfnHwBZIMh/X1/zt6e0J314nRIFz5FMgXiGQU/LV92RjVeTNy8lJCOzt2Cj3PRjdeUKajF4hShR8ExJ72M6oT7z1Eyl1FBEObr4EH0IF8rALZ2heCKWtlbW3FAUW244Hd6DYqyVgkU4qeyboZd+Ag9eLj8BBKENDq5Vbu9PCJEMVCbb0YFo9DR/YE2Mj+lFKVmsJ9pPnWuDRAwLAxu3DxmI+LJ95uzzQmtgDAYhNfJ6VDXeetriCHVK/tIQjSaM9vs3xr/5zjtrE4A6ukedDjusvTINmaErRF1VARe3T+zfdU2fNXFLCu6khCWDpgF5zaq5CowB2HW9tXr7NuAutrAxDg8MNKFlowwZc8UmMeKc7Q9iB4C4R+KrtrZVESySyPsvcsWyYA00xwwValR1qB/PFiARwsAkls1mB/KrhNE2O349gyeQGwOqNl7fA+2uz4VT40vz25AR69OZ3t9+CwQnZ+5mdS+CIc0QKAApSBljFfcQK7BcTFGAFaKMxcW9udZaU3JO4rgo+mkvS0gvJfH8PCs/MvxEi3ijfPxTL/1fxKJXtvqC+VC+SuytEiuZ79cGh18DBGOFD24Eb0kW8OC2uwriCIgwLXM2ccdWO0ViPPyHrXItVVvbgOEgtNhhlrCLOmh8La2sHrIXjKonCQ== 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)(136003)(366004)(376002)(346002)(39840400004)(451199021)(186006)(1800799003)(6486002)(52116002)(6666004)(6512007)(86362001)(26005)(6506007)(107886003)(36756003)(2616005)(83380400001)(38100700002)(921005)(38350700002)(66556008)(66476007)(66946007)(4326008)(2906002)(316002)(6636002)(5660300002)(7416002)(44832011)(41300700001)(8936002)(8676002)(478600001)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kTp8CR7VyQiZeKVXUCrXa+1cCFIq?= =?utf-8?q?4jgXOQQZe5/OHN6Cn7NoQuiNg3qIjjixnYTC3KtM4TI3kDVnm/JXBEYLfcVuqS9Mp?= =?utf-8?q?iWWU8JH2isdMcGber6M2XvtjFkHF8NV2AN1bbEPFWuG0diGmHM+Siughgg/DAFr4m?= =?utf-8?q?BrBc6e7LkhLh64IdFOscvYMV5/Lw47ZwXIwmdOGJa0kAF1DG0cxx14eSFUomxKX6k?= =?utf-8?q?97QvkI24xd99mfZal3p9QlKVielC1haTrwt6e6B9YPPFqU7C9ewRQgme21x3a+UDJ?= =?utf-8?q?Lf56FbDU7VG60jD4UL0tXLAidxHP50/oO5xmSKjaKR1FIkDmvWaMQJrYUsW/ybc92?= =?utf-8?q?q4T0DIAqYHQ/F/SrS9uUCoePRemmxxQUniB5UHvuTmksRbthgrtp+LA8tilH2+Ki2?= =?utf-8?q?fbGJzLOor1YEQVJIDswwJfK/M3HbU4QJjxXYagtvNSwxykiKoUhyqJmobJbUycS3o?= =?utf-8?q?s8NoOUZGB5LhzwmezQB/91ZkvmLeRUNugogqDF9IJQoZtHRfp94lBSifaCJQO8XgC?= =?utf-8?q?fyZ0joaS6oiY0lyCjT0TdFjs3G7gMZiDU8F+rdrF4NPY3wHL36BUGII8zMNw7/iwd?= =?utf-8?q?ANw/Nfmxrmw6fJMjbnIBQryMg7j9RBc+cVVzpak6omXMMfMiZUet1oRsIzEHMR3O9?= =?utf-8?q?sWPRjDT0nQDkv1JRr3YBWW6RgKHh4MSTeNyA3waXcce2vc2LkSud4L+NiW3MH+I1P?= =?utf-8?q?6aKXRd/T8xy+l+6I8GEYYMCHTOFqSCE5nObZQ2rQWEVDmaY8gEDacGOnP8jf0txoy?= =?utf-8?q?SkMtALhCQKV1OaFhWdgq1KWg+MPinOWCSbqyiRnbSIWh3NYmHCTi5G+vLt2QcNwBw?= =?utf-8?q?J4PglKd7Kc609HTi+9oI0iZ09DivijWDrTfUJ2uJIo+Z09ToOlQjfN3Pi25rl5XXe?= =?utf-8?q?eWgKwjWJBnEauRC0PilU5TDAV1L1C8Z1Y9wmst9gnXwUGnkktihCzSk86YIuIhoM0?= =?utf-8?q?HPfPYIEa554ffPMSAiTpEqfMPlivrWt4iOkQC6FVbTOU6/Upwqxw74Xrb7jT5FWaP?= =?utf-8?q?FlBif0eH8WcEPwxTxWagPVxSEEaLKpDHbs1ByH249p54guTkJwjXzVWpQMq0oIP9u?= =?utf-8?q?CatFef0RLZswvOuloSi46eQOCiOnWeCO39WEkQDVLVQoTFg2ZGNsSreY6P+ZFJe0O?= =?utf-8?q?yJazGOBHOOlx4+mT0EzqXenG7pgqB9+9SPNA0gYQr3xWE+VjGOR55R+TpXLmgqURY?= =?utf-8?q?/AFscVQGV1DC5zmhtaywF6Wc9lKuFnWIcMHYpb1RYnVD18GlljLz+MLAig+eVxIsx?= =?utf-8?q?Wgm0vxy2EDm9OLr5Yxfwigb5fv0PFS8SWIzG5/nwycMg8FJHYHvEcxVCSa6fHpH+2?= =?utf-8?q?wZvPM6/diyri8Xogzk+NjHzwQAVzNNC8ip+379wQTCTBfA7o49+eCgsu1ihm7+pT/?= =?utf-8?q?i3D2x80PdJEn6X47l+AQ+L3d4jkjOT/qXXV9mqo0ArGROxYNM1A7SW5te6wrz+W9B?= =?utf-8?q?wZt7TDl1K+Zl+Az09n1ER9V8RlMPngZixlVUrgOC2zB6fbf/NKTlTXOeXYLMdEBHK?= =?utf-8?q?CMkZSShK0HxrAat48rb8dCfFwZU7nR3HoA=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: ffea3589-37f0-4ade-7056-08db94eb170f X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 13:02:42.9213 (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: Z0MBVvs/xHNvQ4ib5vCqPsK3y2rbHmqBQBT0JIJOdV9meKvG/j+an2tNQ1XvYe3tOYXJXzZe/Uz1+lp4VgP3bUWdR9kXthfpVisCJcXESnM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5348 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,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771775136833839303 X-GMAIL-MSGID: 1773305766997334951 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 --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 43 ++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 0ded72ed2fcd..ebc9a3bd6db3 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 { @@ -345,9 +348,14 @@ static enum drm_panel_orientation st7789v_get_orientation(struct drm_panel *p) 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; @@ -487,6 +495,37 @@ 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, + }; + + /* Caution: if userspace ever pushes a mode different from the + * expected one (i.e., the one advertised by get_modes), we'll + * add margins. + */ + + 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)); @@ -494,7 +533,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)));