From patchwork Tue Nov 26 09:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bauer, Markus" X-Patchwork-Id: 13885738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB930D3B7CC for ; Tue, 26 Nov 2024 10:02:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47DE410E80D; Tue, 26 Nov 2024 10:02:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=avnet.eu header.i=@avnet.eu header.b="bvxnsm6t"; dkim-atps=neutral X-Greylist: delayed 901 seconds by postgrey-1.36 at gabe; Tue, 26 Nov 2024 09:57:51 UTC Received: from smtpemea01.avnet.com (smtpemea01.avnet.com [193.34.102.203]) by gabe.freedesktop.org (Postfix) with ESMTPS id A6BA510E03B for ; Tue, 26 Nov 2024 09:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avnet.eu; s=20201007; t=1732614168; bh=mJlu3gbRWRqarJkVTrxW8EcciX7CITvLHHyPB/20dN4=; h=From:To:CC:Subject:Date; b=bvxnsm6tnL/1GEgonMoH7mwtNh5/bwjJ/VoEEgUjszuScKAwUbuSucSVUZPLJEe7x JoTuD1RZAKZn0eyb07QqkPxF19S9Q+nc6cyVgD1AjSql4lkcFfl+HZ2eP9E9bXRrCX gvubucwLo5QWGXj/QjJbPJxlaa5pUlAbhdGFH0+GS/XgVWSUazUNiiEsRiyV4yTy4E CG+Vx8QrOjfhVvFfL4TiIyLOXSgBqiPNFrAJ+QyCiVra7JhJiV4E6JdPZtO0tgLuqN Dmo0JhRgFgh3vuhxPizEPXKVLTC7LRyTua785DIpFo2Ur+7h7H0WbZvrJ0JoRAy+C0 mUufOY/F6Ickw== Received: from DEPOIX0MX19EMP1.emea.avnet.com (Not Verified[172.23.112.140]) by smtpemea01.avnet.com with Trustwave MailMarshal (v10, 2, 5, 6043) (using TLS: TLSv1.2, ECDHE-RSA-AES256-GCM-SHA384) id ; Tue, 26 Nov 2024 10:42:48 +0100 Received: from DEPOIX0MX19EMS2.EMEA.AVNET.COM (172.23.112.143) by DEPOIX0MX19EMP1.emea.avnet.com (172.23.112.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.13; Tue, 26 Nov 2024 10:42:47 +0100 Received: from FR5P281CU006.outbound.protection.outlook.com (172.23.112.39) by DEPOIX0MX19EMS2.EMEA.AVNET.COM (172.23.112.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.13 via Frontend Transport; Tue, 26 Nov 2024 10:42:47 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BIPnM9AxEwjj59/v5+bkmJGfwvFramDPlRv4aY5KahlY3C/rBXUZCaijnPS1d+4BW2vno9Vk07HnkxmVP1Fbs1wZz1Bhu/OdNYBW1Uihp/m/KwzzaipFzEu2RpOuXTHaro18VmUi0jM10d+EsM0QbfPc03jTZotncIoco5NXrJQM20XZORssIwHhaVBkc0LS5pRFK8EZqkW1h0JCRgYroTxu3k40UIgvVQsDjdcv+azK35W3BoTFASiJMDV9jHDpdDsAYVHOvcduIJOzV0d1gHJgzGqz9i1WbeH2zyI5JjTPczJTB2fjP5ewP1/WfH//GgFNOSM5Zd8cS2B9CKOU6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=45KPBk0ob/t7hexxkdoEU+cGkVUyo3bJHq/O1Llxk9c=; b=MeVY1JoNmp0CnG0uK/hm0qKDYI0XLt963Poqn9oBjn70YO5EG2dhQNdjhLXvpcyIEctGUfkuzruvNHLL1zv1jVSNnMC43Opqi79TB7OLy0gUXoOxY+IZgfG2AyBPmK3TsMewVArYZTj1sxMj6pfwUwKCAxO3odcLNUAOLcgxAnJ/gAYDJaVCRJP3xzy2Q3vkpZuTCdT84hxB+yDb2A+b/DZhg8Hprx3Z1A4F2BzPtX9c/KYF9XrpIojbwG7ma5ekyWFQPVQIJvw3E8WVn9xw4jRcJ71IkbO0s2Fp01Ib6HXnhriKlT3FQPMlznqC6HDTDvBgE14/M9EKZD9ImpCoWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=avnet.eu; dmarc=pass action=none header.from=avnet.eu; dkim=pass header.d=avnet.eu; arc=none Received: from BE0P281MB0211.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:11::12) by FR5P281MB4603.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Tue, 26 Nov 2024 09:42:45 +0000 Received: from BE0P281MB0211.DEUP281.PROD.OUTLOOK.COM ([fe80::98bf:b8ad:bcbf:e2d2]) by BE0P281MB0211.DEUP281.PROD.OUTLOOK.COM ([fe80::98bf:b8ad:bcbf:e2d2%5]) with mapi id 15.20.8182.019; Tue, 26 Nov 2024 09:42:45 +0000 From: "Bauer, Markus" To: "jernej.skrabec@gmail.com" , "airlied@gmail.com" , "andrzej.hajda@intel.com" , "neil.armstrong@linaro.org" , "Laurent.pinchart@ideasonboard.com" CC: "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH] sn65dsi83.c: fix dual-channel LVDS output also divide porches Thread-Topic: [PATCH] sn65dsi83.c: fix dual-channel LVDS output also divide porches Thread-Index: AQHbP9YL0igL7kZcgEy1lSyLQJGzXg== Date: Tue, 26 Nov 2024 09:42:45 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=avnet.eu; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BE0P281MB0211:EE_|FR5P281MB4603:EE_ x-ms-office365-filtering-correlation-id: 999406ba-cfa5-4b24-7a25-08dd0dfeae74 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?Cm7C5qWAHG+Xlfpu8/jAE65WGp?= =?iso-8859-1?q?XLEcarFNzw+jwS2pB+xG7pZo511oQpe+jF533B/AKKvSboR453I2QPJ9jcjs?= =?iso-8859-1?q?N98X2aq1MP3P5aa/POkesA88Mf7LmEbI4QcLG1Ue2KemiCdOWzeM/3Cg4ToI?= =?iso-8859-1?q?t0KwrKxx5Ung2C/8st+mW2ZMCD5FTlG4Z4R5mByypuCWYR5XILbZdt/DxxjN?= =?iso-8859-1?q?vldec8akK0vYSIewtghFoD6NrwtMjyFB8Xp6opF/WomG9aL4pm4vF+ceVu5n?= =?iso-8859-1?q?txE3boeCUv50fcGYRrGK5u8HAmW8eWAsg6nygNhj/4AQ7fSVLd606Xx3iMG9?= =?iso-8859-1?q?nsF0Dj70xFviN8GS8pjaAxVbi6uhSw+Is6XB0IzP6nKtdNkv5SHQf0PI28d5?= =?iso-8859-1?q?LcxE+AiWXrBScBGZD3oeEzDxIOQsuuhIPHuiNRS8v1D24/9BXkzGBCag+qyN?= =?iso-8859-1?q?riYPagz2P++DFQ0q43IWwIc7LQ3UlI10mCD0sP1MbV8HBuChKKlUncOiv8QU?= =?iso-8859-1?q?DY/LAlDDFTxl1wc8PaXqNRc0Bs39u0jwtHQ5E9Rosow/qUkKAWQaPrr+EGnl?= =?iso-8859-1?q?OeafjPa+z4cxsRfteE6iNSjTFWKZoDBXIvpbVnjQoRNJDdLAqgz4O5+yGMdS?= =?iso-8859-1?q?OSdAOJOWrIbcvMg376GI5fyXjZY68SaAjGpd0YEi1pgdlgCvruWxqpBBhDrR?= =?iso-8859-1?q?8QqL9kC+NntTwz0SIz/rqlve1kP8juTvxDY8bSW7rf0aNwj7r/0gX4lmE/59?= =?iso-8859-1?q?6mq7M1fbOr8sjfvxA0Tb5xQcn8ldby5Lx104SEg45KQAkfJbKI5F9nZLnVgv?= =?iso-8859-1?q?24gPnziBtIlttkwW7atSZW66qpYGV6wAVv1rs9dc6L0FMtIQKX5JJZA7dH/S?= =?iso-8859-1?q?D/o7iFFwZs4iECOHSCzKUFtLvhcoEjL9p0vB6gydOP229bQdSCRYZHsVJ8n5?= =?iso-8859-1?q?m5u3q4JstIOWY+U1LFysK9zKG1rgAZNHW9hOm1uzSI7D5C3N4pKz0Z4/v1cE?= =?iso-8859-1?q?M12oh1OXOcGk0tg+AJSWK/33pt3SsYac5H4ZAJIKUnpWToA3DPFCg48p57FU?= =?iso-8859-1?q?hoxJoF2q080QvGlhT94j2WJDrCS5RbComkr9aqtcRtagQGBKS9Usx0SGZ12z?= =?iso-8859-1?q?Wd+rKGDYVYMf2sOl4+WQNOj8Wybla789SUD09HVMc5mY/tb7qAuK+YQ9x/kR?= =?iso-8859-1?q?f7vVFd/CDJcec+THHvTmsTEchaetHPCr9c5ehErc1xwd2xFJ/PfZANULCshk?= =?iso-8859-1?q?yUdy4yv5LxsUHz1KQElkyeK9Tn0lIFlXZ07AHRYz+AZMmwO+Da1jWHxG9Gp8?= =?iso-8859-1?q?bCzF02pIZt35g+57yylhAYARe6kchKitSVJ+7J689y9Oyb86pEVCcGz67MpU?= =?iso-8859-1?q?Iodb0zGZAHaO81g46PKp0DLL5vLEDBG34j3c37HtQ=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BE0P281MB0211.DEUP281.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?eb3+eap0EwaRjAXaaGaVI+k?= =?iso-8859-1?q?NEDcLsY2j8fduQab79WWvgxN6yiILYPq01pp8CJqm4l0AbVloaDUFCXXKlaV?= =?iso-8859-1?q?7oOPbI941GOFBEXJytVC0qn1C//igqxK61UDxc4eiWom3osX0QurUX9HdkTt?= =?iso-8859-1?q?yjYbaQ3lEZQb9inm63v1KHfPjtM+rKJ/7XFh4By2P95nReSNLNb4PV0GoU0l?= =?iso-8859-1?q?bIqQkBfwRRyFlqPizfZBViqXmR+q3SfYa8sWGERAFE9pva5gg2HH7gWmi2tc?= =?iso-8859-1?q?1coK+mKudfnkY4jptR8efF+bSFxkP0Gkz8+poedIiDhWi6AA/sEgNKrqUeKv?= =?iso-8859-1?q?MAXY16HpQr9L/gULVcFsnMI5Z8JG0X7Y10ANnvmyJ2RR/D1uQjcLr+d8FQR7?= =?iso-8859-1?q?TozkCpPEgb9TJGq8/dqa9sDQRxFFQSKFCsrnHaMBgI/V5wh4jMD3lSEKyD/z?= =?iso-8859-1?q?do2X+M3mcBZwsx2twKbTJ7ppIVQ2rFfLcBejV2wdKPrevzR9D1yjLCFOhfwa?= =?iso-8859-1?q?lG+fjZF0SxDIbQ5lQD21LkM6n+PWXq2G7WrnxNy40UQYctAxZ4aP/xlTSIDT?= =?iso-8859-1?q?oWf51CaZ579PqV87o2Ozl0bwqVel6m/t8pDuTQ0jLZ1IfupoeFCbWoYk/DI+?= =?iso-8859-1?q?r+mVf33wKveNO6LLn/j2tGapknbdDH2fTIrItsn2sK/7pbVp57562o/fWGIk?= =?iso-8859-1?q?Swlynpjpqt7sMK8uAN7TQCJTZBLIj49d38ybwVTFErirM3e9VoSk47S5o6ax?= =?iso-8859-1?q?IRRq6ttQMNuOncv5Z30+t5X6fl406Mv7OTTJbp6GUcfYKJMaa434dC5wjfJI?= =?iso-8859-1?q?FNXc2SU8zlHt+eBB3ABR40jK4T80mhI5nCKv3r5GZ1f7JVDPYd7m1WS6zXMt?= =?iso-8859-1?q?pPNjpYEaG7RubaGEOlyDHMx+jdTU937aeAbsACaoaRBcoLRigXOSr+GWubuH?= =?iso-8859-1?q?v0UGBG3xkcRu4GlcDk+cbL8bKMhAeZC12Bdn/JsviUeVjd40V3TOGcb2SKOE?= =?iso-8859-1?q?JyCDujfexRHAqf9Znce/3EBldPGnnFJJXa0J1mxAaue881rHbA39EdP8U0mP?= =?iso-8859-1?q?zLmZfxCK9X2fyxapVWTTCiro+MCaKXYYErIfhVy4wXBcwW29FU+rbxnPmWf/?= =?iso-8859-1?q?VKHXZvTDgOwkmj502OTDINe1s9POz8X41YZsSDZ60rqv41qlKm8TBggA8Iyl?= =?iso-8859-1?q?kkDJZiDbnAbd8vtn0+iMq18pBmpd52EXjijs1HEXZDpuL1E8jpRAgtOXipmN?= =?iso-8859-1?q?k+bn9tP/QIX1TzTe6ZLfR6XhCOF/LG7ObDd8Nyp9a9nZjuyK02ipY+eJiLmo?= =?iso-8859-1?q?dA0tYHtN5QIxOYsUtDKNBJrEDZ5ItU3mprKR91jBqkMD0O4hlaP7oaqRuDmo?= =?iso-8859-1?q?7WnfyVM2oU0sPkhM3FQSy5TrpI6Tvq6xu+Hyxhov6MSqgQUn1UmfasQ2k9SH?= =?iso-8859-1?q?VVTeQoAnM6ddJuBgbC5q0TZPn9DaDMLah1Ool+DsyV0Ev90nslTtCd1hMnYF?= =?iso-8859-1?q?DimiipwtHJ8KBwLuinp9QTXXfrR6AY4NKJW2PYdD0bVFuUPwApoNV82/1AC5?= =?iso-8859-1?q?R5k4+ayIktAoC94tSy/c+O9eet5mL6R4MFU3V/tosJJfov7/Mq34wc3U=3D?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kUknx5teqdwxFSWj5kl9dLUxJaYev4MDejQiC69SFM8/d8CFuoNM+oQd3bNIjdGbc0et4P1scgzUda94a9wssBg/72SM6Ee7UZBXCaDuxcaC358lY1dd25FbkmgYVXsTLnRb4DZu+E9hQY2jp1iuelsZsWhprHRKL3iT4SAjkJCqb4/tq1aTKZVtSuuT5UURyndFlEUbYadbMDbZAEUiPd8zmndHjpp1ZN/QWfuOlSSdCV63qFzjdZHEh55buaJsui32uFFy91v/vQmXf3SQvlFVIKQ5nQL+p8pbHA6OrZJJcMchWjfZ+erbI2I8M2N/a74gu4UbUQCmU5tywYtJr3+UjiTYNgbccVkZ0qP7PHO+e89GTJQLkX9KNq+byPsEg5rXaYcwz8FcyZyzfFX43w59mLIu56Qms0LhnULKdqC9t1TB2PGicqtfGw+/SEbDTo5wKq6hvPnIPkGd1uzPsTFti+1yHUoR50895YPEgqCznTa4jA8rtx/YVpJxtPJ+z+UvxhiGboK2QxXmGSWqhSyVV6kykBIMtjg+cVGyeyCE/SXN2zWFuDuYjyE1fFB6Kx0gM/FqrcBqCOXnILwP61ysK5jpVvgqcE2oZcyORTLxXy2RzcThy9z1ySFMIP/6 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BE0P281MB0211.DEUP281.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 999406ba-cfa5-4b24-7a25-08dd0dfeae74 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2024 09:42:45.6008 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8820279b-c0be-4bde-83ed-fe6b6f9724d5 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: g+n4HAftqC096eMJgzGIQLPLmJ46MdJ4Q0Ze6D+H1K+cYsoNFdjUCetRGnEHs2BUB8tMiXj+0h0vd0dPFpbOhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR5P281MB4603 X-OriginatorOrg: avnet.eu X-SEG-SpamProfiler-Analysis: v=2.4 cv=KPoID0Fo c=1 sm=1 tr=0 ts=67459818 a=SsRr5/1Z2tpKHRUDVTcyRg==:117 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=VlfZXiiP6vEA:10 a=cfxL476SPWAA:10 a=VwQbUJbxAAAA:8 a=npiypiU9AAAA:8 a=IDoUORj9AAAA:8 a=cpywmP4KawexDyEaKT0A:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10 a=U5QfeDdlIO9jQLzCQbpp:22 a=3GNAIP-vjoKa_dZcoIoZ:22 X-SEG-SpamProfiler-Score: 0 X-Mailman-Approved-At: Tue, 26 Nov 2024 10:02:25 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" sn65dsi83.c: fix dual-channel LVDS output also divide porches When generating dual-channel LVDS to a single display, the horizontal part has to be divided in halves for each channel. This was done correctly for hactive, but not for the porches. Of course this does only apply to sn65dsi84, which is also covered by this driver. Cc: stable@vger.kernel.org Signed-off-by: Markus Bauer --- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c index ad73f69d768d..d71f752e79ec 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c @@ -399,7 +399,7 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, unsigned int pval; __le16 le16val; u16 val; - int ret; + int ret, hfront, hback; ret = regulator_enable(ctx->vcc); if (ret) { @@ -521,12 +521,22 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, le16val = cpu_to_le16(mode->vsync_end - mode->vsync_start); regmap_bulk_write(ctx->regmap, REG_VID_CHA_VSYNC_PULSE_WIDTH_LOW, &le16val, 2); + + hback = mode->htotal - mode->hsync_end; + if (ctx->lvds_dual_link) + hback /= 2; + regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_BACK_PORCH, - mode->htotal - mode->hsync_end); + hback); regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_BACK_PORCH, mode->vtotal - mode->vsync_end); + + hfront = mode->hsync_start - mode->hdisplay; + if (ctx->lvds_dual_link) + hfront /= 2; + regmap_write(ctx->regmap, REG_VID_CHA_HORIZONTAL_FRONT_PORCH, - mode->hsync_start - mode->hdisplay); + hfront); regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_FRONT_PORCH, mode->vsync_start - mode->vdisplay); regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00);