From patchwork Mon Aug 19 02:40:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13767738 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 3F13FC531DF for ; Mon, 19 Aug 2024 02:40:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B59FF10E194; Mon, 19 Aug 2024 02:40:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="bF9H/TS3"; dkim-atps=neutral Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011037.outbound.protection.outlook.com [52.101.65.37]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C56710E191 for ; Mon, 19 Aug 2024 02:40:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DfttBRbjc+jLk3hZGKlg07E3fDuAAtRGvNHgOUMHtuIycITlQor9cWeqHuqlJM4P3jNi/1W//iofQWTeC6R3XUk/egj7aAQMXYCzMIG9TaaTkua8C0IVOvZ4z7rap9eaJgG6D4Iy2EleYHmFAGrs5bXkLfwm9GKBrWOtFi5HqteIfR2j/GusxuDqK9TbK960fgFjvbRR4vCaGDDBEn3AxNJwWBRZnTBg4wDkdq5PSlgwykusmoo2283mMmKLl4tJZKvVhR61m6G/TMUDeURUm9BaeR6qdKqwsgavkHNPMIcfNhsfA0+PwXjeu36uXII1XGcaD1uOK5V2apgR1AgBEg== 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=BOgHqJJS2it1n2g3LplV9lY7EitEwoWzqQ8I6euYF5I=; b=uaKVr982ziC/WjMeQ8poycZo1J07NK8jDPB7IiPF9DDO9sJpd9TLhWnLaogA87u0CH0DE8+4PeMMnxHgRwgOoDu2zPRedNErO4TRiZFJ3Q7ZmmViO1izC6PXUe1is6l0K42hWFfV/Jep1xkrkaJv9ho14UhpjthHoyvHQuyKT9NbUlCqY8PDN8W9RM5GKxHGyMtkl2hfVg0+T6F7UJx7M5j1UiI7ardbamgoxGKgD/GQ0Af3CJMuAluaveQLkcvFWJl3ETgy3xwuKjg9y3YkRIzoZ20gr2f58qhOX7jUm2RSXjN000cctul2JQenKwwA9gTn5R/IeR/sUCk8/Dj58A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BOgHqJJS2it1n2g3LplV9lY7EitEwoWzqQ8I6euYF5I=; b=bF9H/TS3cRuC9v+v3QmjweRXD2Xl86gFk5ITb44zvkl0iQxZeWQ4dGu8myDQYv7rZRkWw4N3mCs7uYi0ca3uYgK5sQsump/i9Bjf0kzj8QPPDu5Sdvw79hnlwzi+oxHrUYqLTwxVbMs5bsuHANLpl2k9OLK5XrjdPm5ObuwIEl775rZ4jfXZ1VdYhPTwcnFqiFPMT7x43LR7c8j3WsNWmeCg5XNzRm5b7X9jZ7NRpFYMRrSxrvzCv8ci/L1kZJQrGSIr4aG6tv+4VMN3JmJteCtNBOfqQMWMtEr5urmfwLtVQ78IQiV+6NwtmV8aNio5Kn/AC2qZMymw1q80Cqz8lw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug 2024 02:40:10 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%2]) with mapi id 15.20.7875.019; Mon, 19 Aug 2024 02:40:10 +0000 From: Liu Ying To: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, victor.liu@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com, krzk@kernel.org, Conor Dooley Subject: [PATCH v4 1/2] dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example Date: Mon, 19 Aug 2024 10:40:00 +0800 Message-Id: <20240819024001.850065-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240819024001.850065-1-victor.liu@nxp.com> References: <20240819024001.850065-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2P153CA0025.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::12) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|DU2PR04MB8807:EE_ X-MS-Office365-Filtering-Correlation-Id: 63ad6927-185c-4643-48ef-08dcbff83ece X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: Xpd1luQtKa27dwNW2Yy4REuR+l/b2gqta8xWU0ZETNyjOcPgPJWqTMmoXyFKbxzxqwsyu8VXin1um9onQHbtcAQecFZIVEV0LnR8z8Fv4Fwm2iYjBId5jD0QUo22o7hHoTesWIMtqxt/HSW9WbLZl52LTnhL59dq3dkbfbZni8TP+pzaTXu24yk+aIxjSXmbTtEurYm4HY9/QxdulQKcoy8AcBg50+9EY1cL/kK4XB+5ng9gWA+IW7YONwAVlAxltzoxC+4CFfZVJl2eVj4JlVmwxTuGNTQI7HZ8zM4X804IynMRCQKyByZFx0WPUnYBsTtPTY23pYMgx8O37IW359sEvLj7vl/KbTiFEpHYM7VwTZGn74Tk/ZlCeJMbeQMo+7D/yb+uUWuXZMxPEqQd+lfPO/DW028PU6WCmlhC1dT0lZpcgUkY2W0JNOOfW9XDYT+ZWJwneu3bk0GIZcx0YpOCV0Vb3xoZbJ4Fy9Iid1xJ9cOogBu/cSu4FQjhJ2c84x99jXqnsq+wwFSNaiKLHSE8QTRxt671AbgIZcOHJYUDgZKoNzDAhcvJUSSfgiouEWjcab1mu9Rl0b7wim6wCusuWecNic4zGhbHJoUJa8GfSgVJmbWRViDF3Pz4DoA63YXpGkW1F8jqAwpQJTzROnBceRYlBRC1vJErqpsVzjcmWABODrPGr58vcEgsObLwxoPDxHG/Ki89w6oER+Iz61INQAKwy1yZqT82U/Zlq+JxGcufm+i9uqeCoYeUyoGta4GeGusTXwHK0/pbNtBiC9v7k6CpQNeh68nbyPRhvsSEOxdSm/LkHdE9B0ME3AGLvSKlhAlcKvYF5k9jhqIiJnRgRgSJXoe4Sj5cZWTZOSxw9+8K0bfC9VN9KSUJs3P8RoIuUtndDyY8fdu4f4M7OzOG/y/i0Cqq1bvo4r2gMjXJpIhBYcH8l4PVLwAyc6nB68kNgorNvxF8Wc904IqrpgQgLm3KUMxFdoI/zCNIFJejpnZOflcvU4exZtHltqmlgyPy3ZFwDc2DeSDsTtx8eazW/9N8fHhvq/jPMXJmeWT7A7zv+pkItuCw9Ubl/MbuXCD4jSyY5G0NeDfaG4mj/LmmQtKz1pXIc2J9HCA9ItIyfSOr60LWJRPQodpVxsTlmGltVF6HD9ljF3egY0rGW15HypkoPcHnk22LG6JhaYjIJ91TBWGb/FDH6ifQYKWGs5NeU7WA0Zjym0367RsmStFfbOfdZ6dCdjkFJjVyvyDLAES9jwUYrYwrD8XZz9/jii5bWGEuxeC7Eo22IOYoj8tWyQIYCIvPd9b2MPbbot4YHnV/jbLJyoDIaUV6yw6H8QikQDrdopTTcPw7MMEg90q1d3WqA2+/bhXpPyyeCukygh5VGE+bF1gvImXmoOwVAPUCAVy6TpDqClHcBIVGrA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(7416014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FxXCh7ozWRfB9QCP17r+DU8U3pvOKiD0Bb62xP0mWID3uNLJdcwC7UZo8dFQHk8O4aVUREQR5va8xuATEBa2KWEdyetH3uAFgko/bX7ur2B9BC6zSfw8oWBTsvOiEFRKX2yaviQTsmI5eM4qdfS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ppR2tFyuu16GUoiMCGvjdtAHS1IQ35o8MP0gYsv6qyXBVFYMgHZqVsz3KQKTnEqeNMtwnwrRWS3K4utgYygTL08tR1019BsP8mRPp4sfFbOhAGX85byP5LfTEI7wMCitxKqaKYUMxK6jhlvQDBP7sbYoFDtWMdokBayQOcCjayYZnjSgYTRli0+gTHUYQRnHtg+VuS7XeBaTkEI2rIlCK1aYaPx0lIFq2NBx8INbn1GVOBfGvLGIwz51I+AhLx9XaSWd7CjikhrxE8nJCS1DoiLbd01HRLlJeFQ6Gr/IFKXA3hO4Us/22glt2WvRnhhrwpJpO2zxmLVDom9e7yfj5Ql0G1cKUbc1xI24QHnvmkb72H01Esta X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63ad6927-185c-4643-48ef-08dcbff83ece X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 02:40:10.8191 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4OfEKPjWJrc4LS+2muyOixMU55BEVK5uOeJpzHG8prQEv/62g/DqWcsq5fNGa2ldkSd99SiKX7YCqf0waiNpPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8807 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" i.MX93 SoC mediamix blk-ctrl contains one DISPLAY_MUX register which configures parallel display format by using the "PARALLEL_DISP_FORMAT" field. Document the Parallel Display Format Configuration(PDFC) subnode and add the subnode to example. Signed-off-by: Liu Ying Reviewed-by: Conor Dooley --- v3->v4: * No change. v2->v3: * Newly introduced to replace the standalone dt-binding in v1 and v2. (Rob) * Resend with Conor's R-b tag and with the patch rebased upon v6.11-rc1. .../soc/imx/fsl,imx93-media-blk-ctrl.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml index b3554e7f9e76..3f550c30d93d 100644 --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml @@ -24,6 +24,12 @@ properties: reg: maxItems: 1 + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + '#power-domain-cells': const: 1 @@ -46,9 +52,43 @@ properties: - const: csi - const: dsi + bridge@60: + type: object + additionalProperties: false + + properties: + compatible: + const: nxp,imx93-pdfc + + reg: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input port node to receive pixel data. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output port node to downstream pixel data receivers. + + required: + - port@0 + - port@1 + + required: + - compatible + - reg + - ports + required: - compatible - reg + - '#address-cells' + - '#size-cells' - power-domains - clocks - clock-names @@ -76,5 +116,33 @@ examples: <&clk IMX93_CLK_MIPI_DSI_GATE>; clock-names = "apb", "axi", "nic", "disp", "cam", "pxp", "lcdif", "isi", "csi", "dsi"; + #address-cells = <1>; + #size-cells = <1>; #power-domain-cells = <1>; + + bridge@60 { + compatible = "nxp,imx93-pdfc"; + reg = <0x60 0x4>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + pdfc_from_lcdif: endpoint { + remote-endpoint = <&lcdif_to_pdfc>; + }; + }; + + port@1 { + reg = <1>; + + pdfc_to_panel: endpoint { + remote-endpoint = <&panel_from_pdfc>; + }; + }; + }; + }; }; From patchwork Mon Aug 19 02:40:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13767739 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 F24A0C531DF for ; Mon, 19 Aug 2024 02:40:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64DD710E191; Mon, 19 Aug 2024 02:40:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="P1X6raDM"; dkim-atps=neutral Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011053.outbound.protection.outlook.com [52.101.70.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 175F510E195 for ; Mon, 19 Aug 2024 02:40:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rmNtkDzIPfZTppmPkvaknnmBjaFOuCjDxbYtWX/knbRD4/2DOj7EX+BotJV69yuviqUyB9vUz7hVq4//qrA3aiP76eadI8UcxOs7nF52opC0FIjtJMmvgfgy5YDZ7FREE7VXjazFrWeWj10hV5wr1KEigsWWkpMC13LkJSNY80CvFJsHaLjPk9azmTds9z9Nq8QNuP4PR8E7lg3dVKFkqmhCDIq3qP9WqNZEVuP42AMDp+v/02c6SemIYQ8jfNg2H0dbNzWamcHGVF91KpyYa8/1wOnBwu+u6mSxmnkdIUn5NOQyJU0JiJq3n7VWyUFcvXndG+oqlgYp+zFGrKcF9w== 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=cehUyaCyR1zI3cVhGpoICwdloV3y02HvuGtpiM1/OCo=; b=ueXWajDOds9wymM7XHigRrXtyDWkVNzybWQTzjdCAoUBNRKr495pQRJwjj5NeuysjIsPl5vK/5by2a8YPOTDTTEJeTufpNo/blK8aViWta2xGSLxwELkr1Pl33uC9U6pwaBaco8ddBQje8rM7x1FdFnCHJrI4TjkbDZAdfgu39XJQ0YyqPm3krdiMhaxxKBBR8oA9/7BEppbBuA3/LXrAAjyqBdy3n6+J1FGSaatmQInH5SWQ3lBd9Lm1SPotH6Mf7HPxnI+9Kb5CSL5WuCyUuwwelfnn2n11pAwL7Ja3NlDtVw0QJ/DniG/0b2d2/LHKsGDQWiFv5Y2T9HxmF2OsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cehUyaCyR1zI3cVhGpoICwdloV3y02HvuGtpiM1/OCo=; b=P1X6raDMwcZ5ro+swLtIJ+lxUyv2lBFwnTMpbN5rR4G9DJ++0pfKC0gDwW6pVqOF6OaRNJWHWJ4udzfSnq5nxonudStS5u85iCUPYrLZYYY1TWqsHD1W2XNXaRt9hc1YmSl2HBjRdU25o3pDLBdl72IwUt9PKxnBE3g6A+FVNQutQrr8RHVrEMJTHNyrob5rnUMevp1wfgnGgatVt1tNTthWNRoBrL1AB5kIfZssuuo1tX+bfPyOaj8bYLMXEfpmLsw02nUh/MhhY9FkJBuR09PYGmOWDryV1qSpH0eeHf2j/QQyhGRA96viOqOkhP+yX8l+1wIXqgixUXBtguywlA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug 2024 02:40:18 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%2]) with mapi id 15.20.7875.019; Mon, 19 Aug 2024 02:40:17 +0000 From: Liu Ying To: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, victor.liu@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com, krzk@kernel.org Subject: [PATCH v4 2/2] drm/bridge: imx: Add i.MX93 parallel display format configuration support Date: Mon, 19 Aug 2024 10:40:01 +0800 Message-Id: <20240819024001.850065-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240819024001.850065-1-victor.liu@nxp.com> References: <20240819024001.850065-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2P153CA0025.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::12) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|DU2PR04MB8807:EE_ X-MS-Office365-Filtering-Correlation-Id: d5e02fa4-cb5f-4bdb-bf24-08dcbff8430a X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: b4+0LxD1FokeO71F+E5ULgWUnpXkptz4s7bb6uA1GLc1WqcIwt02uoR4e19DzeVGooDzmc0bn31O45I1Q31MKLULxhUGbZUFh4UhUXuR2Dty2yoQUTxAyH/un8yodQWDdd5oD/pbYhNRpMB92OKywd5T3jxZ50TWeewOrRKpA60jjPw4V/2bKwRXwIb34UcKY4rcXBZl8Ui7xQiFTR6cWObVLvRegWQ9McPWY7ydZVsDwQsWuNOFlGYRF4T/aP1RwNF7U4nJRcIu/zbBvVl5/msvGgjq7AbaVmYhp2mFj3/I8y+8+PnO8vi7BrcR5rfkA41j0xJ4zZirR8rIMqkONCWvf4CRbzOa3UJEJJkjuRFJ3gargrhiMxloWnEMDlEK5mxW/yWahP67BLZ2sXZcQuvB48D4ntzrXG83JnZHlJgotAEJy8fdD/LR8cSCRgHQUekFfYPA5nnffPoSTOmqET0/0snMjlEBk3K+Y8WRjFNU+1OIqVLOQz8mRYpq4B35j6S+e7+thcV+V6nxYsflOotDa6+u2wtfbxnIw1ctr/E8FdDt12h1sZenrd07z40ZByUSAeevHAigbKP2AbgxaWzFzL9rQiuZ+FYiwdJVXa1s9Ge2rU63nCl9VFSk8inKJBQcKiiz7d1tlB6CnVfJLhfcWFl7M7nt/vtkIY0kjufp9evwR79NhyEWzxEE0LtDpBIU5dcKQ9kJGUJV84ZgsNBVs54em8H8S34adoaAHg0c8FBn7hIia5i7eIB0u4u4+ssuNSNGzXnplGUFQKRwpPMi6JnSmpTrUXSfQ+0pfnzTteuktrLkRdiqHEE8h76smCM530AlMG14QMdGzpyMgQQD3N+DyMiHiP4stLDQymT/5SbVAJs7VP+NH+x3AeAZKC93xDmv1RA809YdyxcyOGmXuQKruypt54QjtB0rPCwnZYALGFdvBiSyBdzyEbjfGY60vm+0wfSlHK3go5jaWFJLmrChoGyuyvEKk14A66uPQbfUwiO1aIoeSDL5odfgy3bdnqLCtghRv3AxtLeVJTGH824SElIc8JqfdwQqldkfqulG0lR0XfHnsNMRPh12J64zQRuh67cIMfRAkwMThRM2KCYj1x56zYdVuSouWQR1b3T1Pnlu61y7YAT+KREwbgphz4tvAuq4Ibq3AAaA7BYwRUmb/xrsfqBgIjGpaYx6oycluxdXJ032JQiAQ1ccRNaHO1Sn/qWviOhc1iftL9rsTj+R2w2Lt4NIxMD/MWaj98yu9ullWK+mMdeWUQsqukAMrt9QdFwRDun+kullTMv4OZCxQnxr35caqYvIc1WMCtBMmoa4q1Uq7NTqVWzLzMHuYQSRlH6fiudhzS5L6gP2Lm9ImxE+sksEtlnSEkeO39euDmcUuvOqP+2ypWn0hAECJpsLQLyPcF/Ue8lomA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(7416014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D5r8D8zLUdR3Vy0K+kRJSSZOKqsxgVZtWrR6IxwUEE1oXRZgfaNkXmnNLpvYm+f9eCP3jMBIYNEQxfbAH3DbhrLgidakn0Wa8DpYsPsLc0xGz6YxIhF3ZGO60baCUxUxFXwHGLM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tt2K2CCbzD1b64egQHd0d+L3HoZJxI2p2SBsTbINZQPgtRdP60MxCPaefrlmEauhR6Fd4X2arztNYRnFopiqE3uM4N3/G2Fl1N9QQNBYCK/EvFDRJbClhdSpyKrV2qTbTta8xMYKJbXEMgoONbtoVaHOmj6c5QVIOg6Wuo/76+sLju3qQPjzGbpIsxglcZOXfU6eQCEtXWcJSCO+wZauR+ELG6w4tXPpN/X1kOhV5LeuB7ctlHdO0ub80OIkKym6HMOQsYcp/yDhcT2nWW8KCT1ZzoE33+Sv6R2M7c4TDEG3iu5Iq3r23MonMFWdHE2/gOsR78bZ/nva5PUqPhDoTirUiNgaleJE9PnyXvtMBesTXznmWYg+sjA+5oY X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5e02fa4-cb5f-4bdb-bf24-08dcbff8430a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 02:40:17.9148 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ro7J8eCt7Pjl7/2LXd6cRL6ybnp+sWdQjUKfpCvRMQ1ulOuqG7xVIvbL0O4QlwrhHxUZvCErDPHGkKcpLPgLEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8807 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" NXP i.MX93 mediamix blk-ctrl contains one DISPLAY_MUX register which configures parallel display format by using the "PARALLEL_DISP_FORMAT" field. Add a DRM bridge driver to support the display format configuration. Signed-off-by: Liu Ying --- v3->v4: * Use dev_err_probe() in imx93_pdfc_bridge_probe(). (Krzysztof) * Drop MODULE_ALIAS(). (Krzysztof) * Update year of Copyright. v2->v3: * No change. * Resend with the patch rebased upon v6.11-rc1. v1->v2: * Set *num_input_fmts to zero in case imx93_pdfc_bridge_atomic_get_input_bus_fmts() returns NULL. * Replace .remove callback with .remove_new callback in imx93_pdfc_bridge_driver. drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx93-pdfc.c | 199 ++++++++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx93-pdfc.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 8dd89efa8ea7..088241575857 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -78,4 +78,12 @@ config DRM_IMX93_MIPI_DSI Choose this to enable MIPI DSI controller found in Freescale i.MX93 processor. +config DRM_IMX93_PARALLEL_DISP_FMT_CONFIG + tristate "NXP i.MX93 parallel display format configuration" + depends on OF + select DRM_KMS_HELPER + help + Choose this to enable parallel display format configuration + found in NXP i.MX93 processor. + endif # ARCH_MXC || COMPILE_TEST diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index edb0a7b71b30..8d3499fb7fba 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK) += imx8qxp-pixel-link.o obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK_TO_DPI) += imx8qxp-pxl2dpi.o obj-$(CONFIG_DRM_IMX93_MIPI_DSI) += imx93-mipi-dsi.o +obj-$(CONFIG_DRM_IMX93_PARALLEL_DISP_FMT_CONFIG) += imx93-pdfc.o diff --git a/drivers/gpu/drm/bridge/imx/imx93-pdfc.c b/drivers/gpu/drm/bridge/imx/imx93-pdfc.c new file mode 100644 index 000000000000..3dd92f7a0fd6 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx93-pdfc.c @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2022-2024 NXP + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define DISPLAY_MUX 0x60 +#define PARALLEL_DISP_FORMAT 0x700 + +enum imx93_pdfc_format { + RGB888_TO_RGB888 = 0x0, + RGB888_TO_RGB666 = 0x1 << 8, + RGB565_TO_RGB565 = 0x2 << 8, +}; + +struct imx93_pdfc { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct device *dev; + struct regmap *regmap; + u32 format; +}; + +static int imx93_pdfc_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + return drm_bridge_attach(bridge->encoder, pdfc->next_bridge, bridge, flags); +} + +static void +imx93_pdfc_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + regmap_update_bits(pdfc->regmap, DISPLAY_MUX, PARALLEL_DISP_FORMAT, + pdfc->format); +} + +static const u32 imx93_pdfc_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X24, + MEDIA_BUS_FMT_RGB666_1X18, + MEDIA_BUS_FMT_RGB565_1X16, + MEDIA_BUS_FMT_FIXED +}; + +static bool imx93_pdfc_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx93_pdfc_bus_output_fmts); i++) { + if (imx93_pdfc_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx93_pdfc_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + *num_input_fmts = 0; + + if (!imx93_pdfc_bus_output_fmt_supported(output_fmt)) + return NULL; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X24: + case MEDIA_BUS_FMT_RGB565_1X16: + input_fmts[0] = output_fmt; + break; + case MEDIA_BUS_FMT_RGB666_1X18: + case MEDIA_BUS_FMT_FIXED: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + } + + *num_input_fmts = 1; + + return input_fmts; +} + +static int imx93_pdfc_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + switch (bridge_state->output_bus_cfg.format) { + case MEDIA_BUS_FMT_RGB888_1X24: + pdfc->format = RGB888_TO_RGB888; + break; + case MEDIA_BUS_FMT_RGB666_1X18: + pdfc->format = RGB888_TO_RGB666; + break; + case MEDIA_BUS_FMT_RGB565_1X16: + pdfc->format = RGB565_TO_RGB565; + break; + default: + DRM_DEV_DEBUG_DRIVER(pdfc->dev, "Unsupported output bus format: 0x%x\n", + bridge_state->output_bus_cfg.format); + return -EINVAL; + } + + return 0; +} + +static const struct drm_bridge_funcs imx93_pdfc_bridge_funcs = { + .attach = imx93_pdfc_bridge_attach, + .atomic_enable = imx93_pdfc_bridge_atomic_enable, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_get_input_bus_fmts = imx93_pdfc_bridge_atomic_get_input_bus_fmts, + .atomic_check = imx93_pdfc_bridge_atomic_check, + .atomic_reset = drm_atomic_helper_bridge_reset, +}; + +static int imx93_pdfc_bridge_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx93_pdfc *pdfc; + + pdfc = devm_kzalloc(dev, sizeof(*pdfc), GFP_KERNEL); + if (!pdfc) + return -ENOMEM; + + pdfc->regmap = syscon_node_to_regmap(dev->of_node->parent); + if (IS_ERR(pdfc->regmap)) + return dev_err_probe(dev, PTR_ERR(pdfc->regmap), + "failed to get regmap\n"); + + pdfc->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); + if (IS_ERR(pdfc->next_bridge)) + return dev_err_probe(dev, PTR_ERR(pdfc->next_bridge), + "failed to get next bridge\n"); + + platform_set_drvdata(pdev, pdfc); + + pdfc->dev = dev; + pdfc->bridge.driver_private = pdfc; + pdfc->bridge.funcs = &imx93_pdfc_bridge_funcs; + pdfc->bridge.of_node = dev->of_node; + + drm_bridge_add(&pdfc->bridge); + + return 0; +} + +static void imx93_pdfc_bridge_remove(struct platform_device *pdev) +{ + struct imx93_pdfc *pdfc = platform_get_drvdata(pdev); + + drm_bridge_remove(&pdfc->bridge); +} + +static const struct of_device_id imx93_pdfc_dt_ids[] = { + { .compatible = "nxp,imx93-pdfc", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx93_pdfc_dt_ids); + +static struct platform_driver imx93_pdfc_bridge_driver = { + .probe = imx93_pdfc_bridge_probe, + .remove_new = imx93_pdfc_bridge_remove, + .driver = { + .of_match_table = imx93_pdfc_dt_ids, + .name = "imx93_pdfc", + }, +}; +module_platform_driver(imx93_pdfc_bridge_driver); + +MODULE_DESCRIPTION("NXP i.MX93 parallel display format configuration driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2");