Message ID | 20230718-feature-lcd-panel-v1-0-e9a85d5374fd@wolfvision.net |
---|---|
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 j3csp1859973vqt; Tue, 18 Jul 2023 09:19:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6pugX6situECbKjxTiimTx46cn8lwb+D1XQaDbIVMz8ThPeIwwE03TWmZHt7q/es1VKEd X-Received: by 2002:a17:903:190:b0:1bb:14e7:4fdc with SMTP id z16-20020a170903019000b001bb14e74fdcmr170926plg.61.1689697173585; Tue, 18 Jul 2023 09:19:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689697173; cv=pass; d=google.com; s=arc-20160816; b=PvaEuwiMktkgoKgluOrZTqqB2XN3MY6ZoNcCYpw+V+yQEKN9xCk8SXhSl3Dp/mfoDt PWPZz+3xqYoepnOixBUjnYYVwb2QWQyPAZxuKvkuJ6VwGuhD8AAvX8t3tgXsM1S3QZYZ RVmL7IX0FvO1nqQa0HSgZ03SuhykopCnOOSMTMlq2k/KFcjXFlkWFP1FXAnwUEffrgvl IhyaBqoHtuUFA7ZYzotspjwnSCKCII1teugTnU4t80qnWH3IzUTHGumcMzF9p19SRb7N FytCiHQxOpK9etScMt2s0wQMl4t05f6EoSz1eCXh22mGhmVE5deT1+JS+tej/lQl9j9A pH1A== 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:content-transfer-encoding :message-id:date:subject:from:dkim-signature; bh=oJOoUkNN9dbWXOvToesYddaSvwsyXPBez2x5/uRJ4cc=; fh=Tq5vakelb7Evvy1hSU1bJIwKBl0VAr7pcHQ3+RKee2k=; b=e2J/zHNauorh/+wpsMhERuTjsMlgC2aQY4Dppe1/4Nx4NQqH3+80Egt4bSc8ghoJ6Y z6YeygVbg8pMsiR31JKFoyS54cTi3YgZSxZ0vBc5ItYiRHwYAjGQadPWZUC2PnA49gFQ ZRDtsTo6ylGCeaof1U/Qx4MaKHd2JaKiLMvQaiDMidqqshalKNRjbZ3vnP1GDnU8aqSy XXScE2q2lttqCVO8kOZF3pFeGEAhW3ZKc26KzIh1jKr4SieQiRu4Eci2xikyLdCqBv0Y 7zBo3E6kI7jtSmqZ7lJ+phfIH+SOLJZieG4dg/aZrApFrd1LC/lJHWIu/q5S4hVjoxuQ GVHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=cDRr1N41; 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 li11-20020a170903294b00b001b80de4d3f7si1738809plb.558.2023.07.18.09.19.20; Tue, 18 Jul 2023 09:19:33 -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=cDRr1N41; 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 S233203AbjGRPcA (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Tue, 18 Jul 2023 11:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbjGRPb6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 11:31:58 -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 A1305E7E; Tue, 18 Jul 2023 08:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKe0iTk5RqoRV141Z38D//mHIb0rLZhwB4ge5P8h+/iJuo5QUirR0HQOG5w+Kg7v/qEIYbmXTo+5F1jvRRR4Nbg6pan1P+2few/M0U3QtX5dxRrcll0zX2lN6MNkNstVTb1C+uZR1QvLE0NjJ4HOVNQeZ3zZeoHV7kZpTwwnEJVIBKJfrhZB/U/w6KOnkHmPw/kFhewlxGBcUz5JpXWcIZV2G7Qdv21dXeT75J4HsE//HFdoy+3IhJLSIGvfHpFAAyLJD5bBClvOXwnkreSb19E2GVIJcQ2IiwbuP7kAw0MhwYbYFmRxMayEk0/rXjNa7kTxk/z3kHdRbCCoHsXwhA== 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=oJOoUkNN9dbWXOvToesYddaSvwsyXPBez2x5/uRJ4cc=; b=MCIrgfFvJdr/AlPJ99AkansB5G9h66eK/h69hHrWpFVXqoibGzi7a/aix0Bk0BC1qDHGv9wP4tK9IZLj0axVbXeWpIeSVXnVMe04B2QTcmIUU1ovWZ8163yO0YAdP/vmd+Gw/ejH5M6btHNaAS3G0HZ+/k7V61KY1FapdMJzWCrBrgj8N0lPsfsKbkamQbE1AdYHo39UbBTiOXaFLgxkpKdfsNioKHEFtrI8v1uw1ySOEyogupS+Jh3ggctHW4rRpkae/ycMPPtxVRpj9QaMXIWPXAMb/tUu+fdEGoha/4rwQ9VpQQcpq70YQfPaKNvJtCuX3rFxLvVLUePHpub+KA== 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=oJOoUkNN9dbWXOvToesYddaSvwsyXPBez2x5/uRJ4cc=; b=cDRr1N41KJqNLtG1b5K9x91ouVqJ0KpoxGJa/YZAJflqZQILeBHCFVGcbVNKZ+ULS6tHU4PxgJPyGSNKKKI/pFCCyOrHt3J8GZ/qjhdmkVJait5oi8XUC3SOiCVZeKsxcvAFyYm0LtYqdaIgJJTp40rK2F4SUyVByirkC1dOto0= 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:53 +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:53 +0000 From: Michael Riesch <michael.riesch@wolfvision.net> Subject: [PATCH 0/4] drm/panel: sitronix-st7789v: add support for partial mode Date: Tue, 18 Jul 2023 17:31:49 +0200 Message-Id: <20230718-feature-lcd-panel-v1-0-e9a85d5374fd@wolfvision.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAGawtmQC/x2N0QqDMAwAf0XyvECtMHW/MvYQ23QGSibpHAPx3 xf2eAfHHdDYhBvcugOMP9LkpQ79pYO0kj4ZJTtDDHEIYz9hYXrvxlhTxo2UK8ZrnkucaZyGAN4 t1BgXI02rl7rX6nIzLvL9j+6P8/wB8QvhQ3gAAAA= 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=1147; i=michael.riesch@wolfvision.net; s=20230406; h=from:subject:message-id; bh=z3Es1zds/gkLLCAHQEUq+mtyoGvhWNC9iKuqqOVOt5Y=; b=YW9baPnrPWfS0DlmJEIftqwCWwoCXXcNt9rf6LqdAqOfqfLde6plnaQPzT3QN0czmoQKwPA0b WGTd6HujKKoBhdkc7gFm/wRBEqIyyxhlM1n0FYPkhjAowMmQUq11S2x 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: 7111a4a1-7cc7-4069-9e53-08db87a41cb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rXXTSiq4+HewZmpYv3omtOyJYjXAnGrtT0NrLy64Q58K8ICVDeUegttSgHWgiwUg9hKzG0mW7TdMDzzcReHjcB9IuRaUQZEfPrVZcmXwLdwIE9/97FWeWPf+FfhaDT6c2OYbq9pQkzpemhLO2AfvXjQ3ApW0o1mGLN6FKHKMtN2TL1rKvW9uPkJxMNSngWeZxlnKGtgCw8e5zXkKGaR+sNwIym7PN+nCePkSsRHiZSPKhjuafO8A+n0su1vYLdxmCWFMk7gxcqvJV5bUW4MsXDAvC0BWrglIxo/mnNbZc/rwrpRcNaxpFFDrweSIFsLLrh5Yev/vaJjOvAcFbcD3/m/Qfs9uP71MSpJsgyP59yowrdcGAcCLX5fTqke5RqPLwLgN0qujZwyN53Kele7fE1AIy8ULgClCGpfubHSj9A5qaUYOvv8soJCTz30N5a8BHnT4VDvIuDFxVmxW9QZ6wheBrIn50x6U24UpbJ2pKx8/qfT3pT9QE4SRAqSICX18kdZrcNkBeRTPdW5axbe09KopEWVpq51xvw6dyTpHjf0R/kYKPByy2fsKIiwuNqizA8qPORaISuPe0BkiOnk0Eh7vMa+hiKEfzr/kq9y6XABLRzJgVoLU7AriSTNWpAf0 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)(966005)(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?St+V2Q4OwjpPnHO63wa6/8iW9+Ip?= =?utf-8?q?c+hRSufTuA/QJ3hfjBsxKRhzkFtzmHVPTiQjMfMa2TGzwZMEHRWYArK5WkBnCPM1V?= =?utf-8?q?DPstEJty2jTzCK7Zybi59PmuP0dC5wvLQ0boAR7XJ4TzYKDpDyyJzXrFLT28oiN1C?= =?utf-8?q?7EpSa2+L7b3DRYCcDw+8YaoGuD2q1oUtenE0a5TnF1BlHE7e7+15usHmbxQBGOiaP?= =?utf-8?q?/JYjCXY3kT1mWELYFWUuSF/UCC+ps7n6Huz2NKV74n1JTlv/F3AnPJ0JIjsvSvO7v?= =?utf-8?q?5ggeWYnnSZrBlAIo5lfJRKy+8f5xaF3AXTeZkcyr17wiY7dN2CkYmXthQZaB6QFEb?= =?utf-8?q?2dw2B1kKneLqmA93Bl8YI4y7lGmHdNFJwBWgHen8zJ8d5tJB4MUTg45F31TJNx9Qz?= =?utf-8?q?abTFk/H9PYPr0OWbbUd/D2JsiWoax8CiEDfGQa6fZJIUcKRXkUdFB/6xEILbMYrqu?= =?utf-8?q?icrs+Hsb/2QSnxODBJXayUbGkNmLe8Ee86MZdNv82Jl/b6YvJMlf+X/t2hi4cSryz?= =?utf-8?q?Z8RBZvRoOa5bDmnzIGEzYUsBePCGPVivZRZxfFe32U9IwNLrKIQNjxPUFFf92/+M2?= =?utf-8?q?8rzuQSrAW6J6ayfegN/52mRG+bq6Lq/aEn7rO/Z8qCzVswSfvBpkkVRpxMxsRgFI+?= =?utf-8?q?FIVQ9Dbl5dhRKWt/SLNQkZzSaWwIQHbapCiVsLDK/0FTPWmO5oQSv5bE2iohm8k4K?= =?utf-8?q?ti2V9BFHewS/bBIjZySg3BivMSZjDzfOU1Pkv4Mw/M6rlN2xKjxPlt4pHXkFKQHo0?= =?utf-8?q?bEX+/oSU0JJtuEhn8Z4GxDSe3NFLtxMpxmWvelNu8Ve3tTTJX/nuOK8JyX96Rl3lP?= =?utf-8?q?YxzzKzC1LlwLFvfVkLiYJwrN/HRxUXy5OSD4lz0d08s1xOBsxLbaDfSTXpLZJ1JiZ?= =?utf-8?q?F2D9vs18rRq5bBvs2IXqWfEsK/bxlwaUIM+3XMxgSHl9eAGxGKdlk6Z1m13PJKbga?= =?utf-8?q?aysdWBoaj7UMfPCdIqhRHhkC5AqsUrMgiiUMSJyPhvMTJFWZ3oXwRoGbZehRlEt+/?= =?utf-8?q?5bfv2+ak8yqFqY5LK61+C8mPbmQYdjXjVDygx2WfFxiAV4IJs/MsOB3rmSBytuAqO?= =?utf-8?q?EneHY521LfDX7BcLKBzq5a2Dim0LMHf7bi1xsghqvSIBg6S7HMD6ypsh0Td1SRTm6?= =?utf-8?q?gObEwiILDggqfEgnPEUQjIBJodrbLoPG6YN8gdzHR7Rih/kJ959GhJfWNRcZRlJjM?= =?utf-8?q?yFYgos17Ftb6a/bBLbas4pdW43+qJ2oOQX+GB9f/J1b/yEcuo7v+dPYZj3FKbInBr?= =?utf-8?q?JEfEgt3dvP2K15VGmDtCkjZaG96KP0D7qitu0EKfDWdcUqxyK9evWG2zVEwCK/Fyi?= =?utf-8?q?LOwVB2qvHmWKk+Vyxe9NYBWItXmLTz0xj77O0qAmqrWtrKNo+6cfSvtH4OWIXeupp?= =?utf-8?q?wMfcLZvuLHE3pf8FO2SLk/NO5GALera+B+xkInsCqRMp2xkqSI0q3f29muyvGUfO4?= =?utf-8?q?ObUxkz1XPY5XBABpXVppKRbpM5ojBm/gn8kjcP9hvxaprUMyFTZC61qI8iIxgyZRQ?= =?utf-8?q?C+Ld/X9UJAsNruRKdg7hEVM43O+4R8qbmA=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 7111a4a1-7cc7-4069-9e53-08db87a41cb9 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:53.0113 (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: M5BMNPixd9UzQcD3piujmNNZLIjN2562ifh5Z56Wr0zVEUatH3hS52q+7URqUI+8Ksh4A065g+46ozVdrQ5QbdgFEibiD2MrYTRrHvcDdMk= 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: 1771775903686279911 |
Series |
drm/panel: sitronix-st7789v: add support for partial mode
|
|
Message
Michael Riesch
July 18, 2023, 3:31 p.m. UTC
Hi all, This series adds support for the partial display mode to the Sitronix ST7789V panel driver. This is useful for panels that are partially occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support for this particular panel is added as well. Note: This series is already based on https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ Looking forward to your comments! --- Michael Riesch (4): dt-bindings: vendor-prefixes: add jasonic dt-bindings: display: st7789v: add jasonic jt240mhqs-hwt-ek-e3 display drm/panel: sitronix-st7789v: add support for partial mode drm/panel: sitronix-st7789v: add jasonic jt240mhqs-hwt-ek-e3 support .../bindings/display/panel/sitronix,st7789v.yaml | 1 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 67 +++++++++++++++++++++- 3 files changed, 68 insertions(+), 2 deletions(-) --- base-commit: b43dae411767f34288aa347f26b5ed2dade39469 change-id: 20230718-feature-lcd-panel-26d9f29a7830 Best regards,
Comments
On Tue, Jul 18, 2023 at 05:31:49PM +0200, Michael Riesch wrote: > Hi all, > > This series adds support for the partial display mode to the Sitronix > ST7789V panel driver. This is useful for panels that are partially > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > for this particular panel is added as well. > > Note: This series is already based on > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > Looking forward to your comments! Summary of my take from a fairly long (and kinda still on-going) irc discussion: - Where we do know the exact overscan, the kernel should expose correct modes and adjust the display pipeline to match if needed when programming the hardware. Meaning the approach in this patch series. - For hdmi overscan there's a lot of automagic overscan happening by default. Drivers can mostly fix this by setting all the right infoframes, but unfortuantely a very big pile of infoframes is needed. Assuming drivers actually use the helpers I think only i915 gets them all, so intel_hdmi_compute_config() at the bottom would be the example to follow, and maybe some more code to extract from and share. - That /should/ only leave the really old analog TV and similar horrors leftover. For those we simply can't even guess the right amount of overscan (because back then no one cared back then about really seeing everything), and so that's the only case where we should rely on the overscan properties. And that case only works when the compositor stack passes these properties all the way to the user, since only they can check when the settings are good. The overscan properties should _not_ be used to fix issues of the previous kind, that really should all work out of the box as much as possible. Cheers, Sima > > --- > Michael Riesch (4): > dt-bindings: vendor-prefixes: add jasonic > dt-bindings: display: st7789v: add jasonic jt240mhqs-hwt-ek-e3 display > drm/panel: sitronix-st7789v: add support for partial mode > drm/panel: sitronix-st7789v: add jasonic jt240mhqs-hwt-ek-e3 support > > .../bindings/display/panel/sitronix,st7789v.yaml | 1 + > .../devicetree/bindings/vendor-prefixes.yaml | 2 + > drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 67 +++++++++++++++++++++- > 3 files changed, 68 insertions(+), 2 deletions(-) > --- > base-commit: b43dae411767f34288aa347f26b5ed2dade39469 > change-id: 20230718-feature-lcd-panel-26d9f29a7830 > > Best regards, > -- > Michael Riesch <michael.riesch@wolfvision.net> >
Hi, On 18/07/2023 17:31, Michael Riesch wrote: > Hi all, > > This series adds support for the partial display mode to the Sitronix > ST7789V panel driver. This is useful for panels that are partially > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > for this particular panel is added as well. > > Note: This series is already based on > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ I understand Maxime's arguments, but by looking closely at the code, this doesn't look like an hack at all and uses capabilities of the panel controller to expose a smaller area without depending on any changes or hacks on the display controller side which is coherent. Following's Daniel's summary we cannot compare it to TV overscan because overscan is only on *some* displays, we can still get 100% of the picture from the signal. While here, we cannot, there's physically less pixels on the panel. If there's no more still a strong nack or pending comments, I plan to apply those tomorrow. Thanks, Neil > > Looking forward to your comments! > > --- > Michael Riesch (4): > dt-bindings: vendor-prefixes: add jasonic > dt-bindings: display: st7789v: add jasonic jt240mhqs-hwt-ek-e3 display > drm/panel: sitronix-st7789v: add support for partial mode > drm/panel: sitronix-st7789v: add jasonic jt240mhqs-hwt-ek-e3 support > > .../bindings/display/panel/sitronix,st7789v.yaml | 1 + > .../devicetree/bindings/vendor-prefixes.yaml | 2 + > drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 67 +++++++++++++++++++++- > 3 files changed, 68 insertions(+), 2 deletions(-) > --- > base-commit: b43dae411767f34288aa347f26b5ed2dade39469 > change-id: 20230718-feature-lcd-panel-26d9f29a7830 > > Best regards,
On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > Hi, > > On 18/07/2023 17:31, Michael Riesch wrote: > > Hi all, > > > > This series adds support for the partial display mode to the Sitronix > > ST7789V panel driver. This is useful for panels that are partially > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > for this particular panel is added as well. > > > > Note: This series is already based on > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > I understand Maxime's arguments, but by looking closely at the code, > this doesn't look like an hack at all and uses capabilities of the > panel controller to expose a smaller area without depending on any > changes or hacks on the display controller side which is coherent. > > Following's Daniel's summary we cannot compare it to TV overscan > because overscan is only on *some* displays, we can still get 100% > of the picture from the signal. Still disagree on the fact that it only affects some display. But it's not really relevant for that series. I think I'll still like to have something clarified before we merge it: if userspace forces a mode, does it contain the margins or not? I don't have an opinion there, I just think it should be documented. Maxime
On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > Hi, > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > Hi all, > > > > > > This series adds support for the partial display mode to the Sitronix > > > ST7789V panel driver. This is useful for panels that are partially > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > for this particular panel is added as well. > > > > > > Note: This series is already based on > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > I understand Maxime's arguments, but by looking closely at the code, > > this doesn't look like an hack at all and uses capabilities of the > > panel controller to expose a smaller area without depending on any > > changes or hacks on the display controller side which is coherent. > > > > Following's Daniel's summary we cannot compare it to TV overscan > > because overscan is only on *some* displays, we can still get 100% > > of the picture from the signal. > > Still disagree on the fact that it only affects some display. But it's > not really relevant for that series. See my 2nd point, from a quick grep aside from i915 hdmi support, no one else sets all the required hdmi infoframes correctly. Which means on a compliant hdmi tv, you _should_ get overscan. That's how that stuff is speced. Iirc you need to at least set both the VIC and the content type, maybe even more stuff. Unless all that stuff is set I'd say it's a kms driver bug if you get overscan on a hdmi TV. > I think I'll still like to have something clarified before we merge it: > if userspace forces a mode, does it contain the margins or not? I don't > have an opinion there, I just think it should be documented. The mode comes with the margins, so if userspace does something really funny then either it gets garbage (as in, part of it's crtc area isn't visible, or maybe black bars on the screen), or the driver rejects it (which I think is the case for panels, they only take their mode and nothing else). Cheers, Sima
On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: > On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > > Hi, > > > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > > Hi all, > > > > > > > > This series adds support for the partial display mode to the Sitronix > > > > ST7789V panel driver. This is useful for panels that are partially > > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > > for this particular panel is added as well. > > > > > > > > Note: This series is already based on > > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > > > I understand Maxime's arguments, but by looking closely at the code, > > > this doesn't look like an hack at all and uses capabilities of the > > > panel controller to expose a smaller area without depending on any > > > changes or hacks on the display controller side which is coherent. > > > > > > Following's Daniel's summary we cannot compare it to TV overscan > > > because overscan is only on *some* displays, we can still get 100% > > > of the picture from the signal. > > > > Still disagree on the fact that it only affects some display. But it's > > not really relevant for that series. > > See my 2nd point, from a quick grep aside from i915 hdmi support, no one > else sets all the required hdmi infoframes correctly. Which means on a > compliant hdmi tv, you _should_ get overscan. That's how that stuff is > speced. > > Iirc you need to at least set both the VIC and the content type, maybe > even more stuff. > > Unless all that stuff is set I'd say it's a kms driver bug if you get > overscan on a hdmi TV. I have no doubt that i915 works there. The source of my disagreement is that if all drivers but one don't do that, then userspace will have to care. You kind of said it yourself, i915 is kind of the exception there. The exception can be (and I'm sure it is) right, but still, it deviates from the norm. > > I think I'll still like to have something clarified before we merge it: > > if userspace forces a mode, does it contain the margins or not? I don't > > have an opinion there, I just think it should be documented. > > The mode comes with the margins, so if userspace does something really > funny then either it gets garbage (as in, part of it's crtc area isn't > visible, or maybe black bars on the screen), or the driver rejects it > (which I think is the case for panels, they only take their mode and > nothing else). Panels can usually be quite flexible when it comes to the timings they accept, and we could actually use that to our advantage, but even if we assume that they have a single mode, I don't think we have anything that enforces that, either at the framework or documentation levels? Maxime
On 03/08/2023 11:22, Maxime Ripard wrote: > On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: >> On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: >>> On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: >>>> Hi, >>>> >>>> On 18/07/2023 17:31, Michael Riesch wrote: >>>>> Hi all, >>>>> >>>>> This series adds support for the partial display mode to the Sitronix >>>>> ST7789V panel driver. This is useful for panels that are partially >>>>> occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support >>>>> for this particular panel is added as well. >>>>> >>>>> Note: This series is already based on >>>>> https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ >>>> >>>> I understand Maxime's arguments, but by looking closely at the code, >>>> this doesn't look like an hack at all and uses capabilities of the >>>> panel controller to expose a smaller area without depending on any >>>> changes or hacks on the display controller side which is coherent. >>>> >>>> Following's Daniel's summary we cannot compare it to TV overscan >>>> because overscan is only on *some* displays, we can still get 100% >>>> of the picture from the signal. >>> >>> Still disagree on the fact that it only affects some display. But it's >>> not really relevant for that series. >> >> See my 2nd point, from a quick grep aside from i915 hdmi support, no one >> else sets all the required hdmi infoframes correctly. Which means on a >> compliant hdmi tv, you _should_ get overscan. That's how that stuff is >> speced. >> >> Iirc you need to at least set both the VIC and the content type, maybe >> even more stuff. >> >> Unless all that stuff is set I'd say it's a kms driver bug if you get >> overscan on a hdmi TV. > > I have no doubt that i915 works there. The source of my disagreement is > that if all drivers but one don't do that, then userspace will have to > care. You kind of said it yourself, i915 is kind of the exception there. > > The exception can be (and I'm sure it is) right, but still, it deviates > from the norm. HDMI spec is hidden behind a paywall, HDMI testing is a mess, HDMI real implementation on TVs and Displays is mostly broken, and HDMI certification devices are too expensive... this is mainly why only i915 handles it correctly. > >>> I think I'll still like to have something clarified before we merge it: >>> if userspace forces a mode, does it contain the margins or not? I don't >>> have an opinion there, I just think it should be documented. >> >> The mode comes with the margins, so if userspace does something really >> funny then either it gets garbage (as in, part of it's crtc area isn't >> visible, or maybe black bars on the screen), or the driver rejects it >> (which I think is the case for panels, they only take their mode and >> nothing else). > > Panels can usually be quite flexible when it comes to the timings they > accept, and we could actually use that to our advantage, but even if we > assume that they have a single mode, I don't think we have anything that > enforces that, either at the framework or documentation levels? Yep, this is why we would need a better atomic based panel API that would permit us handling dynamic timings for panel and get out of the single-mode for modern panels. Neil > > Maxime
On Thu, Aug 03, 2023 at 11:30:52AM +0200, Neil Armstrong wrote: > On 03/08/2023 11:22, Maxime Ripard wrote: > > On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: > > > On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > > > > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > > > > Hi, > > > > > > > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > > > > Hi all, > > > > > > > > > > > > This series adds support for the partial display mode to the Sitronix > > > > > > ST7789V panel driver. This is useful for panels that are partially > > > > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > > > > for this particular panel is added as well. > > > > > > > > > > > > Note: This series is already based on > > > > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > > > > > > > I understand Maxime's arguments, but by looking closely at the code, > > > > > this doesn't look like an hack at all and uses capabilities of the > > > > > panel controller to expose a smaller area without depending on any > > > > > changes or hacks on the display controller side which is coherent. > > > > > > > > > > Following's Daniel's summary we cannot compare it to TV overscan > > > > > because overscan is only on *some* displays, we can still get 100% > > > > > of the picture from the signal. > > > > > > > > Still disagree on the fact that it only affects some display. But it's > > > > not really relevant for that series. > > > > > > See my 2nd point, from a quick grep aside from i915 hdmi support, no one > > > else sets all the required hdmi infoframes correctly. Which means on a > > > compliant hdmi tv, you _should_ get overscan. That's how that stuff is > > > speced. > > > > > > Iirc you need to at least set both the VIC and the content type, maybe > > > even more stuff. > > > > > > Unless all that stuff is set I'd say it's a kms driver bug if you get > > > overscan on a hdmi TV. > > > > I have no doubt that i915 works there. The source of my disagreement is > > that if all drivers but one don't do that, then userspace will have to > > care. You kind of said it yourself, i915 is kind of the exception there. > > > > The exception can be (and I'm sure it is) right, but still, it deviates > > from the norm. > > HDMI spec is hidden behind a paywall, HDMI testing is a mess, HDMI real > implementation on TVs and Displays is mostly broken, and HDMI certification > devices are too expensive... this is mainly why only i915 handles it correctly. Sure, I know all that, it's why I was disagreeing with the fact that it's mostly old news and we shouldn't care anymore. And it could largely be fixed if i915 was using more helpers in general. But that's a separate discussion entirely. The point I was trying to make is that it's still very much the current situation for the vast majority of drivers, for whatever reason, so we can't really treat as if it isn't anymore. > > > > I think I'll still like to have something clarified before we merge it: > > > > if userspace forces a mode, does it contain the margins or not? I don't > > > > have an opinion there, I just think it should be documented. > > > > > > The mode comes with the margins, so if userspace does something really > > > funny then either it gets garbage (as in, part of it's crtc area isn't > > > visible, or maybe black bars on the screen), or the driver rejects it > > > (which I think is the case for panels, they only take their mode and > > > nothing else). > > > > Panels can usually be quite flexible when it comes to the timings they > > accept, and we could actually use that to our advantage, but even if we > > assume that they have a single mode, I don't think we have anything that > > enforces that, either at the framework or documentation levels? > > Yep, this is why we would need a better atomic based panel API that would > permit us handling dynamic timings for panel and get out of the single-mode > for modern panels. Again, I definitely agree on the new API, but that seems a bit out of scope :) My point was that we can't expect modes to be the one we provided in .get_modes. And that's for all the drivers, even i915 doesn't do it (as far as I could see) Maxime
On Thu, 3 Aug 2023 at 11:22, Maxime Ripard <mripard@kernel.org> wrote: > > On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: > > On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > > > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > > > Hi, > > > > > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > > > Hi all, > > > > > > > > > > This series adds support for the partial display mode to the Sitronix > > > > > ST7789V panel driver. This is useful for panels that are partially > > > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > > > for this particular panel is added as well. > > > > > > > > > > Note: This series is already based on > > > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > > > > > I understand Maxime's arguments, but by looking closely at the code, > > > > this doesn't look like an hack at all and uses capabilities of the > > > > panel controller to expose a smaller area without depending on any > > > > changes or hacks on the display controller side which is coherent. > > > > > > > > Following's Daniel's summary we cannot compare it to TV overscan > > > > because overscan is only on *some* displays, we can still get 100% > > > > of the picture from the signal. > > > > > > Still disagree on the fact that it only affects some display. But it's > > > not really relevant for that series. > > > > See my 2nd point, from a quick grep aside from i915 hdmi support, no one > > else sets all the required hdmi infoframes correctly. Which means on a > > compliant hdmi tv, you _should_ get overscan. That's how that stuff is > > speced. > > > > Iirc you need to at least set both the VIC and the content type, maybe > > even more stuff. > > > > Unless all that stuff is set I'd say it's a kms driver bug if you get > > overscan on a hdmi TV. > > I have no doubt that i915 works there. The source of my disagreement is > that if all drivers but one don't do that, then userspace will have to > care. You kind of said it yourself, i915 is kind of the exception there. > > The exception can be (and I'm sure it is) right, but still, it deviates > from the norm. The right fix for these is sending the right infoframes, _not_ trying to fiddle with overscan margins. Only the kernel can make sure the right infoframes are sent out. If you try to paper over this in userspace, you'll make the situation worse, not better (because fiddling with overscan means you get scaling, and so rescaling artifacts, and for hard contrasts along pixel lines that'll look like crap). So yeah this is a case of "most upstream hdmi drivers are broken". Please don't try to fix kernel bugs in userspace. > > > I think I'll still like to have something clarified before we merge it: > > > if userspace forces a mode, does it contain the margins or not? I don't > > > have an opinion there, I just think it should be documented. > > > > The mode comes with the margins, so if userspace does something really > > funny then either it gets garbage (as in, part of it's crtc area isn't > > visible, or maybe black bars on the screen), or the driver rejects it > > (which I think is the case for panels, they only take their mode and > > nothing else). > > Panels can usually be quite flexible when it comes to the timings they > accept, and we could actually use that to our advantage, but even if we > assume that they have a single mode, I don't think we have anything that > enforces that, either at the framework or documentation levels? Maybe more bugs? We've been slowly filling out all kinds of atomic kms validation bugs in core/helper code because as a rule of thumb, drivers get it wrong. Developers test until things work, then call it good enough, and very few driver teams make a serious effort in trying to really validate all invalid input. Because doing that is an enormous amount of work. I think for clear-cut cases like drm_panel the fix is to just put more stricter validation into shared code (and then if we break something, figure out how we can be sufficiently lenient again). -Sima
On Thu, Aug 03, 2023 at 12:26:03PM +0200, Daniel Vetter wrote: > On Thu, 3 Aug 2023 at 11:22, Maxime Ripard <mripard@kernel.org> wrote: > > > > On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: > > > On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > > > > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > > > > Hi, > > > > > > > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > > > > Hi all, > > > > > > > > > > > > This series adds support for the partial display mode to the Sitronix > > > > > > ST7789V panel driver. This is useful for panels that are partially > > > > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > > > > for this particular panel is added as well. > > > > > > > > > > > > Note: This series is already based on > > > > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > > > > > > > I understand Maxime's arguments, but by looking closely at the code, > > > > > this doesn't look like an hack at all and uses capabilities of the > > > > > panel controller to expose a smaller area without depending on any > > > > > changes or hacks on the display controller side which is coherent. > > > > > > > > > > Following's Daniel's summary we cannot compare it to TV overscan > > > > > because overscan is only on *some* displays, we can still get 100% > > > > > of the picture from the signal. > > > > > > > > Still disagree on the fact that it only affects some display. But it's > > > > not really relevant for that series. > > > > > > See my 2nd point, from a quick grep aside from i915 hdmi support, no one > > > else sets all the required hdmi infoframes correctly. Which means on a > > > compliant hdmi tv, you _should_ get overscan. That's how that stuff is > > > speced. > > > > > > Iirc you need to at least set both the VIC and the content type, maybe > > > even more stuff. > > > > > > Unless all that stuff is set I'd say it's a kms driver bug if you get > > > overscan on a hdmi TV. > > > > I have no doubt that i915 works there. The source of my disagreement is > > that if all drivers but one don't do that, then userspace will have to > > care. You kind of said it yourself, i915 is kind of the exception there. > > > > The exception can be (and I'm sure it is) right, but still, it deviates > > from the norm. > > The right fix for these is sending the right infoframes, _not_ trying > to fiddle with overscan margins. Only the kernel can make sure the > right infoframes are sent out. If you try to paper over this in > userspace, you'll make the situation worse, not better (because > fiddling with overscan means you get scaling, and so rescaling > artifacts, and for hard contrasts along pixel lines that'll look like > crap). > > So yeah this is a case of "most upstream hdmi drivers are broken". > Please don't try to fix kernel bugs in userspace. ACK. > > > > I think I'll still like to have something clarified before we merge it: > > > > if userspace forces a mode, does it contain the margins or not? I don't > > > > have an opinion there, I just think it should be documented. > > > > > > The mode comes with the margins, so if userspace does something really > > > funny then either it gets garbage (as in, part of it's crtc area isn't > > > visible, or maybe black bars on the screen), or the driver rejects it > > > (which I think is the case for panels, they only take their mode and > > > nothing else). > > > > Panels can usually be quite flexible when it comes to the timings they > > accept, and we could actually use that to our advantage, but even if we > > assume that they have a single mode, I don't think we have anything that > > enforces that, either at the framework or documentation levels? > > Maybe more bugs? We've been slowly filling out all kinds of atomic kms > validation bugs in core/helper code because as a rule of thumb, > drivers get it wrong. Developers test until things work, then call it > good enough, and very few driver teams make a serious effort in trying > to really validate all invalid input. Because doing that is an > enormous amount of work. > > I think for clear-cut cases like drm_panel the fix is to just put more > stricter validation into shared code (and then if we break something, > figure out how we can be sufficiently lenient again). Panels are kind of weird, since they essentially don't exist at all in the framework so it's difficult to make it handle them or their state. It's typically handled by encoders directly, so each and every driver would need to make that check, and from a quick grep, none of them are (for the reasons you said). Just like for HDMI, even though we can commit to changing those facts, it won't happen overnight, so to circle back to that series, I'd like a comment in the driver when the partial mode is enabled that if userspace ever pushes a mode different from the expected one, we'll add the margins. That way, if and when we come back to it, we'll know what the original intent and semantics were. Maxime
On 03/08/2023 13:43, Maxime Ripard wrote: > On Thu, Aug 03, 2023 at 12:26:03PM +0200, Daniel Vetter wrote: >> On Thu, 3 Aug 2023 at 11:22, Maxime Ripard <mripard@kernel.org> wrote: >>> >>> On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: >>>> On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: >>>>> On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: >>>>>> Hi, >>>>>> >>>>>> On 18/07/2023 17:31, Michael Riesch wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> This series adds support for the partial display mode to the Sitronix >>>>>>> ST7789V panel driver. This is useful for panels that are partially >>>>>>> occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support >>>>>>> for this particular panel is added as well. >>>>>>> >>>>>>> Note: This series is already based on >>>>>>> https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ >>>>>> >>>>>> I understand Maxime's arguments, but by looking closely at the code, >>>>>> this doesn't look like an hack at all and uses capabilities of the >>>>>> panel controller to expose a smaller area without depending on any >>>>>> changes or hacks on the display controller side which is coherent. >>>>>> >>>>>> Following's Daniel's summary we cannot compare it to TV overscan >>>>>> because overscan is only on *some* displays, we can still get 100% >>>>>> of the picture from the signal. >>>>> >>>>> Still disagree on the fact that it only affects some display. But it's >>>>> not really relevant for that series. >>>> >>>> See my 2nd point, from a quick grep aside from i915 hdmi support, no one >>>> else sets all the required hdmi infoframes correctly. Which means on a >>>> compliant hdmi tv, you _should_ get overscan. That's how that stuff is >>>> speced. >>>> >>>> Iirc you need to at least set both the VIC and the content type, maybe >>>> even more stuff. >>>> >>>> Unless all that stuff is set I'd say it's a kms driver bug if you get >>>> overscan on a hdmi TV. >>> >>> I have no doubt that i915 works there. The source of my disagreement is >>> that if all drivers but one don't do that, then userspace will have to >>> care. You kind of said it yourself, i915 is kind of the exception there. >>> >>> The exception can be (and I'm sure it is) right, but still, it deviates >>> from the norm. >> >> The right fix for these is sending the right infoframes, _not_ trying >> to fiddle with overscan margins. Only the kernel can make sure the >> right infoframes are sent out. If you try to paper over this in >> userspace, you'll make the situation worse, not better (because >> fiddling with overscan means you get scaling, and so rescaling >> artifacts, and for hard contrasts along pixel lines that'll look like >> crap). >> >> So yeah this is a case of "most upstream hdmi drivers are broken". >> Please don't try to fix kernel bugs in userspace. > > ACK. > >>>>> I think I'll still like to have something clarified before we merge it: >>>>> if userspace forces a mode, does it contain the margins or not? I don't >>>>> have an opinion there, I just think it should be documented. >>>> >>>> The mode comes with the margins, so if userspace does something really >>>> funny then either it gets garbage (as in, part of it's crtc area isn't >>>> visible, or maybe black bars on the screen), or the driver rejects it >>>> (which I think is the case for panels, they only take their mode and >>>> nothing else). >>> >>> Panels can usually be quite flexible when it comes to the timings they >>> accept, and we could actually use that to our advantage, but even if we >>> assume that they have a single mode, I don't think we have anything that >>> enforces that, either at the framework or documentation levels? >> >> Maybe more bugs? We've been slowly filling out all kinds of atomic kms >> validation bugs in core/helper code because as a rule of thumb, >> drivers get it wrong. Developers test until things work, then call it >> good enough, and very few driver teams make a serious effort in trying >> to really validate all invalid input. Because doing that is an >> enormous amount of work. >> >> I think for clear-cut cases like drm_panel the fix is to just put more >> stricter validation into shared code (and then if we break something, >> figure out how we can be sufficiently lenient again). > > Panels are kind of weird, since they essentially don't exist at all in > the framework so it's difficult to make it handle them or their state. > > It's typically handled by encoders directly, so each and every driver > would need to make that check, and from a quick grep, none of them are > (for the reasons you said). > > Just like for HDMI, even though we can commit to changing those facts, > it won't happen overnight, so to circle back to that series, I'd like a > comment in the driver when the partial mode is enabled that if userspace > ever pushes a mode different from the expected one, we'll add the margins. To be fair, a majority of the panel drivers would do the wrong init of the controller with a different mode because: - mainly the controller model is unknown - when it's known the datasheet is missing - when the datasheet is here, most of the registers are missing - and most of the time the timings are buried in the init sequence It's sad but it's the real situation. Only a few drivers can handle a different mode, and we should perhaps add a flag when not set rejecting a different mode for those controllers and mark the few ones who can handle that... And this should be a first step before adding an atomic Panel API. Neil > > That way, if and when we come back to it, we'll know what the original > intent and semantics were. > > Maxime
On Thu, Aug 03, 2023 at 02:34:58PM +0200, Neil Armstrong wrote: > > > > > > I think I'll still like to have something clarified before we merge it: > > > > > > if userspace forces a mode, does it contain the margins or not? I don't > > > > > > have an opinion there, I just think it should be documented. > > > > > > > > > > The mode comes with the margins, so if userspace does something really > > > > > funny then either it gets garbage (as in, part of it's crtc area isn't > > > > > visible, or maybe black bars on the screen), or the driver rejects it > > > > > (which I think is the case for panels, they only take their mode and > > > > > nothing else). > > > > > > > > Panels can usually be quite flexible when it comes to the timings they > > > > accept, and we could actually use that to our advantage, but even if we > > > > assume that they have a single mode, I don't think we have anything that > > > > enforces that, either at the framework or documentation levels? > > > > > > Maybe more bugs? We've been slowly filling out all kinds of atomic kms > > > validation bugs in core/helper code because as a rule of thumb, > > > drivers get it wrong. Developers test until things work, then call it > > > good enough, and very few driver teams make a serious effort in trying > > > to really validate all invalid input. Because doing that is an > > > enormous amount of work. > > > > > > I think for clear-cut cases like drm_panel the fix is to just put more > > > stricter validation into shared code (and then if we break something, > > > figure out how we can be sufficiently lenient again). > > > > Panels are kind of weird, since they essentially don't exist at all in > > the framework so it's difficult to make it handle them or their state. > > > > It's typically handled by encoders directly, so each and every driver > > would need to make that check, and from a quick grep, none of them are > > (for the reasons you said). > > > > Just like for HDMI, even though we can commit to changing those facts, > > it won't happen overnight, so to circle back to that series, I'd like a > > comment in the driver when the partial mode is enabled that if userspace > > ever pushes a mode different from the expected one, we'll add the margins. > > To be fair, a majority of the panel drivers would do the wrong > init of the controller with a different mode because: > - mainly the controller model is unknown > - when it's known the datasheet is missing > - when the datasheet is here, most of the registers are missing > - and most of the time the timings are buried in the init sequence > > It's sad but it's the real situation. Again, I agree. As far as I'm aware, none of them add arbitrary numbers to timings though, so it's easy enough to figure out what the mode is meant to be: it's the mode. Here, we add some numbers to the mode, so the interaction with the userspace forcing a mode is less clear. > Only a few drivers can handle a different mode, and we should perhaps > add a flag when not set rejecting a different mode for those controllers and > mark the few ones who can handle that... > And this should be a first step before adding an atomic Panel API. I'm really just asking for a comment in the code here. Everything that you mentioned are improvements that we should have on our todo list, but I don't see them as pre-requisite for this series and we get to it later on. Maxime
On Thu, Aug 03, 2023 at 01:43:08PM +0200, Maxime Ripard wrote: > On Thu, Aug 03, 2023 at 12:26:03PM +0200, Daniel Vetter wrote: > > On Thu, 3 Aug 2023 at 11:22, Maxime Ripard <mripard@kernel.org> wrote: > > > > > > On Thu, Aug 03, 2023 at 10:51:57AM +0200, Daniel Vetter wrote: > > > > On Thu, Aug 03, 2023 at 10:48:57AM +0200, Maxime Ripard wrote: > > > > > On Thu, Aug 03, 2023 at 10:11:22AM +0200, Neil Armstrong wrote: > > > > > > Hi, > > > > > > > > > > > > On 18/07/2023 17:31, Michael Riesch wrote: > > > > > > > Hi all, > > > > > > > > > > > > > > This series adds support for the partial display mode to the Sitronix > > > > > > > ST7789V panel driver. This is useful for panels that are partially > > > > > > > occluded by design, such as the Jasonic JT240MHQS-HWT-EK-E3. Support > > > > > > > for this particular panel is added as well. > > > > > > > > > > > > > > Note: This series is already based on > > > > > > > https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/ > > > > > > > > > > > > I understand Maxime's arguments, but by looking closely at the code, > > > > > > this doesn't look like an hack at all and uses capabilities of the > > > > > > panel controller to expose a smaller area without depending on any > > > > > > changes or hacks on the display controller side which is coherent. > > > > > > > > > > > > Following's Daniel's summary we cannot compare it to TV overscan > > > > > > because overscan is only on *some* displays, we can still get 100% > > > > > > of the picture from the signal. > > > > > > > > > > Still disagree on the fact that it only affects some display. But it's > > > > > not really relevant for that series. > > > > > > > > See my 2nd point, from a quick grep aside from i915 hdmi support, no one > > > > else sets all the required hdmi infoframes correctly. Which means on a > > > > compliant hdmi tv, you _should_ get overscan. That's how that stuff is > > > > speced. > > > > > > > > Iirc you need to at least set both the VIC and the content type, maybe > > > > even more stuff. > > > > > > > > Unless all that stuff is set I'd say it's a kms driver bug if you get > > > > overscan on a hdmi TV. > > > > > > I have no doubt that i915 works there. The source of my disagreement is > > > that if all drivers but one don't do that, then userspace will have to > > > care. You kind of said it yourself, i915 is kind of the exception there. > > > > > > The exception can be (and I'm sure it is) right, but still, it deviates > > > from the norm. > > > > The right fix for these is sending the right infoframes, _not_ trying > > to fiddle with overscan margins. Only the kernel can make sure the > > right infoframes are sent out. If you try to paper over this in > > userspace, you'll make the situation worse, not better (because > > fiddling with overscan means you get scaling, and so rescaling > > artifacts, and for hard contrasts along pixel lines that'll look like > > crap). > > > > So yeah this is a case of "most upstream hdmi drivers are broken". > > Please don't try to fix kernel bugs in userspace. > > ACK. > > > > > > I think I'll still like to have something clarified before we merge it: > > > > > if userspace forces a mode, does it contain the margins or not? I don't > > > > > have an opinion there, I just think it should be documented. > > > > > > > > The mode comes with the margins, so if userspace does something really > > > > funny then either it gets garbage (as in, part of it's crtc area isn't > > > > visible, or maybe black bars on the screen), or the driver rejects it > > > > (which I think is the case for panels, they only take their mode and > > > > nothing else). > > > > > > Panels can usually be quite flexible when it comes to the timings they > > > accept, and we could actually use that to our advantage, but even if we > > > assume that they have a single mode, I don't think we have anything that > > > enforces that, either at the framework or documentation levels? > > > > Maybe more bugs? We've been slowly filling out all kinds of atomic kms > > validation bugs in core/helper code because as a rule of thumb, > > drivers get it wrong. Developers test until things work, then call it > > good enough, and very few driver teams make a serious effort in trying > > to really validate all invalid input. Because doing that is an > > enormous amount of work. > > > > I think for clear-cut cases like drm_panel the fix is to just put more > > stricter validation into shared code (and then if we break something, > > figure out how we can be sufficiently lenient again). > > Panels are kind of weird, since they essentially don't exist at all in > the framework so it's difficult to make it handle them or their state. > > It's typically handled by encoders directly, so each and every driver > would need to make that check, and from a quick grep, none of them are > (for the reasons you said). I think the panel bridge driver infra is the right spot to put this, and then push drivers a bit more towards using that. Because yeah if they hand-roll the panel integration, they'll probably miss a lot of these details :-/ -Sima > > Just like for HDMI, even though we can commit to changing those facts, > it won't happen overnight, so to circle back to that series, I'd like a > comment in the driver when the partial mode is enabled that if userspace > ever pushes a mode different from the expected one, we'll add the margins. > > That way, if and when we come back to it, we'll know what the original > intent and semantics were. > > Maxime