From patchwork Fri Jul 5 09:09:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724583 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 50EF3C3271F for ; Fri, 5 Jul 2024 09:00:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDE4410E118; Fri, 5 Jul 2024 09:00:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="bNTAaoWW"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D2BD10E118 for ; Fri, 5 Jul 2024 09:00:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fbzRVJtLdfRfGn1zbZJExTW0Tr9+1Buxd7XYPKyJGg6u4krqu3yMW3sbjbch5J8d6uh61Gv2A8oaAxem4ww6PrkzaTU9Frt8UNxaltBNPSk9R+SwPehDzaUrS7p97+4Z1/og0H5oK3VkWrk6ooKQD3F0KNMoNtHj5gqPjwPFPhgf7/Ca4bhH1r9h2Fb7io0Gk+VTiz+WonWjyTpkTqmJHtvupN6Xzq4nqdSvp8jDIrtWM2NsW1Ghffz6gCF/ITadX44bpT6Z1Ep224m2iCIOif07MmuLixIfYJlIg2GRCNnhLAbkfauDDndxvwhnXrW1hYf6GxOThU3I3blGcZ3DOQ== 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=sT6lKM/DwTIOCTJWExf9s6IRdBvwiaST3MXIu+A34Dc=; b=ChDwe4/g/jLCNpLv330/eSInmEjrZ3Bi9o945nHdabvUeAlkRXokqx+98enlcy4g/j59QwzPVUBUmnsm4wiPJwU1mJVbMxsZwosXcdTPAYAf9qHXoHdhwh4rlrKpc7vDsobM2nzHLNvFWq8G/pX3jSjvtA0xx8ZTFPgXiW1+C3AUo7sop/NPsMjwIzITNDumqJdutrI1hozBVgHAA1R/vsnmdVHMiZYM+q3rrK+78cfrMjmyk7hDx+wrFJFBDEtWaBSreEaaP3nnRxWulf4kl6dD1oCBJbfZNY/j77rRo3XfKVe4yF+S+AQPRxaD6ObhgxKM8hIeqk+AOxYARHtdZA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sT6lKM/DwTIOCTJWExf9s6IRdBvwiaST3MXIu+A34Dc=; b=bNTAaoWWdMvNO5Np5hutGAkyK9QGNodD9aF6Br4H5iGaYjKmt6Mm7A2WVNpORzxy/PxlNKrn0QIY/qpPzyFvd67X1mi7jkAhNkePMQAYFKd3SouB28Ni4lq+3mtNyFiOom4+UmAxtqHHVjTcz5k6UMHr1HjzKV44mEuKXOdUEZo= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:00:52 +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.7741.027; Fri, 5 Jul 2024 09:00:52 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 01/10] dt-bindings: display: imx: Add some i.MX8qxp Display Controller processing units Date: Fri, 5 Jul 2024 17:09:23 +0800 Message-Id: <20240705090932.1880496-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: ae038fe5-fec6-45ef-7cff-08dc9cd0f8b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: sclk5AjdlXu0LsEZgJZfYA9h+fV3/EPgqpLMenqzmpt+2fz5LwXWxSFBl03uWCJk2XopNuXCGciR9xzrlH2PaezL6T/qFBPwUt1EfqBnF79SCP2l/ZF+QVc0ZlS6oIzAyxZ+k+sGl0NIU8J5dAlxit5/Xs2bLynPLCOcr3vc3yRVy0mTX7MqD22jzeVVujLVXnsM8ZkUpJQ16t8ui4yRpgNnTkDFGBnEau66mm/kFDgF07nP3OFZinhgipCOLZfedvhVPeGSEZ/5TtQclLrG9BhTrNhTtd8EG9mlnzB9fn8yugXNVV4k6AjHemAc66RNKUnUc0km/cu7l5714M+E96GqJpFWF0H+SJfR4T9uGxgbwXvjQMQttiNqD7u9t0JEA1kimYo2bmavLNbRcWEwuBqtDDkUgcSr0Kszd7Vz+XZlUHg2aLpR/nul7Hkdv2vh2BFXMN/rSB+rAum8TFthYcMHaQAgAyL3oJkYNEthHaNPNC41ucDtHu7FHmHvf5xBd/HtWixFdTn2deSFip7tVze0mf3u1JtByndMqhHGJ2o5aLXvDQL7veOAJbS9Dlar0wfdOrem0wKatpuOQ2PQzxsvxJFYCErVdwJFHRv8jbiZ5V4HdhCRUJ4LSlVdeARYFxBcgVtJ9wZeDHhdZBCCyhUyaD7nWFNd6r5/eX2EZHBea/TpH8Sho4ls42O3U3kpGDfzlq7OjoRCv+tttzB59LqzmsSnYzxfC9avMp/q2+MJZDtSTfcQ9SOx/Hla4TK9AF3lH7lP817GEUPXbagXlqUf6ISp3FGIpVTsulJ88bn7//OZk/voRbycDRDwhXGS36PkhL3bzWoPHHjWBYt63fKAm9IgtkWJbJvmX/NS4xx3Xzf7F2paXM0oF/LxoP4sYqkmHooIEqiWDNKHTmJ1vKFpD0eGZOgqbW/nQFQCCdWjsZ2LOeLzGNKuzecV5dHWVBuPxYrVmiBBNn3SoKPKl1XlBnQYKp2WwYKGIbTFKDay8cKrF2B41rm6euQHWfhPcBg0gkaoRhNp+OmqxY8/vuYCkAmOcMiUXPcr/yJl9m+ozjP7pPn0+npJFvROdMEXfzHdAw8sM+u7YCjZARwdct6AAHDMg2a/lm3ILa690yQhHK67avM6PP1hOEOo0DiKwpQgp0Duv8tJk6Yg31fuFTEG6aHtMkV6sZn98lppkuHBEqH+70S6dxs7GGE6FQoUR4NkK61t3/Nmbc1FXWyIeKL58NI0ehell/fDBMjVRpEVl4aCFMZABVsPNmwpxZqN4D2t1s+PdVBsv6z5TxMjhU2urj3yc8t2x/3OCEZYzwnq55KHxY1ir6+bUNYWWYQ3aLrQjXzA6oEP+AiWRCaBJoPE+vax1BznXj75FR2sUko= 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vmgMwoxxdyOiBqquIV5Q0L71nTPQfqE0sXnlWbwX3vbM93vIyc3UJ1wtEE+DSb5+XAzzxMwMswPnmFaZO2dUsEc+wSmAmv6IA9fAazfBKqnj0w5ygwBnQSow5NqCsLswtXpCeLWTeEF1yE6lYml7dAIE0ymlNEhbOvt5nj6dBwWPF6swbexM5z3ar17cxlNzhNZPMIcMCtf4kJUuiogwXJFwpC7ptmnPIKIvkgIm+eoApckjBe9YWGfsDSsFU8J7ITJhJ5wAY/DqkNHr2xrSMcHKpcP1nkflcKj4tCZmE2kz+SaNBuu4tuaymQ8pn3VGyn/51dg+tK5yp4mJd94WoTxywx0T7s5NsWpUYcTr/ygFdUoMrvA5NASbwPfMqZSV4NJcZF2SNXkIVhpEUG6kyuf5DUV60QdRq/2M9FUwfos0C/5NI0+gX/is/ZIOQvaSKuFi+NdXdOVWjts96OTpb1ySvvj1fYZesJwdlaXUxH7V9/CSSGWXaGvK+r/5Zd/RJctn4/oNsWRMzGtOWWFRWc0WxLL7sNvDwywv0PNe2r4MthcG5n+oq5Zh4omj9ZVwgcg2RQ9iT3dy/jaeOnh1GEmglIlJFCyoVINGzgBpu7x3nWI1uEUFPx8gLXKkUXtavsaQxV9SLvhQKbuvQioxVHENjGyUbyp/c9q+Dh1ld9T9RF/uWLkbAUfucMKq/nQn+Rls30u5GBhvf3ve5gfMtOynm1rkG1BzeRqYnbSGUAtCns45DoLa8/gGiwrbSAdXKThjFplZatsSgPpTNVSJNOY/I9Drhl/gJqByp6xlAwqkvst1GmDlFPEyNHOO1WehLR9OmzdeCnZkD33xxemBmIFpBpjfVFYwJSwjR3BZEYJt93DbwGuFupAQNK3z4bFbJXBwQhKA+5ThGyD7M3zWG1js82fbtciPNOP7AVCODnFZPQ+fAP9D5WSg/715c9IKwP4TlyRaUlUBg9gDifcwvfhYwua+SkWN92LNhAYEsHQx/6sS8TEXeYKwsHdwLhGny7sJ8nL3HWcKvNd6WiM2yUUt3XbdODjKR36OxuAlA1LzC6f+OLG+seoSw/ggP/rp3b7dG3KtGGAsoJ6KjtNnIr7Hke3Tbdr7VBj8m57ElhF8oioMl06c+ZUyaIUK+33WkaaN3mEgn3/29mfepIwI6u55xNjivsnqycwPnTtpY9DQb9TaOjna9BYOxcxvB/hDgB3XR0Jkj2xQiaXzIuCkOpkGuFxMyNEHXF2e+eWJ61Le7gpU2wY5B0KgzNe8Ix/8DSdqkjYVsd0iySTvxgX2wNZiP44fpVVnvgxAUErV3TOswFlounkoWVvPVUbfCSZwIHdQG7/oXhW2+Z0HkRFbVXMt6MnSeX8/hP0bqfJt0Gt/eLwRGxtQswGgqxbWB7CyqS33wKp3R83cp//30C0yPsCWza+FD+c8+1GC3GzDfRN8IBHs8kPaI20rVpqEdGeUg75DXtsDQupbZxdv8dtrW8TwUi/zhXzkuM5Jqy6LOFA+uMo4Xy7v/Yf0a/rdMBqD8FCZSOefGSXuuS76zC9BSM6s68mTToYgamrDWioLfUNbeswwE+ZSBj0BHqbyINzb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae038fe5-fec6-45ef-7cff-08dc9cd0f8b6 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:00:52.3872 (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: eCj7bRH4DQRS3/PF9ANBzfJ/J5gI0EvTIdRcR68ZFbeZv0iVIBjNZe0+q4/2yrp5SmpitGUBfQBX7UyDsh+clQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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" Freescale i.MX8qxp Display Controller is implemented as construction set of building blocks with unified concept and standardized interfaces. Document some processing units to support two display outputs. ConstFrame, ExtDst, FetchLayer, FetchWarp and LayerBlend processing units are in pixel engine. FrameGen and TCon processing units are in display engine. Signed-off-by: Liu Ying --- .../imx/fsl,imx8qxp-dc-constframe.yaml | 51 +++++++ .../display/imx/fsl,imx8qxp-dc-extdst.yaml | 79 +++++++++++ .../imx/fsl,imx8qxp-dc-fetchlayer.yaml | 37 ++++++ .../imx/fsl,imx8qxp-dc-fetchunit-common.yaml | 125 ++++++++++++++++++ .../display/imx/fsl,imx8qxp-dc-fetchwarp.yaml | 37 ++++++ .../display/imx/fsl,imx8qxp-dc-framegen.yaml | 71 ++++++++++ .../imx/fsl,imx8qxp-dc-layerblend.yaml | 46 +++++++ .../display/imx/fsl,imx8qxp-dc-tcon.yaml | 41 ++++++ 8 files changed, 487 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-constframe.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-extdst.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-framegen.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-layerblend.yaml create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-tcon.yaml diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-constframe.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-constframe.yaml new file mode 100644 index 000000000000..80f826289309 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-constframe.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-constframe.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Constant Frame + +description: | + The Constant Frame unit is used instead of a Fetch unit where generation of + constant color frames only is sufficient. This is the case for the background + planes of content and safety streams in a Display Controller. + + The color can be setup to any RGBA value. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-constframe + + reg: + maxItems: 2 + + reg-names: + items: + - const: pec + - const: cfg + + fsl,dc-cf-id: + description: Constant Frame unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 4, 5] + +required: + - compatible + - reg + - reg-names + - fsl,dc-cf-id + +additionalProperties: false + +examples: + - | + constframe@56180960 { + compatible = "fsl,imx8qxp-dc-constframe"; + reg = <0x56180960 0x3>, <0x56184400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-cf-id = <0>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-extdst.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-extdst.yaml new file mode 100644 index 000000000000..45957db3aadf --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-extdst.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-extdst.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller External Destination Interface + +description: | + The External Destination unit is the interface between the internal pixel + processing pipeline of the Pixel Engine, which is 30-bit RGB plus 8-bit Alpha, + and a Display Engine. + + It comprises the following built-in Gamma apply function. + + +------X-----------------------+ + | | ExtDst Unit | + | V | + | +-------+ | + | | Gamma | | + | +-------+ | + | | | + | V + + +------X-----------------------+ + + The output format is 24-bit RGB plus 1-bit Alpha. Conversion from 10 to 8 + bits is done by LSBit truncation. Alpha output bit is 1 for input 255, 0 + otherwise. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-extdst + + reg: + maxItems: 2 + + reg-names: + items: + - const: pec + - const: cfg + + interrupts: + maxItems: 3 + + interrupt-names: + items: + - const: shdload + - const: framecomplete + - const: seqcomplete + + fsl,dc-ed-id: + description: External Destination unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 4, 5] + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - fsl,dc-ed-id + +additionalProperties: false + +examples: + - | + extdst@56180980 { + compatible = "fsl,imx8qxp-dc-extdst"; + reg = <0x56180980 0x7>, <0x56184800 0x400>; + reg-names = "pec", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <3>, <4>, <5>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + fsl,dc-ed-id = <0>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml new file mode 100644 index 000000000000..d459573828ee --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Fetchlayer + +maintainers: + - Liu Ying + +allOf: + - $ref: fsl,imx8qxp-dc-fetchunit-common.yaml# + +properties: + compatible: + const: fsl,imx8qxp-dc-fetchlayer + + fsl,dc-fl-id: + description: Fetchlayer unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + const: 0 + +required: + - compatible + - fsl,dc-fl-id + +unevaluatedProperties: false + +examples: + - | + fetchlayer@56180ac0 { + compatible = "fsl,imx8qxp-dc-fetchlayer"; + reg = <0x56180ac0 0x3>, <0x56188400 0x800>; + reg-names = "pec", "cfg"; + fsl,dc-fl-id = <0>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml new file mode 100644 index 000000000000..a7a568672dc2 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml @@ -0,0 +1,125 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Fetch Unit + +description: | + The Fetch Unit is the interface between the AXI bus for source buffer access + and the internal pixel processing pipeline, which is 30-bit RGB plus 8-bit + Alpha. + + It is used to generate foreground planes in Display Controllers and source + planes in Blit Engines, and comprises the following built-in functions to + convert a wide range of frame buffer types. + + +---------X-----------------------------------------+ + | | Fetch Unit | + | V | + | +---------+ | + | | | | + | | Decode | Decompression [Decode] | + | | | | + | +---------+ | + | | | + | V | + | +---------+ | + | | Clip & | Clip Window [All] | + | | Overlay | Plane composition [Layer, Warp] | + | | | | + | +---------+ | + | | | + | V | + | +---------+ | + | | Re- | Flip/Rotate/Repl./Drop [All] | + X--> | sample | Perspective/Affine warping [Persp] | + | | | | Arbitrary warping [Warp, Persp] | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | | + | | | Palette | Color Palette [Layer, Decode] | + | | | | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | Extract | Raw to RGBA/YUV [All] | + | | | & | Bit width expansion [All] | + | | | Expand | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | Planar to packed | + | |->| Combine | [Decode, Warp, Persp] | + | | | | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | YUV422 to YUV444 | + | | | Chroma | [Decode, Persp] | + | | | | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | YUV to RGB | + | | | Color | [Warp, Persp, Decode, Layer] | + | | | | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | Gamma removal | + | | | Gamma | [Warp, Persp, Decode, Layer] | + | | | | | + | | +---------+ | + | | | | + | | V | + | | +---------+ | + | | | | Alpla multiply, RGB pre-multiply | + | ->| Multiply| [Warp, Persp, Decode, Layer] | + | | | | + | --------- | + | | | + | V | + | +---------+ | + | | | Bilinear filter | + | | Filter | [Warp, Persp] | + | | | | + | +---------+ | + | | | + | V | + +---------X-----------------------------------------+ + + Note that different derivatives of the Fetch Unit exist. Each implements a + specific subset only of the pipeline stages shown above. Restrictions for the + units are specified in [square brackets]. + +maintainers: + - Liu Ying + +properties: + reg: + maxItems: 2 + + reg-names: + items: + - const: pec + - const: cfg + + fsl,prg: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Optional Prefetch Resolve Gasket associated with the Fetch Unit. + +required: + - reg + - reg-names + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml new file mode 100644 index 000000000000..5613f84e6112 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Fetchwarp + +maintainers: + - Liu Ying + +allOf: + - $ref: fsl,imx8qxp-dc-fetchunit-common.yaml# + +properties: + compatible: + const: fsl,imx8qxp-dc-fetchwarp + + fsl,dc-fw-id: + description: Fetchwarp unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2, 9] + +required: + - compatible + - fsl,dc-fw-id + +unevaluatedProperties: false + +examples: + - | + fetchwarp@56180a60 { + compatible = "fsl,imx8qxp-dc-fetchwarp"; + reg = <0x56180a60 0x4>, <0x56186400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-fw-id = <2>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-framegen.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-framegen.yaml new file mode 100644 index 000000000000..3fe666f35a1e --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-framegen.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-framegen.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Frame Generator + +description: + The Frame Generator (FrameGen) module generates a programmable video timing + and optionally allows to synchronize the generated video timing to external + synchronization signals. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-framegen + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + interrupts: + maxItems: 8 + + interrupt-names: + items: + - const: int0 + - const: int1 + - const: int2 + - const: int3 + - const: primsync_on + - const: primsync_off + - const: secsync_on + - const: secsync_off + + fsl,dc-fg-id: + description: Frame Generator unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + +required: + - compatible + - reg + - clocks + - interrupts + - interrupt-names + - fsl,dc-fg-id + +additionalProperties: false + +examples: + - | + #include + #include + + framegen@5618b800 { + compatible = "fsl,imx8qxp-dc-framegen"; + reg = <0x5618b800 0x400>; + clocks = <&dc0_disp_lpcg IMX_LPCG_CLK_0>; + interrupt-parent = <&dc0_intc>; + interrupts = <18>, <19>, <20>, <21>, <41>, <42>, <43>, <44>; + interrupt-names = "int0", "int1", "int2", "int3", + "primsync_on", "primsync_off", + "secsync_on", "secsync_off"; + fsl,dc-fg-id = <0>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-layerblend.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-layerblend.yaml new file mode 100644 index 000000000000..7da26d5859d3 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-layerblend.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-layerblend.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Layer Blend Unit + +description: Combines two input frames to a single output frame. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-layerblend + + reg: + maxItems: 2 + + reg-names: + items: + - const: pec + - const: cfg + + fsl,dc-lb-id: + description: Layer Blend unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3] + +required: + - compatible + - reg + - reg-names + - fsl,dc-lb-id + +additionalProperties: false + +examples: + - | + layerblend@56180ba0 { + compatible = "fsl,imx8qxp-dc-layerblend"; + reg = <0x56180ba0 0x4>, <0x5618a400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-lb-id = <0>; + }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-tcon.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-tcon.yaml new file mode 100644 index 000000000000..32a57de1038d --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-tcon.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-tcon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Timing Controller + +description: + The TCon can generate a wide range of customized synchronization signals and + does the mapping of the color bits to the output. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-tcon + + reg: + maxItems: 1 + + fsl,dc-tc-id: + description: Timing Controller unit instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + +required: + - compatible + - reg + - fsl,dc-tc-id + +additionalProperties: false + +examples: + - | + tcon@5618c800 { + compatible = "fsl,imx8qxp-dc-tcon"; + reg = <0x5618c800 0x800>; + fsl,dc-tc-id = <0>; + }; From patchwork Fri Jul 5 09:09:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724584 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 19A57C30658 for ; Fri, 5 Jul 2024 09:01:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EF0710E1C5; Fri, 5 Jul 2024 09:01:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Z3ixAxAp"; dkim-atps=neutral Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2051.outbound.protection.outlook.com [40.107.22.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB10810E1C5 for ; Fri, 5 Jul 2024 09:01:01 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I8xmHBnwj3uoszSXgciNKM7EqSu7ZPLQTNnuntEVA6RQVxZIio3MJp3Fi8uxwW9uI/qnrNsSbfBGSHdSCetVYOQJQ4ZugWdsRhfQNA7LgnUbA2LS9Nk7zZDaRqE203Zt6D6jsBYB0Ry78R3sjs6RuCn0Ofj3Hj4xk3MEc3aZg5BN2LSkkzptLpUaAoSk5TqxM7IC/ixBI/nTnvPN5dPUSqXU6j6FZ04K8yo4rfqOJgDNvLXBfhvjWa6SMRNQAwXPuXKq1wBSLeK1FLqQ0O9lgBbe6go3WcX4MIA0TCZ82RpX2Acbo8GwoEENX86royaCHPmXxigopimnqj3AWWAu0w== 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=VZAptmPe51rTdPCzzBOBzkwam0POn6Ee486LLAmiX08=; b=WKzSBFe9UdntdFI0ZThyxt+tta5cnk1KfSG3DMegPAcUzDC9QMpGUw7Pq2uZFbTaxHA8t5Wetp+ahp5jRLs/N6B0KKoGCXFnEVnUSxBGl7EFCDY/i1FZqFWq4GTLRn0rts69DQBud6+ISG01jOWteOHskVM1GIgXLBfdvniGe/Os+RPQuT3zW0LADThtZClI3EtwyyGNjrOrp6PwtO5GqLdRRy7Zum5UAYkdAL2aQ3dyly+FFo6EhWul8i+1dMwU/X+Wc85Qk0VuZ8qLCbuKJJx2Cuicwl8tw0nxnd2c+c7zSqBNyM1ktKj9T/jqO5P+Rl3asg3Bzp2B+U1dGt2Mcw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VZAptmPe51rTdPCzzBOBzkwam0POn6Ee486LLAmiX08=; b=Z3ixAxAp7HpjRYfjeuWk2ul+c0aaK9pNmcuoHuO6GkYUl+a3RMWPVoeb9+8LUhbvMMF9n0puMIeoxVqEGgLVVBgh44CaZ52bRcL2Ho5F8Maf7TbclsQ6MN/tdLa8gla6k4sDRkWM8lp7sneGHybkM7BmxW3Lt46X7lpxBLf2AFs= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:00:59 +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.7741.027; Fri, 5 Jul 2024 09:00:59 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 02/10] dt-bindings: display: imx: Add i.MX8qxp Display Controller display engine Date: Fri, 5 Jul 2024 17:09:24 +0800 Message-Id: <20240705090932.1880496-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f825db7-d15a-4d83-03c2-08dc9cd0fcda X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: f7973bJq7w3h7YU96tPyFvdwygimpctuR6r4Z8sxrsSn6Sx5y3hvy8xRzbbbVvxq749bUMNKn/KaHhqQ4AW0VYsDIEtcC4ThvghkUvDCA6IL0T8iXpjsFft+g5qmSnujaz5RFb5lCofAJ0mkRDoSpL6eC72DJ4LNTdxQwugp2dn01x5dc59/7P6E00ZE5Otnxu6VxSpBvQeAWqXSHD4yXobuwkjZ118JikNKOfU00MUOV4H0fP9ji7Y3Xx9xGeVRhQsknS0iriQDhqJGI7JFFNpg1KxFz5l+yJhsg2ZRfs+XanEPag1Ap23AcTp6GcKwIbwnVuvtzVLlsCn+RzC5QfCUm3qzdgtLkRDSw/kionoSRuWQR4WG56PFhMDjbacIJ3xKf7U3wPlZv6qQXG/a5GKOXj0Q3GfmHbccJZNCaOd2UcMwxQATr0avnoAJUQi/1b5bSn3M5Av2iCmaQL5swYq4qyAYihUK8+oM17Z/HmA+gM+MjeAakFvB0MVBHVroHEIDxLFf0ZJjWxINEZFxyHD6VMUDVhWOeENrg0sJZI6BQpfImQev6WTEIcNaOfGIoPcRpQFXflZy2VsHKTavgBU/NAeXawt88IEGc4QmYBpvkWfxHgeT1VJPmDGUudUtY6b5NgQa+h9pRI9TPVwjacnnYH+CyPj6ijrjmbGJox7uMTa8Zw9NILwscQgjEEerqS6cZFiTfoEcmG5K3DZ7t9DVUsCr1GVDaFUkX4ZKiQgzC79Nz0d9xah71alDbcVIzVlVryMbO8G85AW1c0SW9iPqgWamEpGrgk8QXDWMRRJZ55EbJgDNjXC//0918HE0xwVLS+YopmmuixpkIaRCYVcuJwJ2blKAO2eVy7ku4y0bE+V880/RO7q1LAwfLrm6KhFw1PAHJHiWuMiY02N3qfS/6kDCay7kDR4ebuZa1zMLHckGltawkgTq4F4irSgQ7apC22uPjp4iIruMJrqrEjGlwlbmD1IATRQiytNwdomOhxut2lEi4zAtu8lu0MiFtpyYMXlY5REvRVT/DZpXitEV43FlP99bpCauttpYZ93XNyaomQlpREECNIbqyh4oAZ4SYCMeTIAWYpYw1bbZYICR5BYxph4mC9QKnvjbVtTSrT/1DH1+wC1GLEKXrDblUbVgJU31n83lBpJmmZzKY2Wqlj6oo9GB/QEbwEilYVnsuzUTxv6kC0K+sSB7lUQKeP/JUgqhuxt6CwjeN1G1nuPPMqphzELSFCHcNVNC/ZB5aNe1Fpc7YfFrJ+KU2MmuOwBLEk/RvTeSRUSFSvxJ1X9i+hLKYXToh1Gq0Ex1yRjIdXPkLnM8hzmgqJOiXXRlzpRiASPPlyEo7As3qXnDXW7xac/K8kJQHOhxHU9TQm4= 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gqDrCMASE+7JnpjgnSuVD+tyxqe/FqjI9fFK/SHDtEoBGcFcCySRjGUjFuT40l0R5Njluz2wH1s1L0eio5X2b7W9pU8bL1FxqoWUiKpdHCeaS6pZpQcAOsbNghHYs9hFNDjazxhdoHe3HgBiRVI5y6uWd1vBywGKAVzfO0l2wo7aQfDDQGGk01dcYQf9EyOZtO3MHCW0E4MdYTK4j2YkLur26j9nRJRRCQjT19eyEuXjYSnz0D0De4st5SHajqj2INhEa2PjQ8qLnDTct7QxBMFX/FRnnyOhl7Alj1VD4BHocN53dcnDAK+ld/hKbX+La8JRpMJ3JdVQwDpv+gsPvvwd5Ghq4LLfOrB5WIOecrXo3iJp0odahhTBH/+H/0E0nNWZBnL4QdABwNW7CODuHQp33BO+UKKhTKmLtiW2tb7cb/eBaWsemZpQpfzovUWyDUomzSPpubqWR7vGDRLSaP41UucPenU3ss9XNgLoj/qSu7s8lO9o8I2QILlLqsPdA838DxYKf/ArCG40LCmufPMoMvquZD3t0y2p83Z7OwpROqy9AOVyj6bh68dX2O3aOC8vnGs9lDIy7XSp2rOBJq0hvU/S4rZl/DAe3KuvZtm5vbzyZ3Z4vah5henu7RZwWsmYjDvPm/5HAJ+0xsCdOhLbLKC8UaVgpyXT8lDXmNrRoWUrBfpoEjLR8hnM/MIke/cnrQPtsPdQsX3WCZJjOjm85/v0gL7rItd4m9D4gXlt0HBF904PiH9QRCyhcOrH4WOsjnPve3GqsSnTqT2YsY/p9QJPLN7uQ3TnVhKr7pLXJ96Y4Jzp5MqVrwDL32tnJjIl6U/9VExsZwqbq3AF7SA53Fa9WrkGaKplLh9Svh11jtWkTnJwNno9Gra6jAh8vDEezBM5YFb03PSYpizLQ+Jrgl9eWDOmAQTplX0e6OleESQFIYGme2plv03irnJ70ppPduJa0C+vaZ6/U84JZgijZRe78tYKpSD7TqY+ECiHg7X2rKqbJbLDvJkHerUdRY0bOYs8VrPD5fUVKro+K6M+CC+YJKqO7OORUoKV52KQHBWMqaBMVQN2sasT0tqDxlaMKay0t58F2Zl9G8nXETh3HJi6tUy2DIt3TUuKp7vOdN8cKzmd/4ont7J3oz7YvqhacKykT0Cx15/Lw1nzv23OtmaEEn6PFuho9d7GOo91GPy34nauDn1v1UvM3iXlWgcwtyD6v4zW/iRD9fAXS4uY6EMd49OiEC7+xc9or5RhX/mCU66/3gQBu19xdbOfvwthEYm9ENQ8TyCLYAOGHGzqTT6E4PJlw4RLrPyq84gJMCEPp2yvimVET6bArE5I6fOr1AMxyWR64pGrGOFGqwELcnJG6TD23aMXZ73dGoZs+LoMJbiD02EZXkXHuBzSSjyJgH+qR52vw7A9+dKQPYejYIXg4AvWIK2JCOCpSM5rMAfeedNwbQaaLeyD3iatMFfXDyevTDVOI+TkOILbFez5RUlpsiWkjIfNwrhrGXD3o+KcAsbIBahwRgQunlYa8HMbemjjz4EX+KPVVwJvYOwY6IGY81x/epJFCgVVkmLOPz4AEQvUERcjYuQIWXE+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f825db7-d15a-4d83-03c2-08dc9cd0fcda X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:00:59.2612 (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: odU7V9t4+XpuVRPbopL3Cf/ykawM5+JiSidi6KT0YKxgr+K2LbYcPUYZKaxH91pbJOxted/XvCGxJmQv1BvvJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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.MX8qxp Display Controller display engine consists of all processing units that operate in a display clock domain. Signed-off-by: Liu Ying --- .../imx/fsl,imx8qxp-dc-display-engine.yaml | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-display-engine.yaml diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-display-engine.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-display-engine.yaml new file mode 100644 index 000000000000..dc9579897b76 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-display-engine.yaml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-display-engine.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Display Engine + +description: + All Processing Units that operate in a display clock domain. Pixel pipeline + is driven by a video timing and cannot be stalled. Implements all display + specific processing. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-display-engine + + reg: + maxItems: 2 + + reg-names: + items: + - const: top + - const: cfg + + resets: + maxItems: 1 + + interrupts: + maxItems: 3 + + interrupt-names: + items: + - const: shdload + - const: framecomplete + - const: seqcomplete + + power-domains: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + + fsl,dc-de-id: + description: Display Engine instance number + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + + port: + $ref: /schemas/graph.yaml#/properties/port + description: video output + +patternProperties: + "^dither@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-dither + + "^framegen@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-framegen + + "^gammacor@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-gammacor + + "^matrix@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-matrix + + "^signature@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-signature + + "^tcon@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-tcon + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - power-domains + - "#address-cells" + - "#size-cells" + - ranges + - fsl,dc-de-id + - port + +additionalProperties: false + +examples: + - | + #include + #include + + display-engine@5618b400 { + compatible = "fsl,imx8qxp-dc-display-engine"; + reg = <0x5618b400 0x14>, <0x5618b800 0x1c00>; + reg-names = "top", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <15>, <16>, <17>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + power-domains = <&pd IMX_SC_R_DC_0_PLL_0>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + fsl,dc-de-id = <0>; + + framegen@5618b800 { + compatible = "fsl,imx8qxp-dc-framegen"; + reg = <0x5618b800 0x400>; + clocks = <&dc0_disp_lpcg IMX_LPCG_CLK_0>; + interrupt-parent = <&dc0_intc>; + interrupts = <18>, <19>, <20>, <21>, <41>, <42>, <43>, <44>; + interrupt-names = "int0", "int1", "int2", "int3", + "primsync_on", "primsync_off", + "secsync_on", "secsync_off"; + fsl,dc-fg-id = <0>; + }; + + tcon@5618c800 { + compatible = "fsl,imx8qxp-dc-tcon"; + reg = <0x5618c800 0x800>; + fsl,dc-tc-id = <0>; + }; + + port { + dc0_disp0_dc0_pixel_combiner_ch0: endpoint { + remote-endpoint = <&dc0_pixel_combiner_ch0_dc0_disp0>; + }; + }; + }; From patchwork Fri Jul 5 09:09:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724585 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 57672C30658 for ; Fri, 5 Jul 2024 09:01:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D101010E160; Fri, 5 Jul 2024 09:01:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="WZDlSXdR"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2051.outbound.protection.outlook.com [40.107.21.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B6CF10E160 for ; Fri, 5 Jul 2024 09:01:08 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUv2klcb3JrRtmusjZ/UVl3p+CllP3tG9N/VVcmQyzsHSJ1mfDqyV33Jwg0UCrLb/2TkNddpZ8bJT0O6Srrh3OlF4KmrocuCJj5hlT0a6iYolMgMbptes8l62AAJEZwGldiCNYg18sruIYD+/QZJf7aLooTjQe8ZTSbDq4rCPYXa2KtKqepGPXm3LIgr0ufit0zxHhR3hB094UJD/gkAGGNQqpBgvjsK5YHHVvlX5WfG5879k9f6RXhTcckP0JBOY21kU39U/mTNh/CCxtkd5/nq2dAi24HYMNXuRrdfYlhP2ugnSss7bvZa7o6sCokdRsl+ISilTtj7UtWO02Gk9A== 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=xiZ26clii4/2nXnsdndzlfTHDA83GF83Cj3Xcy1sCTo=; b=B1TaVvplnqOmpbvpXOb0aGblZlTcR78Yu/rP7V7zkLB1GxexJeu05IpC34xOgVY+eAGNFlJBkdKfNoqONrs1R74iWFf/3gVUk2w9vOAphXm7mTQ5O7NNR/TUBrlvhqj9Gmf1amkGdakENFM605Z+UAe0T5Tjuhn3PZU+QZAdRrLxr5twQ7SxjK/FKhu+ajhP4/G4DPLGDHmmY2yM0neOS6wC2bSMQbj6RqP3ZxdlYmNteTJf1q+j4696AtyjDrgWaqev/Qa64rZiAydZ5K6xFPd++Fj+DzadyhFGik2aUq/GVIbbAMyS6aIiWQ5ohR9nnouhey7895syqjqRcybAJg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xiZ26clii4/2nXnsdndzlfTHDA83GF83Cj3Xcy1sCTo=; b=WZDlSXdR3zvj3UMErGbjDhPiWzoGkXasqGW81WZzqtz/YPv90QWtSo52/cv0odunpAl5HlrZX9tLz9/uOLyZrzRX9TFHPC4VU9OCV9M63NxQfm2jBGPwMtMaagDBrVnzkYsryqfR1eq/9+jI5MouUVRdhdJL04kBR6aVGeHMzbU= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:05 +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.7741.027; Fri, 5 Jul 2024 09:01:05 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 03/10] dt-bindings: display: imx: Add i.MX8qxp Display Controller pixel engine Date: Fri, 5 Jul 2024 17:09:25 +0800 Message-Id: <20240705090932.1880496-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: b18e6f44-6c86-40a5-481e-08dc9cd100a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: lCeovX+/jeonaD5e8W4QX9tFxrHPZAZ5pGsgAH/wMdlB7/mSxFf/jeqlmFWovdz7OURCYy2Z9IavPju4jhM+ISrmk87OU2ps+rf+mDpKvoxDDGANzfmTS1sv4xrrv7fx0oQOpMW7+5geu+pis4fnGpRjJZJrH1AXvAPCEGLU0YxC5bCOTK+aMChgfhqV3FngPvMXoCsYXRK2HNYDpNBYM3WuOkFQvjFqAgLki9AoBNQEz3jzDZg6w42uvCRxgSMtclzOsT+hdWyJWqWPdjB7+tF3tomBgAH1xGztErNH5p1DpLtknLVvxQQPiVsdSHcYmUVX+Bsiah/uhkFCY4e2p8TcpzuTQT0Gpsc3w3oyZJC+xQalV79fK90/CKwYgaHCm0G1GJ0yLNx+cLVivhoYpG0gVbZSwvQisqsAqKCVvtaUcpvjSrUV+Evd60ha2FUBZz1vA39U9h/E3ThR35w5tMy+enJFdsyBvZ3AjOsrXDlz0Au49iGgQEkZRyJv1JHirWE/Yewu+0cF/Oej4mu9linDY0QgUTIOh8apGbJK2lGokPMNE8954hLAEUK7033UiPe/zYGM387edUT+OyBstn0Q3wI7/dDj1kL7rLpWjzvKjehSrdPsodUl0BXycSesnjdPl2EKmBaZuoU158sF3V8LnRnTMyEvaoqn+QJRDb2M2agApgiSSIswJS1/yMCAuBYe+y16ksSfT3wbtLXDqTvkbK4T0DKJPIpNMm1dp55PFPbvzwObIrv9O9U1iuTPkIaq45qw437z71SA6UcRfsGqwDKv38zTtqal4UX8mlCo6Csr2wJ2hlxjK8tYlCPNkVnV35G2fWv81HNSYSRgdQjWSrmFvej99oXKDHG87p9I4tc45B142dnOruGR0pSI//dgxT+ISSEuBe4Gw6ciKK96enUAr7X8UbvW8cY5ONYxx1XvUCBH1L4oCMZMM/yQEvnrLBUsreRE5UNHylNwY//5dDdHaatkqwcGmEDvGIo1E02t6oP2zCEijhECK5IWsGn42ERKfCInzk0paqP3wJ7/adyHt1CoDdxpM+1ZRh+AcqSDXETnNbHDMkITJh32kqgDfqBDH9ViRZuc24ZBlppvX/8hpIqxyfRhWfWZNJvirlr7qIijwNoFC8WGSjM+sD3S/YhPRjrwR5GjNiQ/zdkqdHAvdP1Ga/dK9FiMEDzfoSJN3sXIdcgLSgfSuhqBoB9MdEbHMbyjMT/X9yf1lHX2wgCWkPmYxQJBtiNvAbWr2au/7m7IMAQJgzRgOVTjvi1A8kxmngkPOqgU7JyNscsiT+fmtb8FdYbEn8D573dIY7hsyxU6BsO+yiqNgY9G6GDo3lVbQN9QO/nldiLy1A== 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GZ3diDldRnnZIdU7yLPJZTU513KyJuEx3dyyrRn9huiw+srSQ/d3FJIeIEn1WCzhBM66BpmFTPtrU3/MPWDyeSzmLMH9GdZER84qCNYPYfnfX1PHybz5yyRNoQLEKb8tiwknkPPTR1xgwIypnnH3gEBbnhRZhwZ0pdlhvjliciVxKyKkVg39JPd2D6JYEYJ94rm9YzA/FUWUuSIfjFuPceOLR49tosKIKgS5aTys2H+pbwoonIZDZxGRBS+qmWEMpD/fJf5oXUsUuoAQQMraPkFzatsqKhgaEAL1qTxWXIwWGfVWDh+3+NYOlfv0W3c9WvqatrJKR8m7QrpPpCV+M6uSlZJrVcBGsobrtDnonRtem0jAkfViE6q1H+pTSsPqLdgM2APMt6VN9nsJPXVnsQDC+75H9a6OIRv1GyPKgRjjraek8J1ve1krmSgEcaCE2v78c8TH1erk70kK8F+UoWQC8Q908rsrMv/+bOHWkYHKqeCd0zMRE8XVyAaAkmUUoPzk7NK8/OtssSLH7PBaQfesJbgHtGnJ8E+G7owwjeNfeN4s4urNrcv/j0aUgjUrjnPFZTPmq2gggsPHJonh/hfuwpXbxM2nKByGyAVHqcv8oNGM+fD7vAl9Kao/dehmq5jgu3eGkgvYGktt5wGCAXT7M8vU4WdW1ml68F7pLv20R2Knd+T4lZSh9HF1LyQe7ojm5R12SvUlCBj8CrPUZMtNvAsRqrOd/D5MbgFW3MxcK4WV2kF6Fcc+pNASTz3De7SIYtLbgIgUOTjoc6x4i1UfRhxoPQ5Ku72xIVSUK7aMvn6XV2SboVtUyfqSAYMqVQJ+nt4byu5zhPgIm18hqN7uwbbQ3GYnocBMgXf1b9PfHG9Hdt6y1aA9uDIc5GUDE4Mf1MSdhEDB/usBIBQZZhEOu8mlEbviXDkDpVotqp6TItAqDzdfTKu28J9LDis29pfpCQIFRxhZIL8rTJSTbRBbTNVoymIUmsg39ltbeM6K+XadvCWLN4VDfcBDISaDWUNkY5/4CLX8wtv+ZqsYtknyhbtLotFhOP8pzVLPu8J0sE9bwzS407JIk+3pN49EuJaMHdeUkiuoQ+5IVZNakHVdCVIKTs1+aQGQFMwWrLKOqnElxnlFNyKdjOxi51Q2+ERImrWH82GzBu7kZ+hlGWYdK9FM18eiRyi4s4j9Pc3wi8Dwj+ZKmlQNCp0p6tXSctYHOP0n9tA7hrkLcg6HUib0GEB1i+c2cAReUZcrtR7qtaU7t+HW7m9Mj/U8csyIaMr6TzpuFCyHKASEbENtBb6Z1IlPw1B2x2uxAYMZxU8dgHisPrFfZCq3NS4nFmauV6L5S7bzdKPkHDUqX2LnwQj7bskBWc5lMbTxERye8XnhT5Y+5NbBkbc0Tno4R16XV0JttR05p7ny0CcC30BLgwrhSnV6vEoOBXWZeN2s6hSlQGYJe14x2XWK1VdaNATLFeGCc88wJD4rnCfAcLGhNKiHGJe1Wjei+f0q7uWEzLFZIzloa2TT/m8KH/cQQK4+2I5V1SjgUvWecTBdR8KaxNWx4wvhmv57UA/NxIj8nHNhUQTgItTMlgbgNEOESCFi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b18e6f44-6c86-40a5-481e-08dc9cd100a9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:05.4861 (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: fd0SVxve/kfEUOR1t+6I81c1xBHMtQ3MNHQshWHNSRuEUfpQFT8zNAiiwEdWHJI7L1okGQVdIvpjQoezg1Y8GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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.MX8qxp Display Controller pixel engine consists of all processing units that operate in the AXI bus clock domain. Command sequencer and interrupt controller of the Display Controller work with AXI bus clock, but they are not in pixel engine. Signed-off-by: Liu Ying --- .../imx/fsl,imx8qxp-dc-pixel-engine.yaml | 264 ++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml new file mode 100644 index 000000000000..29dd7bac6f7f --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml @@ -0,0 +1,264 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller Pixel Engine + +description: + All Processing Units that operate in the AXI bus clock domain. Pixel + pipelines have the ability to stall when a destination is busy. Implements + all communication to memory resources and most of the image processing + functions. Interconnection of Processing Units is re-configurable. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-pixel-engine + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + +patternProperties: + "^blit-engine@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-blit-engine + + "^constframe@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-constframe + + "^extdst@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-extdst + + "^fetchdecode@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-fetchdecode + + "^fetcheco@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-fetcheco + + "^fetchlayer@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-fetchlayer + + "^fetchwarp@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-fetchwarp + + "^hscaler@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-hscaler + + "^layerblend@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-layerblend + + "^matrix@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-matrix + + "^safety@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-safety + + "^vscaler@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-vscaler + +required: + - compatible + - reg + - clocks + - "#address-cells" + - "#size-cells" + - ranges + +additionalProperties: false + +examples: + - | + #include + + pixel-engine@56180800 { + compatible = "fsl,imx8qxp-dc-pixel-engine"; + reg = <0x56180800 0xac00>; + clocks = <&dc0_lpcg IMX_LPCG_CLK_5>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + constframe@56180960 { + compatible = "fsl,imx8qxp-dc-constframe"; + reg = <0x56180960 0x3>, <0x56184400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-cf-id = <0>; + }; + + extdst@56180980 { + compatible = "fsl,imx8qxp-dc-extdst"; + reg = <0x56180980 0x7>, <0x56184800 0x400>; + reg-names = "pec", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <3>, <4>, <5>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + fsl,dc-ed-id = <0>; + }; + + constframe@561809a0 { + compatible = "fsl,imx8qxp-dc-constframe"; + reg = <0x561809a0 0x3>, <0x56184c00 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-cf-id = <4>; + }; + + extdst@561809c0 { + compatible = "fsl,imx8qxp-dc-extdst"; + reg = <0x561809c0 0x7>, <0x56185000 0x400>; + reg-names = "pec", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <6>, <7>, <8>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + fsl,dc-ed-id = <4>; + }; + + constframe@561809e0 { + compatible = "fsl,imx8qxp-dc-constframe"; + reg = <0x561809e0 0x3>, <0x56185400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-cf-id = <1>; + }; + + extdst@56180a00 { + compatible = "fsl,imx8qxp-dc-extdst"; + reg = <0x56180a00 0x7>, <0x56185800 0x400>; + reg-names = "pec", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <9>, <10>, <11>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + fsl,dc-ed-id = <1>; + }; + + constframe@56180a20 { + compatible = "fsl,imx8qxp-dc-constframe"; + reg = <0x56180a20 0x3>, <0x56185c00 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-cf-id = <5>; + }; + + extdst@56180a40 { + compatible = "fsl,imx8qxp-dc-extdst"; + reg = <0x56180a40 0x7>, <0x56186000 0x400>; + reg-names = "pec", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <12>, <13>, <14>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + fsl,dc-ed-id = <5>; + }; + + fetchwarp@56180a60 { + compatible = "fsl,imx8qxp-dc-fetchwarp"; + reg = <0x56180a60 0x4>, <0x56186400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-fw-id = <2>; + }; + + fetchlayer@56180ac0 { + compatible = "fsl,imx8qxp-dc-fetchlayer"; + reg = <0x56180ac0 0x3>, <0x56188400 0x800>; + reg-names = "pec", "cfg"; + fsl,dc-fl-id = <0>; + }; + + layerblend@56180ba0 { + compatible = "fsl,imx8qxp-dc-layerblend"; + reg = <0x56180ba0 0x4>, <0x5618a400 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-lb-id = <0>; + }; + + layerblend@56180bc0 { + compatible = "fsl,imx8qxp-dc-layerblend"; + reg = <0x56180bc0 0x4>, <0x5618a800 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-lb-id = <1>; + }; + + layerblend@56180be0 { + compatible = "fsl,imx8qxp-dc-layerblend"; + reg = <0x56180be0 0x4>, <0x5618ac00 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-lb-id = <2>; + }; + + layerblend@56180c00 { + compatible = "fsl,imx8qxp-dc-layerblend"; + reg = <0x56180c00 0x4>, <0x5618b000 0x400>; + reg-names = "pec", "cfg"; + fsl,dc-lb-id = <3>; + }; + }; From patchwork Fri Jul 5 09:09:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724586 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 4440FC30658 for ; Fri, 5 Jul 2024 09:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C414E10E1C6; Fri, 5 Jul 2024 09:01:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="XA1rD+k2"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2054.outbound.protection.outlook.com [40.107.21.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id D369310E1C6 for ; Fri, 5 Jul 2024 09:01:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dLRGIwFocWVTNXPEnAq+XuFhWjYdCjJZaP6QrGZPLbRkTw4F/c37M4fKkQCaf5uAIgOTMvV9gJFL0y1dvmELDJ/PUQqI8obbxSdVQZyAPYGKaLcSJ9TU30qXVpK9gsMJNnCoIffeAbSfF6AGX48RGG0n1wxxd2X4qaALjSMcGZhvcG0BlWsnWF9z3HVIzmIZdM6Kml9KrjGBqXPSB3Qk8kuzXbby0GWNcluzTg3sdbXnU8f8XVmN/eaWU698v/eWZIf5fFZuIBu3QEPToBGRpRv2BtsoONKQF4AQe019ARh8Og6vJVG3DOGlD3xe+T8zFOY7yH6k0okpIRLcqEATuw== 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=UEf55uT3XE4bKAMTSguNsBHXp+SCDYfJ8Atxn7qr09c=; b=LLV/0xFudb1FKoYzYpPji5NO6At/43eEo2eFLg8w6fn1NYu0vPh6nO8EDHsZSLuOcwzGu5Sr7rGOU0dx3IANxgXjy+dqBZu+9FWz34BSAalPFD8AM1n80TesCClEAQ5fq/4GMdRcTG6C5f1ddRnn2qEdTPHGC/RBihlATxXf6dnGj/fM4zHR6yWWRxIKiQY1uvlfFMUpVFhFP/6s5XV9D55OTAZjkkdLdLI5imj5ks8xS90+2EPd8JwNryhe5JVw4IM6hT0UStuwkSXQ4TPbB4u0cXMVuj/TYXRYqirpYsjjQpIqJivNibk2MJ0E67iy0GifGmjBP3a8GCJMfCV4aA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UEf55uT3XE4bKAMTSguNsBHXp+SCDYfJ8Atxn7qr09c=; b=XA1rD+k2MDZPp4N7MscH5kBQCume6Fq3RuM6Rvhqcnap0Ml2p+BaVy0ZOqf1S/0GFhJf/tq+OHDp5SKPlcJA2h79EswjturLXG/4G3se/GW1+nsPiVUgsmltydLqy+N+QgQk9zgTRM3dHgP0PZ07ZQXky38GAGrthHjIe7buHLI= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:11 +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.7741.027; Fri, 5 Jul 2024 09:01:11 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 04/10] dt-bindings: interrupt-controller: Add i.MX8qxp Display Controller interrupt controller Date: Fri, 5 Jul 2024 17:09:26 +0800 Message-Id: <20240705090932.1880496-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: 64804976-afa5-4ed2-0471-08dc9cd10459 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 2QVvSH34wrejbb413cQEPnuHthirx4tHqttmXX2YvbT5kM7cixkZAxFqEREaPDlIPxVje9xWurVVe+O104nj5JtfeD4XNv+ZJ90fzn44qdroyijLmeqKgUYbU7reE+KXCbY4nfBi1pTxv3eevuGB32+nZY4VT1ZkCHrWyqV1CwfZpJe+ALXdG2FM8bBt1pZSx00M7aMhxU5ZVmTmAhgNVCnlprOdi6+D74xX9zvtzZmV/IvtpE595KU2pR+0Tt/Byops5FS+geu8rEiWJn9PziV04DdKXTysZs+lJIYh7cGy4iasfOsqFkeBqAl0sdLMcgz0JqhAEd2IjTimsgcnVPdVAa8D/oNLCe82BkNTktmX2qaSs2Ngn0CqAG70oFftlC2/Tzmxnni7FbqZuIFSyedzpgtnmtRboNg6pICryz6o1v2nUIk2ImNzlkLMcaXhvePwfb2oSWyVka/IhklrRkyHwf2CSrYZjsXyKnlkf9oQNkyBr0PFtmoY1w+JleB8cK8LWFBN2SS20xh/j26nhQO/+dvhbes2Yo3U07SMTJccv0LOx3n9Pa/JLrdq3gE2NxiT72mrKiu0ThC3OrAWYWVMiWDieUVJlqOjPI/PVkPK/+o8HAY7CgbxL0K+sLEz3ECqgsI9W6fAPV9nkBA6I0cYyvVy9ALMJqVsnctxLCkwm3neNTBO3dSG2ILb6ZdZvhZS2m4cDhUmjb60aoVumhUE6fLA9660+XbEnOa9iywDWCPEs7dxPuVPMK+coImqYFyIv99wK6uOW/AAE5T0qPyMRK20i3BRyPMg7W80kN8IYyMN2C+K2qVwAn3gjr4+TvHmzg7zci4Gc4xnkiYoKCWHZouL2uOvYou9e1vrWVa4ZEQDpcUk3mLVJ5nuAxfEOHCoullsFjh8ww2YPxTSf/ywyWjaRv7OgU+nBDNXM99rNKC2Q6LLEcG8a4ayjiFtkRXupsdzwgANaCZOMmu/mEFUnACEhMYNB+sslhx3YmXHKJzQjpWeDj7u8fpE68VJ+t2gphyuSWEjasDuEHAh2Egj1iUfIDf5FBIlK3sLxi/QSWCCWlMnWDwfU3qd/hk3y6G6ygH3VIvKz4G7a40kMfiHZqAT0OChdzu+AniqtJ26y8ZZD4/6td4g2zX3uXzlTJ4elaHT+6t/YW/EetO9hi8MfO8zHShMhr9pfq9iUAjXPVFY68uQhthA74HWg3L0g5zzCvbpw4afmy7FYujU4FS3Em5AX+1L49yiyOe2jO08CaB8HxulnN0fuyhRmdaMP+GzHouLDTfFt7QfCpBNbKr/RikN5TGZOkd6vKwSwfGNj6dzwp8MZisJTtAdOhzk+Oj9vQOIMsMrOTJi5aj82mIGcY2r5kWimPQtGLYCl1Y= 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KsHUyk99WqKZC4VVtxuoXg496aCo5Rcv38IqaMu2zgc5U6X5jErNvO+17LevHteTvo4O9Vhu0mUuIwDmtV3fSqQ81ZfNAA7+b6ClWWBSjJglQBcw5mTiBzLJYSOQvhD0dH77+rvuRDpgohPIGJqWDZ7WBFzeNItyDyQXTW5TQvXAEV+P7eilP42MlGa6ENLnp2XLuTsbMT6nPXwR6rEOLmmJtFMX9oP0s8jJqOLuRIGoM2lFmkRYaL4PFtJdki0HT0NJ4CyI//mDrhyBnapOK2MVFgobp7tTHOHn4xg2gMwwkiwUcwtJLt4E1ltQ0xjT8G6KvliGIy+SZJVrTrHapd3WJ5jwBWYA/FKG4qRy99bzfDrK0tjVpSlUoH7SlAYiGvaLc/PnS3tzO5eH9h9wuuqu4agR/ZIyl7SuxVGrY4681QtFNjm0BCBDO67epKlouF8iWKKoNYvyaG/hNeHaUxzUM+vjaSjuwU2evyyqLwVt4IVknCozd2zd+aoymSv8/beiWDUIqnAW4jwSQwvMG/2EHlkECo9ayxVeYSLgSrOpgSRDdR9awV6YBEimr2OzHP4ECkmHZ5YvQRfRbz696LyJcxWzAh+4VMeNecF45Zrp9TUaH3Cuc2/1eq8qU9h75mdStIbV87kdwO8ZS1GqFI2S2fC1wY0cPcUtVhvGcZK6omHU3PB3fJOZVKUdBgh/w19tCGsxgNnwl1NQDCFMly86vfRlZNm9MCg58rzQ8VT01+8a/pAetOlbfbQt6gOPWPg2PCf8MNJmUVh/U0aFNlnA47gonIoc1fk02chNr448BAFOAmcE8cv6Bt8KBKNRSr0nK6YvVrYN5r9YjimKvWe2dzfLIE0emhCWKhfSIXP3h1NWM3moWqkdbDEoEde+9s2Su6rWUOofzbYVZde131LV7QmZ/N598SyhlEFD84VbVLYntj9BVih29HZJrcYUNQfsFV8eJNbMJWK2GcHG7ge+MmI0/avCJcm4I805QLg5UZwiC4gf9Kelxxz5quDgPPtbFx8imMwbSehVm2JEOhwH3iDwUSIIgHNYgDAHrQ1ULKDkK9qwopencsKBacKqAWxn4veJH4y3siFG4+cAaBdK2pTIErtJLhifM76fVlqXOchw+wVMRv7X7vwxa++fYzHflMnLghhmJdoJuiak2F+LYu8uem26vEka4CF8Iiby+Mgc+WQmWMiHILDJez3Eoq6pIneNj8stSoz0LQD9xFGbSrKWk+EnQmHWjsQ8RImc5PaWtXxZddIocbZNnWlpB/8cwBvy0Jjr3vj3SIL/uOE1ZecWC9IY1wbtKyIa3S1UrYt6pmQITw9fwLAIf984NH9cxwICFxVkcEZYN2cRLzihT/sDK4asIQrJEtqjsW4Qx8gUXhmN9GcuigMei7nzivw3ThGKBBoVg4Hb7ylc9tuG4RygKmU/5E2pJ7GIWzEG68kttzml9c3qHJHjdO/9u+kOdL+V4Qu96bgOKydMBg3RMNVObtX8Egol7TVa+M+OGVBKkQ3IzqPb9IFxqroMFlAC8JM1PF5+tV03GHV/dcIal3yGP508z84GECD1UIV2P1aProupFHKPcv/4CDqf X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64804976-afa5-4ed2-0471-08dc9cd10459 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:11.6841 (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: KnNeKn7GUhc9ZgVvc1cSDWJhE0PtFtrd99uMlHDzBCIQX6m50Www7Uu0W4zTZl/yoBLWjbXfcO9zOYDRkbDXQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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.MX8qxp Display Controller has a built-in interrupt controller to support Enable/Status/Preset/Clear interrupt bit. Signed-off-by: Liu Ying --- .../fsl,imx8qxp-dc-intc.yaml | 321 ++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/fsl,imx8qxp-dc-intc.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/fsl,imx8qxp-dc-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/fsl,imx8qxp-dc-intc.yaml new file mode 100644 index 000000000000..3d0d11def505 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,imx8qxp-dc-intc.yaml @@ -0,0 +1,321 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/fsl,imx8qxp-dc-intc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller interrupt controller + +description: | + The Display Controller has a built-in interrupt controller with the following + features for all relevant HW events: + + * Enable bit (mask) + * Status bit (set by an HW event) + * Preset bit (can be used by SW to set status) + * Clear bit (used by SW to reset the status) + + Each interrupt can be connected as IRQ (maskable) and/or NMI (non-maskable). + Alternatively the un-masked trigger signals for all HW events are provided, + allowing it to use a global interrupt controller instead. + + Each interrupt can be protected against SW running in user mode. In that case, + only privileged AHB access can control the interrupt status. + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc-intc + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 1 + + interrupts: + items: + - description: | + store9 shadow load interrupt(blit engine) + - description: | + store9 frame complete interrupt(blit engine) + - description: | + store9 sequence complete interrupt(blit engine) + - description: | + extdst0 shadow load interrupt + (display controller, content stream 0) + - description: | + extdst0 frame complete interrupt + (display controller, content stream 0) + - description: | + extdst0 sequence complete interrupt + (display controller, content stream 0) + - description: | + extdst4 shadow load interrupt + (display controller, safety stream 0) + - description: | + extdst4 frame complete interrupt + (display controller, safety stream 0) + - description: | + extdst4 sequence complete interrupt + (display controller, safety stream 0) + - description: | + extdst1 shadow load interrupt + (display controller, content stream 1) + - description: | + extdst1 frame complete interrupt + (display controller, content stream 1) + - description: | + extdst1 sequence complete interrupt + (display controller, content stream 1) + - description: | + extdst5 shadow load interrupt + (display controller, safety stream 1) + - description: | + extdst5 frame complete interrupt + (display controller, safety stream 1) + - description: | + extdst5 sequence complete interrupt + (display controller, safety stream 1) + - description: | + disengcfg0 shadow load interrupt + (display controller, display stream 0) + - description: | + disengcfg0 frame complete interrupt + (display controller, display stream 0) + - description: | + disengcfg0 sequence complete interrupt + (display controller, display stream 0) + - description: | + framegen0 programmable interrupt0 + (display controller, display stream 0) + - description: | + framegen0 programmable interrupt1 + (display controller, display stream 0) + - description: | + framegen0 programmable interrupt2 + (display controller, display stream 0) + - description: | + framegen0 programmable interrupt3 + (display controller, display stream 0) + - description: | + signature0 shadow load interrupt + (display controller, display stream 0) + - description: | + signature0 measurement valid interrupt + (display controller, display stream 0) + - description: | + signature0 error condition interrupt + (display controller, display stream 0) + - description: | + disengcfg1 shadow load interrupt + (display controller, display stream 1) + - description: | + disengcfg1 frame complete interrupt + (display controller, display stream 1) + - description: | + disengcfg1 sequence complete interrupt + (display controller, display stream 1) + - description: | + framegen1 programmable interrupt0 + (display controller, display stream 1) + - description: | + framegen1 programmable interrupt1 + (display controller, display stream 1) + - description: | + framegen1 programmable interrupt2 + (display controller, display stream 1) + - description: | + framegen1 programmable interrupt3 + (display controller, display stream 1) + - description: | + signature1 shadow load interrupt + (display controller, display stream 1) + - description: | + signature1 measurement valid interrupt + (display controller, display stream 1) + - description: | + signature1 error condition interrupt + (display controller, display stream 1) + - description: reserved + - description: | + command sequencer error condition interrupt(command sequencer) + - description: | + common control software interrupt0(common control) + - description: | + common control software interrupt1(common control) + - description: | + common control software interrupt2(common control) + - description: | + common control software interrupt3(common control) + - description: | + framegen0 synchronization status activated interrupt + (display controller, safety stream 0) + - description: | + framegen0 synchronization status deactivated interrupt + (display controller, safety stream 0) + - description: | + framegen0 synchronization status activated interrupt + (display controller, content stream 0) + - description: | + framegen0 synchronization status deactivated interrupt + (display controller, content stream 0) + - description: | + framegen1 synchronization status activated interrupt + (display controller, safety stream 1) + - description: | + framegen1 synchronization status deactivated interrupt + (display controller, safety stream 1) + - description: | + framegen1 synchronization status activated interrupt + (display controller, content stream 1) + - description: | + framegen1 synchronization status deactivated interrupt + (display controller, content stream 1) + minItems: 49 + + interrupt-names: + items: + - const: store9_shdload + - const: store9_framecomplete + - const: store9_seqcomplete + - const: extdst0_shdload + - const: extdst0_framecomplete + - const: extdst0_seqcomplete + - const: extdst4_shdload + - const: extdst4_framecomplete + - const: extdst4_seqcomplete + - const: extdst1_shdload + - const: extdst1_framecomplete + - const: extdst1_seqcomplete + - const: extdst5_shdload + - const: extdst5_framecomplete + - const: extdst5_seqcomplete + - const: disengcfg_shdload0 + - const: disengcfg_framecomplete0 + - const: disengcfg_seqcomplete0 + - const: framegen0_int0 + - const: framegen0_int1 + - const: framegen0_int2 + - const: framegen0_int3 + - const: sig0_shdload + - const: sig0_valid + - const: sig0_error + - const: disengcfg_shdload1 + - const: disengcfg_framecomplete1 + - const: disengcfg_seqcomplete1 + - const: framegen1_int0 + - const: framegen1_int1 + - const: framegen1_int2 + - const: framegen1_int3 + - const: sig1_shdload + - const: sig1_valid + - const: sig1_error + - const: reserved + - const: cmdseq_error + - const: comctrl_sw0 + - const: comctrl_sw1 + - const: comctrl_sw2 + - const: comctrl_sw3 + - const: framegen0_primsync_on + - const: framegen0_primsync_off + - const: framegen0_secsync_on + - const: framegen0_secsync_off + - const: framegen1_primsync_on + - const: framegen1_primsync_off + - const: framegen1_secsync_on + - const: framegen1_secsync_off + minItems: 49 + +required: + - compatible + - reg + - clocks + - interrupt-controller + - "#interrupt-cells" + - interrupts + - interrupt-names + +additionalProperties: false + +examples: + - | + #include + + interrupt-controller@56180040 { + compatible = "fsl,imx8qxp-dc-intc"; + reg = <0x56180040 0x60>; + clocks = <&dc0_lpcg IMX_LPCG_CLK_5>; + interrupt-controller; + interrupt-parent = <&dc0_irqsteer>; + #interrupt-cells = <1>; + interrupts = <448>, <449>, <450>, <64>, + <65>, <66>, <67>, <68>, + <69>, <70>, <193>, <194>, + <195>, <196>, <197>, <72>, + <73>, <74>, <75>, <76>, + <77>, <78>, <79>, <80>, + <81>, <199>, <200>, <201>, + <202>, <203>, <204>, <205>, + <206>, <207>, <208>, <5>, + <0>, <1>, <2>, <3>, + <4>, <82>, <83>, <84>, + <85>, <209>, <210>, <211>, + <212>; + interrupt-names = "store9_shdload", + "store9_framecomplete", + "store9_seqcomplete", + "extdst0_shdload", + "extdst0_framecomplete", + "extdst0_seqcomplete", + "extdst4_shdload", + "extdst4_framecomplete", + "extdst4_seqcomplete", + "extdst1_shdload", + "extdst1_framecomplete", + "extdst1_seqcomplete", + "extdst5_shdload", + "extdst5_framecomplete", + "extdst5_seqcomplete", + "disengcfg_shdload0", + "disengcfg_framecomplete0", + "disengcfg_seqcomplete0", + "framegen0_int0", + "framegen0_int1", + "framegen0_int2", + "framegen0_int3", + "sig0_shdload", + "sig0_valid", + "sig0_error", + "disengcfg_shdload1", + "disengcfg_framecomplete1", + "disengcfg_seqcomplete1", + "framegen1_int0", + "framegen1_int1", + "framegen1_int2", + "framegen1_int3", + "sig1_shdload", + "sig1_valid", + "sig1_error", + "reserved", + "cmdseq_error", + "comctrl_sw0", + "comctrl_sw1", + "comctrl_sw2", + "comctrl_sw3", + "framegen0_primsync_on", + "framegen0_primsync_off", + "framegen0_secsync_on", + "framegen0_secsync_off", + "framegen1_primsync_on", + "framegen1_primsync_off", + "framegen1_secsync_on", + "framegen1_secsync_off"; + }; From patchwork Fri Jul 5 09:09:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724587 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 3B8DFC3271F for ; Fri, 5 Jul 2024 09:01:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA4E610E1F5; Fri, 5 Jul 2024 09:01:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="LsVs8nhK"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2045.outbound.protection.outlook.com [40.107.21.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A9D310E1F5 for ; Fri, 5 Jul 2024 09:01:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CxqGrMtZ5pAaTGj1Gqr+o0omvWL1F+7Xgq/txLiqiqZXUpCRplWj9mkAYiFO3FVzLL8fTz517rWNHMMidVVutl5I0Q4BaLF8MIvI8WBKE007jTYjLBiLF+B60MOAm3vtI9Wvbex1ODOiU9nosZSoKqKOqhUaAcVm8s0Yse1RDg69hd814OYYRpoVPM53arGR0AReG82a2/jaLj8f+q9IVhT+Nk1hUg1KpgnPjf6CcDXBAudGtHG2FeM/rJI2vdO4ely4GByfM8A6gvtObRMi4L42b1PRfcwpnySrYj2XIbq+Khgf5sGWy3ZZ83mg6RTVv/5h6m20hiviHAaHiEpibg== 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=W6ubKGAFKtGjOB8UXplivvNBDmBEZpvz78U8EbO0yp4=; b=B+19j6ivFydNTJAZnIAfVfNQID1D1IrgmM1wJKi2ctfmGOziICZPYcmUSpy+9wHg9GqwehTL/cMAJsqslwpq/wTFlmpQ+9Y8O1JLvVYFhgxNuPVa8wNlTV3NsOZnHoZUi+GMEihHYkhb7X5KOmW++/swcvAUKxe8VCgEZks6XKtMQqO/d63xwMaqjJTPujEbFSvc+rqPsWbp1swmr85VVBLK4rIqU3avppeLNTBcN+SnTl6gRwzLwGbVogTMkt2iS8yd0DExtgLeBSnD8hjwomX0RNMTPWC2ogw1YHhvjOl9qbKJTvmeNNJWX1hrLwD6Jp2UcTRqRmLEjIu5+NP5mQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W6ubKGAFKtGjOB8UXplivvNBDmBEZpvz78U8EbO0yp4=; b=LsVs8nhKD5tfvBpylhhxg0jhT58I1DcgQ4mJGOJNhfLnvyrKK2WvgBAHEEB235YqYEP2/M6XWCx6etNOWvY6wYrKgl/aW6lwgGQZarEKZm6zgCmsNSuQaABfj1TR0Es3f4YSqQcbB6jo8mcWq8ElMyGn4eAponPfnRK+Sv5H9iI= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01: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.7741.027; Fri, 5 Jul 2024 09:01:18 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 05/10] dt-bindings: display: imx: Add i.MX8qxp Display Controller Date: Fri, 5 Jul 2024 17:09:27 +0800 Message-Id: <20240705090932.1880496-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d9e4df9-8c8e-451b-feec-08dc9cd10836 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: MxkvzPRkOaVobFCSzGjfs2zi6qRGwNkCHU/le3JWbnQjEhtgSF0tuztj4l81pRdq173ybdvFUiTFRHKi28dAkA6MNotfgbGGBCRRqxsXaQZ1wrkNaNEVqAmI9YwFpnHyA2Xa67LAd93JiZxZRInM8VDG6LNAFsmtD2PACfq3+aOYFk+dL3y21lKgIMRJhUPiUonNATP+1P8qbhugR5WxRKq4gFNRH6LRQTL9SUtkDlkArcplYdzyLayvm9UnBL0vcp82ZpO1Dr1htnk/ZGTD+R1UguGtN9V2ZDEIY/8jr40pqwm5ltVTsMpPyXdbgHEicFlALdQcN+QuJI7sXKP32dBe8oj/hUcxka79y+g5IvfGqIxNqVunuHQM1Pnl5zzqwDpAG/FMbUeT7qbZKtEahSHhootKUkLHZ/SEXkZ+8g3QHWNtf2nAFxdMOHZROhjalzwkNQ5X8OfuFkSZg7oGmnlBjO8Stn5lZ0fpPhcSS5B9r1MrOL/XXv6KWicMuQuEdktuFFudp574hoBqi/AyQDMbApM7yUARG1JeNACxJS6wziP3FNn7F4vGSN/Cyfd3h0isg+ukeSoBGxwZhbURgfIjWHwdDkDn/QhUDM8et/D8WZ7JtDO1YBdNaqAqVmulYqSTrlo9wiPndi9kwzrSqeNxzp35AqLgdWxWbATd8JOBDMhEBB8I/ogQRXTEUOA5unBLkZRBE4O4PMuyhkcmojZXsBQmmdr6PY1dAttPxydW892q0O85sW1esoQmPIfdnxf8/NbowW7R9eDxtaFX4d60BTReCMpeo8GRaoEyfQ6lumyoZj8mN+F7TyWgjGYvkbWvktC+s0PCdvTAELct42nO+O+Vy6RCXFNkfVjzuGVSXIfoPZvhnHcJZHH06/TXXupnxnxSMUhhcygh1heCae8VW1T4GsroQBKVlmEKaitERKNY2Cm/nLRxiGT1V56VrnxBlwO1yXrmsvLxpaEvgqUF2P2kXDbvQmuVWwiFyqyAiOu9uq/P2L5Yfd0SOTfmbA8FpEqhO/yHn75UIRcEaOj1N6iiPh4bmdt2+k7GkY+shrXh4JS5HomXAq6iyTxqIZyxT4w7sMgQLEg8v8U2K757fIdTZDWYI7ed/r7n0Yx6g2iimbfmZdEQA6wBVXtF4unSHlLNc1irIAtDJVs1KKWEH75/wHQ/2Iso4KGFTZK/ocwS72nCzjnSuk30UbF3itvsr0CeiLED8h1L+ykZ6/Dwag4g4MC3aydd8bRin0MKHxD3WoKYB4hkQak0ZiTdiXttGPSMn2xiX+eGUk+Frlw8Qi3AhESG8oGJh6WT48htSFgeJ+GWz+8bgPy+UWAn2W+fJkHWE6OAs+dA8MPxmQ== 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2Ybkz7Wp9qA/yXWlwsYjT+x0DC7SB1BWCFUZtAmeFoJorvqeH1+LxHr/V5u+NCSspBCwSX8aWqyuJ7934MAOhIo7WF5e+uJtGVh4j6ruDRsMDRWHiog9R3s81+jnY+ykuXXZEnFKEdC6uJUE1bAQIb1gwGjd6nf+DxNz2toEkCb3NTSoh7ChdSVgS2gEshWEsaE4JFrcImRdXhM5VIJJdupqGqC+XHqFh11X9NNo5HjU5PRanSVLanHPv7GWBJF4g3m5cvJAdTn0YU1mDToQiM+JszftNrH/Hoq6pGK9CUBw5sBzp0FffgkdwyKjWMeSXj0MKetbUIqsnofN9oDOR+wwUPQSs+89XsKad4fRgirKngIVdnbYPpQCTXO4e59liKbd7R1NjMWKFoUBEZrAlpGl/QDP8FVLLG5ZjXTyliq5MyMwb7jDBX6fhbSrf+Ei/xPsdXVAzMvNLaS//F1saTRjlC5fvc0i2uuN5i772H7cCYxoFgawT0GyYuZU6WulDmAPVM8k3fnkuZKijh7EhxfJiSXTyJqDHivBeS04XAMig6CYN4/bwvLrzxMWKPTJCcgRUd1fl61uTmdHmo+0hqHRTQPGTwXxt7Smv8BoYQYZ3yV2jXGeXL5dYoSLskVdvO15pBiLiFK8zwhN6QmaCA8Ytxob+xr8MK+iTBoDbjnbnWiiY4oyXhgBQVPwFcbDRj5PIbEg63JGMpxR0aNRdSsOUgcqPpEZe9S7kR/TNhtrRmReme52Vglf/GmQU4cbGXb1sVU5floR9vq1y9dJZABW290/Sl2AVksQOOMr+Q75BquSZO6ed/EPVoQTdSU+HJsD9Gdffgygzb2+KRxCCuQumf7B6UstfpDnFgAkQRY9qcwx4CkJnkWEsEQNXbs+Tx3xQnR64qICHcS0yddTyspB75agRJk3ZFi+gYPBYM5J7I0tnlM8QSKqVg1wAcnGBxnuhfSmYLNxHuFmSoDW3TMcAWvkCif5LEmTrdOhGNRD7uR/pAxvZN4q9yFNKTS1PrA4+FTsKHkMU0RfbkfBuNar94AfrsZor82GUvaQf4Ys4RCrGmfW4Gpl5MrpjR2uks8MMgzH0h2vqQ6O6zHCT7QqRFRBLjJXcFWHINJ/9wHwLWkvp5y13+mrfbazPEAkebeYLxavMyA8AkH6oewXxbXXdLubSWXN07taBGL0pjzG6GXj5OwvIqCyxBUkbBKKu93OKEm7wsIog9PAb8ELqkM/YHiwuuu3c1BZVAW0u/SlM96VV0FSNQEp43ezO5MUYu0oFgxxLgz42ZmtIMTPCWvyC8Phyvq4RGpL2qKD8gYKnA1lOruSvDumTzml3QW9HurbxBLpbkL5CLo2zEMeyeO2NE2h87kLXq2/+qv+9/dRfhSxT50NHWci+f/fDZq5Xvqnu7ExjDJspfswa0KroYkBSErdjlxg69RLDFskjWaLfY6DK/dvgtnhBkG2Yp924hhg30K4HeZ9czk3S5ywBB3hu+eSM8RNXkFS4G0Hdh7jdtVePh5HyDVp7s3EahRl8ZJf9TfhJUfsrqpGPtZdd+zAilr5gl2MCB9YrQDSnt9gxNSbRF9gaBH5PUyoRkZi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d9e4df9-8c8e-451b-feec-08dc9cd10836 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:18.2059 (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: o8hv1Y9yRkdjuPKqSmmlRz7m3cy2eQcDuAdYP0mKPCcptUzT/H43J/tsne+nVH1piU88u4O+C8dJZuEB30gQVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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.MX8qxp Display Controller(DC) is comprised of three main components that include a blit engine for 2D graphics accelerations, display controller for display output processing, as well as a command sequencer. Signed-off-by: Liu Ying --- .../bindings/display/imx/fsl,imx8qxp-dc.yaml | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc.yaml diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc.yaml new file mode 100644 index 000000000000..a2ad280d2839 --- /dev/null +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc.yaml @@ -0,0 +1,243 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-dc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Display Controller + +description: | + The Freescale i.MX8qxp Display Controller(DC) is comprised of three main + components that include a blit engine for 2D graphics accelerations, display + controller for display output processing, as well as a command sequencer. + + Display buffers Source buffers + (AXI read master) (AXI read master) + | .......... | | | | + +---------------------------+------------+------------------+-+-+------+ + | Display Controller (DC) | .......... | | | | | + | | | | | | | + | @@@@@@@@@@@ +----------+------------+------------+ | | | | + A | | Command | | V V | | | | | + X <-+->| Sequencer | | @@@@@@@@@@@@@@@@@@@@@@@@@@@@ | V V V | + I | | (AXI CLK) | | | | | @@@@@@@@@@ | + | @@@@@@@@@@@ | | Pixel Engine | | | | | + | | | | (AXI CLK) | | | | | + | V | @@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | + A | *********** | | | | | | | Blit | | + H <-+->| Configure | | V V V V | | Engine | | + B | | (CFG CLK) | | 00000000000 11111111111 | | (AXI CLK)| | + | *********** | | Display | | Display | | | | | + | | | Engine | | Engine | | | | | + | | | (Disp CLK)| | (Disp CLK)| | | | | + | @@@@@@@@@@@ | 00000000000 11111111111 | @@@@@@@@@@ | + I | | Common | | | | | | | + R <-+--| Control | | | Display | | | | + Q | | (AXI CLK) | | | Controller | | | | + | @@@@@@@@@@@ +------------------------------------+ | | + | | | ^ | | + +--------------------------+----------------+-------+---------+--------+ + ^ | | | | + | V V | V + Clocks & Resets Display Display Panic Destination + Output0 Output1 Control buffer + (AXI write master) + +maintainers: + - Liu Ying + +properties: + compatible: + const: fsl,imx8qxp-dc + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 2 + + reset-names: + items: + - const: axi + - const: cfg + + power-domains: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + +patternProperties: + "^axi-performance-counter@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-axi-performance-counter + + "^command-sequencer@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-command-sequencer + + "^display-engine@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-display-engine + + "^interrupt-controller@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-intc + + "^pixel-engine@[0-9a-f]+$": + type: object + additionalProperties: true + + properties: + compatible: + const: fsl,imx8qxp-dc-pixel-engine + +required: + - compatible + - reg + - clocks + - power-domains + - "#address-cells" + - "#size-cells" + - ranges + +additionalProperties: false + +examples: + - | + #include + #include + + display-controller@56180000 { + compatible = "fsl,imx8qxp-dc"; + reg = <0x56180000 0x40000>; + clocks = <&dc0_lpcg IMX_LPCG_CLK_4>; + power-domains = <&pd IMX_SC_R_DC_0>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + interrupt-controller@56180040 { + compatible = "fsl,imx8qxp-dc-intc"; + reg = <0x56180040 0x60>; + clocks = <&dc0_lpcg IMX_LPCG_CLK_5>; + interrupt-controller; + interrupt-parent = <&dc0_irqsteer>; + #interrupt-cells = <1>; + interrupts = <448>, <449>, <450>, <64>, + <65>, <66>, <67>, <68>, + <69>, <70>, <193>, <194>, + <195>, <196>, <197>, <72>, + <73>, <74>, <75>, <76>, + <77>, <78>, <79>, <80>, + <81>, <199>, <200>, <201>, + <202>, <203>, <204>, <205>, + <206>, <207>, <208>, <5>, + <0>, <1>, <2>, <3>, + <4>, <82>, <83>, <84>, + <85>, <209>, <210>, <211>, + <212>; + interrupt-names = "store9_shdload", + "store9_framecomplete", + "store9_seqcomplete", + "extdst0_shdload", + "extdst0_framecomplete", + "extdst0_seqcomplete", + "extdst4_shdload", + "extdst4_framecomplete", + "extdst4_seqcomplete", + "extdst1_shdload", + "extdst1_framecomplete", + "extdst1_seqcomplete", + "extdst5_shdload", + "extdst5_framecomplete", + "extdst5_seqcomplete", + "disengcfg_shdload0", + "disengcfg_framecomplete0", + "disengcfg_seqcomplete0", + "framegen0_int0", + "framegen0_int1", + "framegen0_int2", + "framegen0_int3", + "sig0_shdload", + "sig0_valid", + "sig0_error", + "disengcfg_shdload1", + "disengcfg_framecomplete1", + "disengcfg_seqcomplete1", + "framegen1_int0", + "framegen1_int1", + "framegen1_int2", + "framegen1_int3", + "sig1_shdload", + "sig1_valid", + "sig1_error", + "reserved", + "cmdseq_error", + "comctrl_sw0", + "comctrl_sw1", + "comctrl_sw2", + "comctrl_sw3", + "framegen0_primsync_on", + "framegen0_primsync_off", + "framegen0_secsync_on", + "framegen0_secsync_off", + "framegen1_primsync_on", + "framegen1_primsync_off", + "framegen1_secsync_on", + "framegen1_secsync_off"; + }; + + pixel-engine@56180800 { + compatible = "fsl,imx8qxp-dc-pixel-engine"; + reg = <0x56180800 0xac00>; + clocks = <&dc0_lpcg IMX_LPCG_CLK_5>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; + + display-engine@5618b400 { + compatible = "fsl,imx8qxp-dc-display-engine"; + reg = <0x5618b400 0x14>, <0x5618b800 0x1c00>; + reg-names = "top", "cfg"; + interrupt-parent = <&dc0_intc>; + interrupts = <15>, <16>, <17>; + interrupt-names = "shdload", "framecomplete", "seqcomplete"; + power-domains = <&pd IMX_SC_R_DC_0_PLL_0>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + fsl,dc-de-id = <0>; + + port { + dc0_disp0_dc0_pixel_combiner_ch0: endpoint { + remote-endpoint = <&dc0_pixel_combiner_ch0_dc0_disp0>; + }; + }; + }; + }; From patchwork Fri Jul 5 09:09:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724588 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 43AF1C30658 for ; Fri, 5 Jul 2024 09:01:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B71F310E210; Fri, 5 Jul 2024 09:01:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="UV+9RhAV"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id F149A10E21C for ; Fri, 5 Jul 2024 09:01:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMeuShZjXp6Chi0bdFNGqsGGTtmDDrPQZuFG9a6lE9Nuf6KkmACMsLRobtmou634gfTfuLwVtI8UI3fT93HjkGC3pFNXGJWWmcoPfvHSsu3ZgYVyaxXoHGf21Dw5cYUcfKzkq2BiTJNm31FyRb6oqvGMvTYen5/FkrcWNDcmW9xZqm+2pDsLDDEfWhueUpVxwKg6ihog6J43i65YNUsLEdAX4sSEZ4VbXp8PTED+ma6UvrcTZzXg6ITnBfnmCZG0mzi8+SntAKz72wXqgzBQGaW9U4mqkg+BZDKXvMrHjOQa2tZCJaAjeRyQh3CjfvPjsbboe4sp22L39AH4UghSbw== 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=eF5e6T25AKsLJkHlP/Wsl1U1tUWhp1CTGF0smvdp9qE=; b=hB++QHhxRxufG7M1oQNAObmHpHQBqZvxgWNAJ9M2CAf4Jv71qoVE9pyfbRAvrgjRXhoXiYr91EBTTOIwu7t1NlGnzzmeZeoEoSj9Rj/WlYIUgbV31Jy2ew8WkMadmbtdsW2fy3XsenZFoLG09/5vkxHVoK3JRvbJtoLoX+r/mDBzS/cuzVb8afAhtdQEfBxeDsl0bmok9uq4vRSJudXmfPRd2tyoN4BC2CPFm88Y0C4SjSqHBytmzIhXTmbtmfFb1G2gytmfg7MabQepWJXpZ7aZyGeQBSI5AggRiaw9dc+/fsiZCosv+L5YPFDMitI6waOpJBb4nneapNa2ZO5JTg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eF5e6T25AKsLJkHlP/Wsl1U1tUWhp1CTGF0smvdp9qE=; b=UV+9RhAVwhz/wXtxvvmKzcMIv0IfGJKxzokRLdcLYotAZgHwckNQyleee1dkO65A4x9ayBCirtW/8JhOAMmN7VyhUaVXFB4YMFRs3JPUAx0vb2embde1cgmWaCVRM459UKojNtx4jQpLqKSwqt2EPjJpE8oe40k0Jnbyx5631pw= 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 PAXPR04MB9073.eurprd04.prod.outlook.com (2603:10a6:102:225::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:24 +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.7741.027; Fri, 5 Jul 2024 09:01:24 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 06/10] drm/imx: Add i.MX8qxp Display Controller display engine Date: Fri, 5 Jul 2024 17:09:28 +0800 Message-Id: <20240705090932.1880496-7-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PAXPR04MB9073:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a006445-0279-4136-13ac-08dc9cd10bfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: E9lnoS9DqMAHO7qxyVRfHkDO8LTFKbnvD6l+3P4xOXQtBHC1dmeCZL5c5WNd2UzmW38RZFgpyeIeKOaVf1uFSND283cIVho7+1P8HFhuM1qtGV53rfLOeCLLDhEky88znHhTfFKNckQfhZw+xnPWjtIk6tqd1gA1ju/aO2855bNyx00+Sqv5SdW+1Koty2UCGxkIidEOLQDW6tEaAi67N0XpdSHfH4GZMnvNNadfwkJB3oaQ3M6w1t6mrj21tgPHT4EHibx/VOi1GGHKJMxtIUPCVbf98Ik2uCwyvMTXg4FV1UF5E+KOF5lPtQSOdMS3mSQIO5FDtcxdJsZmWqJcH98l565YDu+oSWysve0OLAujd2MdBMC/bBJ04TQWZ7LL6h/GntUw9ib4ies/vrqBEK/528EBZ0qorc5ggjr/3YzSJ4K04BzoF9o0aRCGf+5Dp67B+fRitymtTSlgsjjvTKVO87DnyC/V/4sOUqDhHszB73BmagpgSp3zMBR16WCdj9KRDbsLSQM2mCJ1XaDiK3BYqyI1TLP6Isy+tHojPcBKjz4ILb7KER61oTB/+ZW9h8fTcAOu6OSMbshtuJY1dfkMdQVC58+MR5Xgv8aL9K+Mm+Jkbk8Xwp2N7UhgTHuyn94KIBokbSHtLtN+0uBJoa+Wvrj93zeBsWSxP/SJA0fGPZooDwPXNAZQqOitgbfu6FVUGZHi/B0ThsCU/wwW3IAi/da4Y2NvF1vQoeEFXNQPN82lq+DIhLIQTzUqtos12Fs/yUZInAXjYbiqqd+WkoJV7a8doV7sx3i32wdewudKSMSx9WztirTnhb8of12ACAaVepqqZ5Os4PqUwaW6q2K5PEzRSxBufrO9atmi8/5Q8YLTcOjQE1M4HUNB9KIPvDR1BwH9y5OPeUr6yDjymwnFUkhI5Wa6q5jQn0ApuQb9taGPbNNQXyI2EFqszkG/1HzB6qPGkTFdEXacXZ5/acG9xZQf+AXTUXqjV/D7Azh+EJvZ3mfZ8s1Qz3oMW1egMrPeRQ7miUX78HED7FNge4Xg5lsyT6iNp6AUzL7XR3N0+G1i6AOWBnf5X3w20ggLLuYCX1bSSJnnK68BWXgz91Srj/GGdWMm3FrcRxi6I8Nkl7zl8wtuGqwpf27nYjcLXYE8WMh9zbJBmrhNgcB1X5TshCcKUHFzC5C/zyBcd/by2/eNKxgJsAM6m7TxmvvzdEtRIcjIaMg9/pkYVHeEDynh5Oe7Lp7ICwst2mXFzD+Cn1PLlnkRGWrmx0CaPHSjS9Z6u2MKcWmrfb1Oh375ltG8iXsi6hcqlL+oNHy1OF+mJRrv8RlC/iV/MBelbfxkXgvoDsfhtsw/ULTnbeMsPj4BeE0ZcQzPU86JWJ3qyabHXOHBeheEkCSefklj+4t0HxarEDJKB1YQbytq3J4Snw== 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)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nH7X76XLROMnf21N6knbTZUvnlkrmY1mF+54DP7zah9Zi0HIOfiXjnnqTGqz7kNKoNIcaTysu82C/mKp7K9P6FEJLyvvvLWlxUEKU1yeUy+ypnPvBooUaOh7EGu3kmH0mfC8iz1Tx/SqLdL9bEk5Qx71rZOGlRQVxQ4hVlRrshmUoey0Ew9KC5lv8Z25XL0GVQnqxau42VWjoYwGtAgcKkTlLLsK0SdXSJgX/w5Zan/zgot7sM6RPSrcsz55ITvHcLHEeowr1TWoFmrV/5OZEHC7Rt3ibZemQCLCbuYHQAGu5vV07E5d2LfiAzUm4LJuoMSDemdBtikXqoNk1xL/QAe6LNqOq7ZEEupQAYk62r9EXDibelbsJg+qn6f5xXecjAHbVwAzhWlcf7mVsyCLfIqbn1G9k/k8F0XbjL0HY0xS7b1SHAtCD/bkPalKh3lxObWhHTN4CMSbo/GB5yoKJtUd7RcIlkaKtLdmlGMi7wlix6ogBR2VoPVv5TYtZIF441czSjZv8rad1DGguueVINos8txthTkcfNo/JaRIciDDVlhw01O+nmpzH+8bK3hyNyyRo77fq8j2RZmK9p2Oijer4veMoYWha8V3tAxmDLsCNDKhkLeNKAeqt/zrdzbZXiheIkNXCLqtiRZnakII7HVLgJe29D5MPNsRIIe25TpnGF+lFk9Us6JCGAl294czmVMHr7e3n1A2N+z87EM2CN3fow5NTv6IkInU8X1Qd1RRQ9MHp4WNqKYJtg2cjILSWUw6V8WQOnzBo7rRGvIdaKzL6NqfrFcLgbpa2Isz0K6RkGz1/DR4JnU0MrMwvMplphUiZIWlgoArn9WekElI5xZnEzEsf9c2d33TKUZbvYpg5z5T75PF4/UFMtEBRxPwtRCM3kea1cBS//xD/pw1bcjci7yP4Jrg3WCQRpAEQU6Z76Ld3AR1lgbuOQDZ3oc7d6Fg6X+OTyUQNYTT0csMZOfwF9qF5vuiRxOkn+H6ICtxaT52N04PZmg8XvxQZWh94iVmPPclfrOl/2UpNNNY2sAE7t6etzFEGZFR2MQp5gRE9TR45xRz64WrNzLKFVL6C9n7YH0yGr/Sa3QkvcZiljrnRJRg+NM4aAAMJG/BsidQqcsi7uWjPU5xH/t1AtbzlM5gcWSixQsiXPWd53BW8GtofD4lMfWSHjwM0jbN7DkDTzwiIfbGG01oHMFna19OE7Z7LlCXa85nX8vTmnqcQqKGRm/ttyeV4PnwGXT5Xpp/yOlowpVqNpWU80BdFVPFh0Kp/SeUs1C4Yyp4N26CBR6cGcssjF+RNPV3FPmMn/Ar8SSqNef2Ry8MNl7g9VxO7cIcTetiFo9+gYHrPsspMSO0ZsmbCCdIZZY9f2zb0lcxdhs3wS6O6XVPGWmnPD5zrrmBjN6uznDkD+VhNzyJy2fg7gkadXnVr+xfhX66O0U5sYq4qAZilqdCqlB9SqeW74YKD7lNRJoxT7Bv2RPO66K9Rau6k7zUHmT+t4p5D2h0YZXF3pUy8oQhAG7fP+mqf6a5LE4DhKRzXaN+/rSpP7995DXCQkjUkYQ6gW5lQ+PnMVXfAOb5im8gO4VZi1VG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a006445-0279-4136-13ac-08dc9cd10bfe X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:24.6665 (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: vKU/nF5miFr48UjA4U7Cwif7iukT1pQ/amcUpXk2ItaVD43uL4U8tALmVOxs5bhFPKbZX6oemtOKrZNJUXLbjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9073 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.MX8qxp Display Controller display engine consists of all processing units that operate in a display clock domain. Add minimal feature support with FrameGen and TCon so that the engine can output display timings. The display engine driver as a master binds FrameGen and TCon drivers as components. While at it, the display engine driver is a component to be bound with the upcoming DRM driver. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/Kconfig | 1 + drivers/gpu/drm/imx/Makefile | 1 + drivers/gpu/drm/imx/dc/Kconfig | 5 + drivers/gpu/drm/imx/dc/Makefile | 5 + drivers/gpu/drm/imx/dc/dc-de.c | 152 +++++++++++++ drivers/gpu/drm/imx/dc/dc-de.h | 61 ++++++ drivers/gpu/drm/imx/dc/dc-drv.c | 32 +++ drivers/gpu/drm/imx/dc/dc-drv.h | 24 +++ drivers/gpu/drm/imx/dc/dc-fg.c | 367 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/imx/dc/dc-tc.c | 137 ++++++++++++ 10 files changed, 785 insertions(+) create mode 100644 drivers/gpu/drm/imx/dc/Kconfig create mode 100644 drivers/gpu/drm/imx/dc/Makefile create mode 100644 drivers/gpu/drm/imx/dc/dc-de.c create mode 100644 drivers/gpu/drm/imx/dc/dc-de.h create mode 100644 drivers/gpu/drm/imx/dc/dc-drv.c create mode 100644 drivers/gpu/drm/imx/dc/dc-drv.h create mode 100644 drivers/gpu/drm/imx/dc/dc-fg.c create mode 100644 drivers/gpu/drm/imx/dc/dc-tc.c diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig index 03535a15dd8f..3e8c6edbc17c 100644 --- a/drivers/gpu/drm/imx/Kconfig +++ b/drivers/gpu/drm/imx/Kconfig @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only +source "drivers/gpu/drm/imx/dc/Kconfig" source "drivers/gpu/drm/imx/dcss/Kconfig" source "drivers/gpu/drm/imx/ipuv3/Kconfig" source "drivers/gpu/drm/imx/lcdc/Kconfig" diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile index 86f38e7c7422..c7b317640d71 100644 --- a/drivers/gpu/drm/imx/Makefile +++ b/drivers/gpu/drm/imx/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_DRM_IMX8_DC) += dc/ obj-$(CONFIG_DRM_IMX_DCSS) += dcss/ obj-$(CONFIG_DRM_IMX) += ipuv3/ obj-$(CONFIG_DRM_IMX_LCDC) += lcdc/ diff --git a/drivers/gpu/drm/imx/dc/Kconfig b/drivers/gpu/drm/imx/dc/Kconfig new file mode 100644 index 000000000000..32d7471c49d0 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/Kconfig @@ -0,0 +1,5 @@ +config DRM_IMX8_DC + tristate "Freescale i.MX8 Display Controller Graphics" + depends on DRM && COMMON_CLK && OF && (ARCH_MXC || COMPILE_TEST) + help + enable Freescale i.MX8 Display Controller(DC) graphics support diff --git a/drivers/gpu/drm/imx/dc/Makefile b/drivers/gpu/drm/imx/dc/Makefile new file mode 100644 index 000000000000..56de82d53d4d --- /dev/null +++ b/drivers/gpu/drm/imx/dc/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +imx8-dc-drm-objs := dc-de.o dc-drv.o dc-fg.o dc-tc.o + +obj-$(CONFIG_DRM_IMX8_DC) += imx8-dc-drm.o diff --git a/drivers/gpu/drm/imx/dc/dc-de.c b/drivers/gpu/drm/imx/dc/dc-de.c new file mode 100644 index 000000000000..047277c55bc1 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-de.c @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-de.h" +#include "dc-drv.h" + +#define POLARITYCTRL 0xc +#define POLEN_HIGH BIT(2) + +struct dc_de_priv { + struct dc_de engine; + void __iomem *reg_top; +}; + +static inline struct dc_de_priv *to_de_priv(struct dc_de *de) +{ + return container_of(de, struct dc_de_priv, engine); +} + +static inline void +dc_dec_write(struct dc_de *de, unsigned int offset, u32 value) +{ + struct dc_de_priv *priv = to_de_priv(de); + + writel(value, priv->reg_top + offset); +} + +static void dc_dec_init(struct dc_de *de) +{ + dc_dec_write(de, POLARITYCTRL, POLEN_HIGH); +} + +static int dc_de_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_de_priv *priv; + int ret; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg_top = devm_platform_ioremap_resource_byname(pdev, "top"); + if (IS_ERR(priv->reg_top)) + return PTR_ERR(priv->reg_top); + + priv->engine.irq_shdld = platform_get_irq_byname(pdev, "shdload"); + if (priv->engine.irq_shdld < 0) + return priv->engine.irq_shdld; + + priv->engine.irq_framecomplete = + platform_get_irq_byname(pdev, "framecomplete"); + if (priv->engine.irq_framecomplete < 0) + return priv->engine.irq_framecomplete; + + priv->engine.irq_seqcomplete = + platform_get_irq_byname(pdev, "seqcomplete"); + if (priv->engine.irq_seqcomplete < 0) + return priv->engine.irq_seqcomplete; + + ret = of_property_read_u32(dev->of_node, "fsl,dc-de-id", + &priv->engine.id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + priv->engine.dev = dev; + + dev_set_drvdata(dev, priv); + + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; + + dc_drm->de[priv->engine.id] = &priv->engine; + + return 0; +} + +static const struct component_ops dc_de_ops = { + .bind = dc_de_bind, +}; + +static int dc_de_probe(struct platform_device *pdev) +{ + int ret; + + ret = devm_of_platform_populate(&pdev->dev); + if (ret < 0) + return ret; + + ret = component_add(&pdev->dev, &dc_de_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_de_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_de_ops); +} + +static int dc_de_runtime_resume(struct device *dev) +{ + struct dc_de_priv *priv = dev_get_drvdata(dev); + struct dc_de *engine = &priv->engine; + + dc_dec_init(engine); + dc_fg_init(engine->fg); + dc_tc_init(engine->tc); + + return 0; +} + +static const struct dev_pm_ops dc_de_pm_ops = { + RUNTIME_PM_OPS(NULL, dc_de_runtime_resume, NULL) +}; + +static const struct of_device_id dc_de_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-display-engine", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_de_dt_ids); + +struct platform_driver dc_de_driver = { + .probe = dc_de_probe, + .remove_new = dc_de_remove, + .driver = { + .name = "imx8-dc-display-engine", + .of_match_table = dc_de_dt_ids, + .pm = pm_sleep_ptr(&dc_de_pm_ops), + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-de.h b/drivers/gpu/drm/imx/dc/dc-de.h new file mode 100644 index 000000000000..5fe340c88f91 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-de.h @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_DISPLAY_ENGINE_H__ +#define __DC_DISPLAY_ENGINE_H__ + +#include +#include + +#define DC_DISPLAYS 2 + +enum dc_fg_syncmode { + FG_SYNCMODE_OFF, /* No side-by-side synchronization. */ +}; + +enum dc_fg_dm { + FG_DM_CONSTCOL = 0x1, /* Constant Color Background is shown. */ + FG_DM_SEC_ON_TOP = 0x5, /* Both inputs overlaid with secondary on top. */ +}; + +struct dc_fg { +}; + +struct dc_tc { +}; + +struct dc_de { + struct device *dev; + struct dc_fg *fg; + struct dc_tc *tc; + int irq_shdld; + int irq_framecomplete; + int irq_seqcomplete; + u32 id; +}; + +/* Frame Generator Unit */ +void dc_fg_syncmode(struct dc_fg *fg, enum dc_fg_syncmode mode); +void dc_fg_cfg_videomode(struct dc_fg *fg, struct drm_display_mode *m); +void dc_fg_displaymode(struct dc_fg *fg, enum dc_fg_dm mode); +void dc_fg_panic_displaymode(struct dc_fg *fg, enum dc_fg_dm mode); +void dc_fg_enable(struct dc_fg *fg); +void dc_fg_disable(struct dc_fg *fg); +void dc_fg_shdtokgen(struct dc_fg *fg); +u32 dc_fg_get_frame_index(struct dc_fg *fg); +int dc_fg_get_line_index(struct dc_fg *fg); +bool dc_fg_wait_for_frame_index_moving(struct dc_fg *fg); +bool dc_fg_secondary_requests_to_read_empty_fifo(struct dc_fg *fg); +void dc_fg_secondary_clear_channel_status(struct dc_fg *fg); +int dc_fg_wait_for_secondary_syncup(struct dc_fg *fg); +void dc_fg_enable_clock(struct dc_fg *fg); +void dc_fg_disable_clock(struct dc_fg *fg); +enum drm_mode_status dc_fg_check_clock(struct dc_fg *fg, int clk_khz); +void dc_fg_init(struct dc_fg *fg); + +/* Timing Controller Unit */ +void dc_tc_init(struct dc_tc *tc); + +#endif /* __DC_DISPLAY_ENGINE_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-drv.c b/drivers/gpu/drm/imx/dc/dc-drv.c new file mode 100644 index 000000000000..e5910a82dd4d --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-drv.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include + +#include "dc-drv.h" + +static struct platform_driver * const dc_drivers[] = { + &dc_de_driver, + &dc_fg_driver, + &dc_tc_driver, +}; + +static int __init dc_drm_init(void) +{ + return platform_register_drivers(dc_drivers, ARRAY_SIZE(dc_drivers)); +} + +static void __exit dc_drm_exit(void) +{ + platform_unregister_drivers(dc_drivers, ARRAY_SIZE(dc_drivers)); +} + +module_init(dc_drm_init); +module_exit(dc_drm_exit); + +MODULE_DESCRIPTION("i.MX8 Display Controller DRM Driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/drm/imx/dc/dc-drv.h b/drivers/gpu/drm/imx/dc/dc-drv.h new file mode 100644 index 000000000000..e1290d9a0a99 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-drv.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_DRV_H__ +#define __DC_DRV_H__ + +#include + +#include + +#include "dc-de.h" + +struct dc_drm_device { + struct drm_device base; + struct dc_de *de[DC_DISPLAYS]; +}; + +extern struct platform_driver dc_de_driver; +extern struct platform_driver dc_fg_driver; +extern struct platform_driver dc_tc_driver; + +#endif /* __DC_DRV_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-fg.c b/drivers/gpu/drm/imx/dc/dc-fg.c new file mode 100644 index 000000000000..78491d17dfbd --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-fg.c @@ -0,0 +1,367 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "dc-de.h" +#include "dc-drv.h" + +#define FGSTCTRL 0x8 +#define FGSYNCMODE_MASK 0x6 +#define FGSYNCMODE(n) ((n) << 6) +#define SHDEN BIT(0) + +#define HTCFG1 0xc +#define HTOTAL(n) ((((n) - 1) & 0x3fff) << 16) +#define HACT(n) ((n) & 0x3fff) + +#define HTCFG2 0x10 +#define HSEN BIT(31) +#define HSBP(n) ((((n) - 1) & 0x3fff) << 16) +#define HSYNC(n) (((n) - 1) & 0x3fff) + +#define VTCFG1 0x14 +#define VTOTAL(n) ((((n) - 1) & 0x3fff) << 16) +#define VACT(n) ((n) & 0x3fff) + +#define VTCFG2 0x18 +#define VSEN BIT(31) +#define VSBP(n) ((((n) - 1) & 0x3fff) << 16) +#define VSYNC(n) (((n) - 1) & 0x3fff) + +#define PKICKCONFIG 0x2c +#define SKICKCONFIG 0x30 +#define EN BIT(31) +#define ROW(n) (((n) & 0x3fff) << 16) +#define COL(n) ((n) & 0x3fff) + +#define PACFG 0x54 +#define SACFG 0x58 +#define STARTX(n) (((n) + 1) & 0x3fff) +#define STARTY(n) (((((n) + 1) & 0x3fff)) << 16) + +#define FGINCTRL 0x5c +#define FGINCTRLPANIC 0x60 +#define FGDM_MASK 0x7 +#define ENPRIMALPHA BIT(3) +#define ENSECALPHA BIT(4) + +#define FGCCR 0x64 +#define CCGREEN(g) (((g) & 0x3ff) << 10) + +#define FGENABLE 0x68 +#define FGEN BIT(0) + +#define FGSLR 0x6c +#define SHDTOKGEN BIT(0) + +#define FGTIMESTAMP 0x74 +#define FRAMEINDEX_SHIFT 14 +#define FRAMEINDEX_MASK (0x3ffff << FRAMEINDEX_SHIFT) +#define LINEINDEX_MASK 0x3fff + +#define FGCHSTAT 0x78 +#define SECSYNCSTAT BIT(24) +#define SFIFOEMPTY BIT(16) + +#define FGCHSTATCLR 0x7c +#define CLRSECSTAT BIT(16) + +#define KHZ 1000 + +struct dc_fg_priv { + struct dc_fg fg; + struct device *dev; + void __iomem *reg; + struct clk *clk_disp; +}; + +static inline struct dc_fg_priv *to_fg_priv(struct dc_fg *fg) +{ + return container_of(fg, struct dc_fg_priv, fg); +} + +static inline u32 dc_fg_read(struct dc_fg *fg, unsigned int offset) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + + return readl(priv->reg + offset); +} + +static inline void +dc_fg_write(struct dc_fg *fg, unsigned int offset, u32 value) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + + writel(value, priv->reg + offset); +} + +static inline void +dc_fg_write_mask(struct dc_fg *fg, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_fg_read(fg, offset); + tmp &= ~mask; + dc_fg_write(fg, offset, tmp | value); +} + +static void dc_fg_enable_shden(struct dc_fg *fg) +{ + dc_fg_write_mask(fg, FGSTCTRL, SHDEN, SHDEN); +} + +void dc_fg_syncmode(struct dc_fg *fg, enum dc_fg_syncmode mode) +{ + dc_fg_write_mask(fg, FGSTCTRL, FGSYNCMODE_MASK, FGSYNCMODE(mode)); +} + +void dc_fg_cfg_videomode(struct dc_fg *fg, struct drm_display_mode *m) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + u32 hact, htotal, hsync, hsbp; + u32 vact, vtotal, vsync, vsbp; + u32 kick_row, kick_col; + int ret; + + hact = m->crtc_hdisplay; + htotal = m->crtc_htotal; + hsync = m->crtc_hsync_end - m->crtc_hsync_start; + hsbp = m->crtc_htotal - m->crtc_hsync_start; + + vact = m->crtc_vdisplay; + vtotal = m->crtc_vtotal; + vsync = m->crtc_vsync_end - m->crtc_vsync_start; + vsbp = m->crtc_vtotal - m->crtc_vsync_start; + + /* video mode */ + dc_fg_write(fg, HTCFG1, HACT(hact) | HTOTAL(htotal)); + dc_fg_write(fg, HTCFG2, HSYNC(hsync) | HSBP(hsbp) | HSEN); + dc_fg_write(fg, VTCFG1, VACT(vact) | VTOTAL(vtotal)); + dc_fg_write(fg, VTCFG2, VSYNC(vsync) | VSBP(vsbp) | VSEN); + + kick_col = hact + 1; + kick_row = vact; + + /* pkickconfig */ + dc_fg_write(fg, PKICKCONFIG, COL(kick_col) | ROW(kick_row) | EN); + + /* skikconfig */ + dc_fg_write(fg, SKICKCONFIG, COL(kick_col) | ROW(kick_row) | EN); + + /* primary and secondary area position configuration */ + dc_fg_write(fg, PACFG, STARTX(0) | STARTY(0)); + dc_fg_write(fg, SACFG, STARTX(0) | STARTY(0)); + + /* alpha */ + dc_fg_write_mask(fg, FGINCTRL, ENPRIMALPHA | ENSECALPHA, 0); + dc_fg_write_mask(fg, FGINCTRLPANIC, ENPRIMALPHA | ENSECALPHA, 0); + + /* constant color is green(used in panic mode) */ + dc_fg_write(fg, FGCCR, CCGREEN(0x3ff)); + + ret = clk_set_rate(priv->clk_disp, m->clock * KHZ); + if (ret < 0) + dev_err(priv->dev, + "failed to set display clock rate: %d\n", ret); +} + +void dc_fg_displaymode(struct dc_fg *fg, enum dc_fg_dm mode) +{ + dc_fg_write_mask(fg, FGINCTRL, FGDM_MASK, mode); +} + +void dc_fg_panic_displaymode(struct dc_fg *fg, enum dc_fg_dm mode) +{ + dc_fg_write_mask(fg, FGINCTRLPANIC, FGDM_MASK, mode); +} + +void dc_fg_enable(struct dc_fg *fg) +{ + dc_fg_write(fg, FGENABLE, FGEN); +} + +void dc_fg_disable(struct dc_fg *fg) +{ + dc_fg_write(fg, FGENABLE, 0); +} + +void dc_fg_shdtokgen(struct dc_fg *fg) +{ + dc_fg_write(fg, FGSLR, SHDTOKGEN); +} + +u32 dc_fg_get_frame_index(struct dc_fg *fg) +{ + u32 val = dc_fg_read(fg, FGTIMESTAMP); + + return (val & FRAMEINDEX_MASK) >> FRAMEINDEX_SHIFT; +} + +int dc_fg_get_line_index(struct dc_fg *fg) +{ + u32 val = dc_fg_read(fg, FGTIMESTAMP); + + return val & LINEINDEX_MASK; +} + +bool dc_fg_wait_for_frame_index_moving(struct dc_fg *fg) +{ + unsigned long timeout = jiffies + msecs_to_jiffies(100); + u32 frame_index, last_frame_index; + + frame_index = dc_fg_get_frame_index(fg); + do { + last_frame_index = frame_index; + frame_index = dc_fg_get_frame_index(fg); + } while (last_frame_index == frame_index && + time_before(jiffies, timeout)); + + return last_frame_index != frame_index; +} + +bool dc_fg_secondary_requests_to_read_empty_fifo(struct dc_fg *fg) +{ + u32 val; + + val = dc_fg_read(fg, FGCHSTAT); + + return !!(val & SFIFOEMPTY); +} + +void dc_fg_secondary_clear_channel_status(struct dc_fg *fg) +{ + dc_fg_write(fg, FGCHSTATCLR, CLRSECSTAT); +} + +int dc_fg_wait_for_secondary_syncup(struct dc_fg *fg) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + u32 val; + + return readl_poll_timeout(priv->reg + FGCHSTAT, val, + val & SECSYNCSTAT, 5, 100000); +} + +void dc_fg_enable_clock(struct dc_fg *fg) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + int ret; + + ret = clk_prepare_enable(priv->clk_disp); + if (ret) + dev_err(priv->dev, "failed to enable display clock: %d\n", ret); +} + +void dc_fg_disable_clock(struct dc_fg *fg) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + + clk_disable_unprepare(priv->clk_disp); +} + +enum drm_mode_status dc_fg_check_clock(struct dc_fg *fg, int clk_khz) +{ + struct dc_fg_priv *priv = to_fg_priv(fg); + unsigned long rounded_rate; + + rounded_rate = clk_round_rate(priv->clk_disp, clk_khz * KHZ); + + if (rounded_rate != clk_khz * KHZ) + return MODE_NOCLOCK; + + return MODE_OK; +} + +void dc_fg_init(struct dc_fg *fg) +{ + dc_fg_enable_shden(fg); + dc_fg_syncmode(fg, FG_SYNCMODE_OFF); +} + +static int dc_fg_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_fg_priv *priv; + struct dc_de *de; + int ret; + u32 id; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(priv->reg)) + return PTR_ERR(priv->reg); + + priv->clk_disp = devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk_disp)) + return dev_err_probe(dev, PTR_ERR(priv->clk_disp), + "failed to get display clock\n"); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-fg-id", &id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + priv->dev = dev; + + de = dc_drm->de[id]; + de->fg = &priv->fg; + + return 0; +} + +static const struct component_ops dc_fg_ops = { + .bind = dc_fg_bind, +}; + +static int dc_fg_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_fg_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_fg_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_fg_ops); +} + +static const struct of_device_id dc_fg_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-framegen", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_fg_dt_ids); + +struct platform_driver dc_fg_driver = { + .probe = dc_fg_probe, + .remove_new = dc_fg_remove, + .driver = { + .name = "imx8-dc-framegen", + .of_match_table = dc_fg_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-tc.c b/drivers/gpu/drm/imx/dc/dc-tc.c new file mode 100644 index 000000000000..9686f3ce95db --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-tc.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-drv.h" +#include "dc-de.h" + +#define TCON_CTRL 0x410 +#define CTRL_RST_VAL 0x01401408 + +/* red: MAPBIT 29-20, green: MAPBIT 19-10, blue: MAPBIT 9-0 */ +#define MAPBIT3_0 0x418 +#define MAPBIT7_4 0x41c +#define MAPBIT11_8 0x420 +#define MAPBIT15_12 0x424 +#define MAPBIT19_16 0x428 +#define MAPBIT23_20 0x42c +#define MAPBIT27_24 0x430 +#define MAPBIT31_28 0x434 +#define MAPBIT34_32 0x438 + +struct dc_tc_priv { + struct dc_tc tc; + void __iomem *reg; +}; + +static inline struct dc_tc_priv *to_tc_priv(struct dc_tc *tc) +{ + return container_of(tc, struct dc_tc_priv, tc); +} + +static inline void dc_tc_write(struct dc_tc *tc, unsigned int offset, u32 value) +{ + struct dc_tc_priv *priv = to_tc_priv(tc); + + writel(value, priv->reg + offset); +} + +static void dc_tc_set_fmt(struct dc_tc *tc) +{ + /* + * The pixels reach TCON are always in 30-bit BGR format. + * The first bridge always receives pixels in 30-bit RGB format. + * So, map the format to MEDIA_BUS_FMT_RGB101010_1X30. + */ + dc_tc_write(tc, MAPBIT3_0, 0x17161514); + dc_tc_write(tc, MAPBIT7_4, 0x1b1a1918); + dc_tc_write(tc, MAPBIT11_8, 0x0b0a1d1c); + dc_tc_write(tc, MAPBIT15_12, 0x0f0e0d0c); + dc_tc_write(tc, MAPBIT19_16, 0x13121110); + dc_tc_write(tc, MAPBIT23_20, 0x03020100); + dc_tc_write(tc, MAPBIT27_24, 0x07060504); + dc_tc_write(tc, MAPBIT31_28, 0x00000908); +} + +void dc_tc_init(struct dc_tc *tc) +{ + /* reset TCON_CTRL to POR default so that TCON works in bypass mode */ + dc_tc_write(tc, TCON_CTRL, CTRL_RST_VAL); + dc_tc_set_fmt(tc); +} + +static int dc_tc_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_tc_priv *priv; + struct dc_de *de; + int ret; + u32 id; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(priv->reg)) + return PTR_ERR(priv->reg); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-tc-id", &id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + de = dc_drm->de[id]; + de->tc = &priv->tc; + + return 0; +} + +static const struct component_ops dc_tc_ops = { + .bind = dc_tc_bind, +}; + +static int dc_tc_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_tc_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_tc_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_tc_ops); +} + +static const struct of_device_id dc_tc_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-tcon", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_tc_dt_ids); + +struct platform_driver dc_tc_driver = { + .probe = dc_tc_probe, + .remove_new = dc_tc_remove, + .driver = { + .name = "imx8-dc-tcon", + .of_match_table = dc_tc_dt_ids, + }, +}; From patchwork Fri Jul 5 09:09:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724589 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 EEF4DC3271F for ; Fri, 5 Jul 2024 09:01:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7578A10E205; Fri, 5 Jul 2024 09:01:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="iqQc/BeM"; dkim-atps=neutral Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 005EC10E205 for ; Fri, 5 Jul 2024 09:01:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SB7VtK49Gi2iXyQ+Bf6DsiNeUSkW3EUh9VcGBgQFe8WihGi9APlBfF7UIuDIz3xxUe23CNUsBUnElTBVemUtWlr5ywiRk2E9GQNv1ns6x7ly9l1VPXN++4KQzHnRm6Xe0ZwjPm9joUXZJHvNe9NxXebgzfVebpj6cdWruWcWmKLIh/Ztyz7kRzMJPVyhp6uxqcfKMHwXTZAU0OVPlGWB7hEtWXxkOvnH1l48ID9qhHV7uwjfll09nXF5tUCKet7rzCXqQ1XmVeKybpSMNdx3kT3Nk9+Jjg9HST0xATYHsZKTbVP/rBVsqnuilEa7JqPZzpoOzEXMOhW+kihnZrIupg== 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=RUFuTvPjLTmJtvp/DpMG0ecQKG1A6jC8ORj96xDYMz8=; b=ZSoQLrqWv60YHCdOKPVwSnX1o9BmLNOcY/h/L4NtEkcv1zlQk+d3LBlxg1/e8PulzPxae53g40SRhM1GhfLKECIFdhHR6b+FV+g/9v3akMV6jgSJ7uNccWPTLsP9cqxR0oOteZtV22nSY5kTYt+WMUJVd8SJok6C9dKwZxcjWxbTi7y6oke8n6CLEwySWM4sOS2jV4FgIiH3OzQfP8VY1b4VzZhFzZ688eLUHHQyuuZtQkeUw9bYggEa/5Zvm/K33eExym+lUw7NzZAOTCRYkcZa1uYm+Gvt9VYjiA7HzQMM86nXM4XKAr4cMdwKWL/8XpdRbQ4Y7/zp6t7LQhZL+w== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RUFuTvPjLTmJtvp/DpMG0ecQKG1A6jC8ORj96xDYMz8=; b=iqQc/BeMj2BtvgdaCM0AdvVef2Ik1yzDv/T0M2UYXr3YMEhFX+nNAbsBK6zE869iahvhAn8rwrG5S8+MIfe9UY6SC5SMbhQgMdrA6svB2WZeylGTPnIllcuUNXvhNY7ugAd9VXSMaFhDDEgs1PUBT6vNx5DaSpPjPMFlpb57VCU= 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 AS8PR04MB8038.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:31 +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.7741.027; Fri, 5 Jul 2024 09:01:31 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 07/10] drm/imx: Add i.MX8qxp Display Controller pixel engine Date: Fri, 5 Jul 2024 17:09:29 +0800 Message-Id: <20240705090932.1880496-8-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8038:EE_ X-MS-Office365-Filtering-Correlation-Id: 411e564a-a8a6-43e5-2a02-08dc9cd11028 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: qaRVpnoyh3KrQgTJPTQj3pWYnPO6NuXA5CV0ELLU9pRXupTMUm1EDk1B5nWAZ6P1rtREIZgmfOfyfnZvAKXKFG5CtNMtTIzwX/tyJoMagy/WZpfKmdLNOMcb+pYkwaHtmd2yjbAjj8bLl7ZexZzgQrwG3CyMl2kAy9rcKPlrQ6Ak1BvjWBDnBi7obt2mlR0bHzc69kjFwDbkupQcFdao+7GuvZUj2sPWwaZ4G0sl/vFxuduEBf+Yhs6lLsHQ5ZRL3YLNFmMKYvD/AUpPr270A6hGsD8HAgdXIKgeStlSBwIO/MJWZRb4Mttw8DFBBqUQrRhEXWauSOEYGtKLYl3Zhz+vc5JErIwmYkqgRCon43vKjsbXT/gRxxrtWkIivT+q2v42FFvMV2e+NqzbC/Io3dgOI6OKaOYVJckb2331xv0T8bwAL3wHGYIsWlIDZQLr8xuC0VgWuwhfVd/cZ8ltVTCp7oE42p/TvjPEUk81jcLycPO1I3ymIQIQKl4NQyJk7z7VNip8JcyXRuishdePHhUnYPbtH7dAA3jo5v7GAYycYHGr0yzpisBb1dZxiGa6l+HSSZkQkk14rVBFnYhmlHt9G8Zff+HyYxQQgsnLZGqrMFzEEHsdArEgANdNd88UhEX3s+U1KiEMUMiVibiXwyeq+xmt7NggCe8puCLLqkhDqTl4TLelf//hTMUqGBGhQ2jLJ5ba791Xz4LODpaBCsrQi4mUoh/PclbIOLTYQNMkV2enz+k/G6tm0WKYE2bCwKqoWx5R/UXn+piyU1KvOqzxXLZVbx/Fz+lC9H5EtfeEo1xPw/V4YDhibCWzmkPpfCNR0CppcmssVzOiUwyERypn+ZCANp2ONZCYZv9isEmvKXaaz9ZADlvgkvV2Bo2Cict2d/hiw13VGs38Z4zsfYFpPwKns0lxwn3mRd8WsD814gP/6ZaG4knShwIROxlXYtnIToHAhZ4upPi7q7cCHkMpdtdzkyFHDoOyYssJEJwvVsBevua0j9Ta/Ue7wdgi5+v4EMYs7tGSOn7ThD5UeuIP4h+FQeKe1lHrHEx4C7vW9RGmraZnsQTF8SVk4JoeCKZgRf+cralG0evds7BNjapuSq0woPgu922ePw1LdxoKCrYZgv+TAmgjNhSYGw9SN3HO5wkEfbd+wWJYvj3pQdoH/m1uLGcdiVpa00rUGGQNRAX+sLZt6jqP+zhxZAZrq3MFb25sFelPAPmbHkRZ/BjpeGbtbM1UnBDmhOk2adRticFrT4opRtDZnbleBAjOt9/VX5ctBW6T9KO3aSCaaoTveCtVMtEk+4ZbkG4lAhKsLx26zC17iJHmD7weOti+kNG0PyZ09/7V4aHvt5nHfWaPLrCwPLK2pA3OoTd5yD2kKuLWVsdDb2pkcQVgD2hIXOGIMSUPT3R3PERBvDLLYw== 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)(1800799024)(7416014)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iGyaMu8Q+R8iUoxfRlDnTj5HlkV7UM82uS+4A1GtMrVkBCubdFG4BoN8HCElini74onYna/o6dVjdx1S5iwc+hBGRohu/GiJtE4lr1oZDtNOPA3z2qYV9zwM8F8RuGYPgp5kfaXkHP8+iux4ZA9gi4MOAu9blSZJRwWyAjFPKp5giXD5e9EcYQakZoap6EJmheF8VApl5TCCESyQUv2M0DhFjftYL+E1r8dDspmjPFqPw9GqFNj8JntjHiEmEcsZbO0lSChi5kp96HiFK5XXAu8ny0jE/jikvrIUGHwQITcsU+qoitf2WMM3YY3F/EEFS32/naUziWnWjfpGPjDsk8cJD9SEQs1B1ooM8qh4STJ0i9gxiMYuDTv3P+nLdqqeDWc5aPDeIvPelJhFV88UNk1njz7UX5BTvOXbGuF3n7K/8d2D8IsdVYTsWWdpNibW1Wzq+sJFgY3bGeyhv5PZB/DtGLkq9zI3AHoo+GIY/no6jchQyMGVeJm5hcEcrYXOgfsDdiKBCGcVvOipeUIWbfs4ZelPr+mdHXCB7A/qrFhwQT8w7+xOGetWP/CCJR81mSbaF2/wrWXTSaWd6+ZNwJxbiXYqJg9Oe1Y3IhlxyzHLLf56KBqiknSELBRX9T81qpLZ1UFx3K6ko+ZF7P6W5Jk2lrW1YljL1GXjjsWUM6TmiZSUGvDMtQ6/zr1eADua7b717lE73XUtpCNO0Yc0hnTLR7pT9J1CGDOCdTI6V+hnVLI/wwjYPGu7aW9x+aSb+zV1g73/5zCDYk2c9jHoSS4ac0ECLWz0wuo1K5OQGbs4KMe2NR8TwNjWOyKTruXD3pey1qiInsPsupzEw6INYxvT8WdVts+grBV7hP31DnHN61XibrPBchgT0VJt9Nkm7tPTX9i72Bq8t7vKQELeApn2G2VVpxfjae/OetUl5m6ec1LGGzEuArmEu4SH55H1lLEu4nt7QNmBkzC4FYESLJr7Ph19R0C7GtZTfn7ESpuSbF92epoZ287/5PaFWLqflvmoYvdmKKJKI6pKUf6VShD1QhojSjkjxXEJFUoHwyIuJUNQ/+R/nQC1uPUrHZNEAq6THA6taVlpTimcrsTZVx2yq/XA2QHDd4NwSn8DP5JhoaRi5TZj1CD7ZjG7ANStZ508pCk8ICSGcWPydaOtK10WAyEEAgcHeIV2v9d/zUROouv7UWg0sfILJCQrmp92V6ZxBhotI/mYicR949wMjy9E6BBnm1uTHkcb7x+5DYpnqe2+1LxmJpiS+QRDhyHUERKcYGYY9mRryEUc3DnuJyU3wLCqjM25pFKFzkG1W21wY2xrwucEoMZjniCZnvh3uhTetUATG1cLovEDfM82FryFBDq+3qLX3PKn2tRovGvrG/6gmAIto3wpt8mxVtRZMg5t4RCclBZ9Ou/OCcif+R/gsvZPvrkkVC304G5xgoGHW6cAYULtc9f6xM7uC48gQ5ch4RIXRznv20piTJSboy8pW/WsyO8pjRE/KZAET8juEImEDlXe1e6y9lan3T1lZGCQ4W/S9xD3ubVbcJFfMxs3Vkm2UWsNlnu4m+wEGQaItk0Hj5iWxTvoJXpi20sO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 411e564a-a8a6-43e5-2a02-08dc9cd11028 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:31.7518 (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: YmFORv8cweI6gyeDBuZ7toRYSS9QT2xGhRBeYEqTxjqm7Y7yfNgqZxmTqgycvrMLYipzUYyMvylQXI0/Z5LR3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8038 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.MX8qxp Display Controller pixel engine consists of all processing units that operate in the AXI bus clock domain. Add drivers for ConstFrame, ExtDst, FetchLayer, FetchWarp and LayerBlend units, as well as a pixel engine driver, so that two displays with primary planes can be supported. The pixel engine driver as a master binds those unit drivers as components. While at it, the pixel engine driver is a component to be bound with the upcoming DRM driver. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/dc/Makefile | 3 +- drivers/gpu/drm/imx/dc/dc-cf.c | 158 +++++++++++++++++ drivers/gpu/drm/imx/dc/dc-drv.c | 6 + drivers/gpu/drm/imx/dc/dc-drv.h | 8 + drivers/gpu/drm/imx/dc/dc-ed.c | 267 ++++++++++++++++++++++++++++ drivers/gpu/drm/imx/dc/dc-fl.c | 137 +++++++++++++++ drivers/gpu/drm/imx/dc/dc-fu.c | 241 +++++++++++++++++++++++++ drivers/gpu/drm/imx/dc/dc-fu.h | 129 ++++++++++++++ drivers/gpu/drm/imx/dc/dc-fw.c | 150 ++++++++++++++++ drivers/gpu/drm/imx/dc/dc-lb.c | 301 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/imx/dc/dc-pe.c | 140 +++++++++++++++ drivers/gpu/drm/imx/dc/dc-pe.h | 91 ++++++++++ 12 files changed, 1630 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imx/dc/dc-cf.c create mode 100644 drivers/gpu/drm/imx/dc/dc-ed.c create mode 100644 drivers/gpu/drm/imx/dc/dc-fl.c create mode 100644 drivers/gpu/drm/imx/dc/dc-fu.c create mode 100644 drivers/gpu/drm/imx/dc/dc-fu.h create mode 100644 drivers/gpu/drm/imx/dc/dc-fw.c create mode 100644 drivers/gpu/drm/imx/dc/dc-lb.c create mode 100644 drivers/gpu/drm/imx/dc/dc-pe.c create mode 100644 drivers/gpu/drm/imx/dc/dc-pe.h diff --git a/drivers/gpu/drm/imx/dc/Makefile b/drivers/gpu/drm/imx/dc/Makefile index 56de82d53d4d..2942ae6fd5bd 100644 --- a/drivers/gpu/drm/imx/dc/Makefile +++ b/drivers/gpu/drm/imx/dc/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -imx8-dc-drm-objs := dc-de.o dc-drv.o dc-fg.o dc-tc.o +imx8-dc-drm-objs := dc-cf.o dc-de.o dc-drv.o dc-ed.o dc-fg.o dc-fl.o dc-fu.o \ + dc-fw.o dc-lb.o dc-pe.o dc-tc.o obj-$(CONFIG_DRM_IMX8_DC) += imx8-dc-drm.o diff --git a/drivers/gpu/drm/imx/dc/dc-cf.c b/drivers/gpu/drm/imx/dc/dc-cf.c new file mode 100644 index 000000000000..b438f8e46853 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-cf.c @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-drv.h" +#include "dc-pe.h" + +#define STATICCONTROL 0x8 + +#define FRAMEDIMENSIONS 0xc +#define WIDTH(w) (((w) - 1) & 0x3fff) +#define HEIGHT(h) ((((h) - 1) & 0x3fff) << 16) + +#define CONSTANTCOLOR 0x10 +#define BLUE(b) (((b) & 0xff) << 8) + +struct dc_cf_priv { + struct dc_cf cf; + void __iomem *reg_cfg; + u32 id; + enum dc_link_id link; +}; + +static inline struct dc_cf_priv *to_cf_priv(struct dc_cf *cf) +{ + return container_of(cf, struct dc_cf_priv, cf); +} + +static inline void dc_cf_write(struct dc_cf *cf, unsigned int offset, u32 value) +{ + struct dc_cf_priv *priv = to_cf_priv(cf); + + writel(value, priv->reg_cfg + offset); +} + +static void dc_cf_enable_shden(struct dc_cf *cf) +{ + dc_cf_write(cf, STATICCONTROL, SHDEN); +} + +enum dc_link_id dc_cf_get_link_id(struct dc_cf *cf) +{ + struct dc_cf_priv *priv = to_cf_priv(cf); + + return priv->link; +} + +void dc_cf_framedimensions(struct dc_cf *cf, unsigned int w, + unsigned int h) +{ + dc_cf_write(cf, FRAMEDIMENSIONS, WIDTH(w) | HEIGHT(h)); +} + +void dc_cf_constantcolor_black(struct dc_cf *cf) +{ + dc_cf_write(cf, CONSTANTCOLOR, 0); +} + +void dc_cf_constantcolor_blue(struct dc_cf *cf) +{ + dc_cf_write(cf, CONSTANTCOLOR, BLUE(0xff)); +} + +void dc_cf_init(struct dc_cf *cf) +{ + dc_cf_enable_shden(cf); +} + +static int dc_cf_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_pe *pe = dc_drm->pe; + struct dc_cf_priv *priv; + int ret; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg"); + if (IS_ERR(priv->reg_cfg)) + return PTR_ERR(priv->reg_cfg); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-cf-id", &priv->id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + switch (priv->id) { + case 0: + pe->cf_cont[0] = &priv->cf; + priv->link = LINK_ID_CONSTFRAME0; + break; + case 1: + pe->cf_cont[1] = &priv->cf; + priv->link = LINK_ID_CONSTFRAME1; + break; + case 4: + pe->cf_safe[0] = &priv->cf; + priv->link = LINK_ID_CONSTFRAME4; + break; + case 5: + pe->cf_safe[1] = &priv->cf; + priv->link = LINK_ID_CONSTFRAME5; + break; + } + + return 0; +} + +static const struct component_ops dc_cf_ops = { + .bind = dc_cf_bind, +}; + +static int dc_cf_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_cf_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_cf_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_cf_ops); +} + +static const struct of_device_id dc_cf_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-constframe", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_cf_dt_ids); + +struct platform_driver dc_cf_driver = { + .probe = dc_cf_probe, + .remove_new = dc_cf_remove, + .driver = { + .name = "imx8-dc-constframe", + .of_match_table = dc_cf_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-drv.c b/drivers/gpu/drm/imx/dc/dc-drv.c index e5910a82dd4d..7c64acc863ad 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.c +++ b/drivers/gpu/drm/imx/dc/dc-drv.c @@ -9,8 +9,14 @@ #include "dc-drv.h" static struct platform_driver * const dc_drivers[] = { + &dc_cf_driver, &dc_de_driver, + &dc_ed_driver, &dc_fg_driver, + &dc_fl_driver, + &dc_fw_driver, + &dc_lb_driver, + &dc_pe_driver, &dc_tc_driver, }; diff --git a/drivers/gpu/drm/imx/dc/dc-drv.h b/drivers/gpu/drm/imx/dc/dc-drv.h index e1290d9a0a99..c687a36b8153 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.h +++ b/drivers/gpu/drm/imx/dc/dc-drv.h @@ -11,14 +11,22 @@ #include #include "dc-de.h" +#include "dc-pe.h" struct dc_drm_device { struct drm_device base; struct dc_de *de[DC_DISPLAYS]; + struct dc_pe *pe; }; +extern struct platform_driver dc_cf_driver; +extern struct platform_driver dc_ed_driver; extern struct platform_driver dc_de_driver; extern struct platform_driver dc_fg_driver; +extern struct platform_driver dc_fl_driver; +extern struct platform_driver dc_fw_driver; +extern struct platform_driver dc_lb_driver; +extern struct platform_driver dc_pe_driver; extern struct platform_driver dc_tc_driver; #endif /* __DC_DRV_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-ed.c b/drivers/gpu/drm/imx/dc/dc-ed.c new file mode 100644 index 000000000000..ad9aafd92319 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-ed.c @@ -0,0 +1,267 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-drv.h" +#include "dc-pe.h" + +#define PIXENGCFG_STATIC 0x8 +#define POWERDOWN BIT(4) +#define SYNC_MODE BIT(8) +#define SINGLE 0 +#define DIV_MASK 0xff0000 +#define DIV(n) (((n) & 0xff) << 16) +#define DIV_RESET 0x80 + +#define PIXENGCFG_DYNAMIC 0xc + +#define PIXENGCFG_TRIGGER 0x14 +#define SYNC_TRIGGER BIT(0) + +#define STATICCONTROL 0x8 +#define KICK_MODE BIT(8) +#define EXTERNAL BIT(8) +#define PERFCOUNTMODE BIT(12) + +#define CONTROL 0xc +#define GAMMAAPPLYENABLE BIT(0) + +struct dc_ed_priv { + struct dc_ed ed; + void __iomem *reg_pec; + void __iomem *reg_cfg; + u32 id; +}; + +static const enum dc_link_id src_sels[] = { + LINK_ID_NONE, + LINK_ID_CONSTFRAME0, + LINK_ID_CONSTFRAME1, + LINK_ID_CONSTFRAME4, + LINK_ID_CONSTFRAME5, + LINK_ID_LAYERBLEND3, + LINK_ID_LAYERBLEND2, + LINK_ID_LAYERBLEND1, + LINK_ID_LAYERBLEND0, +}; + +static inline struct dc_ed_priv *to_ed_priv(struct dc_ed *ed) +{ + return container_of(ed, struct dc_ed_priv, ed); +} + +static inline u32 dc_pec_ed_read(struct dc_ed *ed, unsigned int offset) +{ + struct dc_ed_priv *priv = to_ed_priv(ed); + + return readl(priv->reg_pec + offset); +} + +static inline void +dc_pec_ed_write(struct dc_ed *ed, unsigned int offset, u32 value) +{ + struct dc_ed_priv *priv = to_ed_priv(ed); + + writel(value, priv->reg_pec + offset); +} + +static inline void +dc_pec_ed_write_mask(struct dc_ed *ed, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_pec_ed_read(ed, offset); + tmp &= ~mask; + dc_pec_ed_write(ed, offset, tmp | value); +} + +static inline u32 dc_ed_read(struct dc_ed *ed, unsigned int offset) +{ + struct dc_ed_priv *priv = to_ed_priv(ed); + + return readl(priv->reg_cfg + offset); +} + +static inline void dc_ed_write(struct dc_ed *ed, unsigned int offset, u32 value) +{ + struct dc_ed_priv *priv = to_ed_priv(ed); + + writel(value, priv->reg_cfg + offset); +} + +static inline void +dc_ed_write_mask(struct dc_ed *ed, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_ed_read(ed, offset); + tmp &= ~mask; + dc_ed_write(ed, offset, tmp | value); +} + +static void dc_ed_pec_enable_shden(struct dc_ed *ed) +{ + dc_pec_ed_write_mask(ed, PIXENGCFG_STATIC, SHDEN, SHDEN); +} + +static void dc_ed_pec_poweron(struct dc_ed *ed) +{ + dc_pec_ed_write_mask(ed, PIXENGCFG_STATIC, POWERDOWN, 0); +} + +static void dc_ed_pec_sync_mode_single(struct dc_ed *ed) +{ + dc_pec_ed_write_mask(ed, PIXENGCFG_STATIC, SYNC_MODE, SINGLE); +} + +static void dc_ed_pec_div_reset(struct dc_ed *ed) +{ + dc_pec_ed_write_mask(ed, PIXENGCFG_STATIC, DIV_MASK, DIV(DIV_RESET)); +} + +void dc_ed_pec_src_sel(struct dc_ed *ed, enum dc_link_id src) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(src_sels); i++) { + if (src_sels[i] == src) { + dc_pec_ed_write(ed, PIXENGCFG_DYNAMIC, src); + return; + } + } +} + +void dc_ed_pec_sync_trigger(struct dc_ed *ed) +{ + dc_pec_ed_write(ed, PIXENGCFG_TRIGGER, SYNC_TRIGGER); +} + +static void dc_ed_enable_shden(struct dc_ed *ed) +{ + dc_ed_write_mask(ed, STATICCONTROL, SHDEN, SHDEN); +} + +static void dc_ed_kick_mode_external(struct dc_ed *ed) +{ + dc_ed_write_mask(ed, STATICCONTROL, KICK_MODE, EXTERNAL); +} + +static void dc_ed_disable_perfcountmode(struct dc_ed *ed) +{ + dc_ed_write_mask(ed, STATICCONTROL, PERFCOUNTMODE, 0); +} + +static void dc_ed_disable_gamma_apply(struct dc_ed *ed) +{ + dc_ed_write_mask(ed, CONTROL, GAMMAAPPLYENABLE, 0); +} + +void dc_ed_init(struct dc_ed *ed) +{ + dc_ed_pec_src_sel(ed, LINK_ID_NONE); + dc_ed_pec_enable_shden(ed); + dc_ed_pec_poweron(ed); + dc_ed_pec_sync_mode_single(ed); + dc_ed_pec_div_reset(ed); + dc_ed_enable_shden(ed); + dc_ed_disable_perfcountmode(ed); + dc_ed_kick_mode_external(ed); + dc_ed_disable_gamma_apply(ed); +} + +static int dc_ed_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_pe *pe = dc_drm->pe; + struct dc_ed_priv *priv; + int ret; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg_pec = devm_platform_ioremap_resource_byname(pdev, "pec"); + if (IS_ERR(priv->reg_pec)) + return PTR_ERR(priv->reg_pec); + + priv->reg_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg"); + if (IS_ERR(priv->reg_cfg)) + return PTR_ERR(priv->reg_cfg); + + priv->ed.irq_shdld = platform_get_irq_byname(pdev, "shdload"); + if (priv->ed.irq_shdld < 0) + return priv->ed.irq_shdld; + + ret = of_property_read_u32(dev->of_node, "fsl,dc-ed-id", &priv->id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + priv->ed.dev = dev; + + switch (priv->id) { + case 0: + pe->ed_cont[0] = &priv->ed; + break; + case 1: + pe->ed_cont[1] = &priv->ed; + break; + case 4: + pe->ed_safe[0] = &priv->ed; + break; + case 5: + pe->ed_safe[1] = &priv->ed; + break; + } + + return 0; +} + +static const struct component_ops dc_ed_ops = { + .bind = dc_ed_bind, +}; + +static int dc_ed_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_ed_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_ed_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_ed_ops); +} + +static const struct of_device_id dc_ed_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-extdst", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_ed_dt_ids); + +struct platform_driver dc_ed_driver = { + .probe = dc_ed_probe, + .remove_new = dc_ed_remove, + .driver = { + .name = "imx8-dc-extdst", + .of_match_table = dc_ed_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-fl.c b/drivers/gpu/drm/imx/dc/dc-fl.c new file mode 100644 index 000000000000..c6b46595c864 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-fl.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "dc-drv.h" +#include "dc-fu.h" +#include "dc-pe.h" + +#define FRAMEDIMENSIONS 0x150 + +struct dc_fl { + struct dc_fu fu; + u32 id; +}; + +static void +dc_fl_set_fmt(struct dc_fu *fu, const struct drm_format_info *format) +{ + u32 bits = 0, shifts = 0; + + dc_fu_set_src_bpp(fu, format->cpp[0] * 8); + + dc_fu_write_mask(fu, LAYERPROPERTY(fu), YUVCONVERSIONMODE_MASK, + YUVCONVERSIONMODE(YUVCONVERSIONMODE_OFF)); + + dc_fu_get_pixel_format_bits(fu, format->format, &bits); + dc_fu_get_pixel_format_shifts(fu, format->format, &shifts); + + dc_fu_write(fu, COLORCOMPONENTBITS(fu), bits); + dc_fu_write(fu, COLORCOMPONENTSHIFT(fu), shifts); +} + +static void dc_fl_set_framedimensions(struct dc_fu *fu, int w, int h) +{ + dc_fu_write(fu, FRAMEDIMENSIONS, FRAMEWIDTH(w) | FRAMEHEIGHT(h)); +} + +static void dc_fl_init(struct dc_fu *fu) +{ + dc_fu_common_hw_init(fu); + dc_fu_shdldreq_sticky(fu, 0xff); +} + +static void dc_fl_set_ops(struct dc_fu *fu) +{ + memcpy(&fu->ops, &dc_fu_common_ops, sizeof(dc_fu_common_ops)); + fu->ops.init = dc_fl_init; + fu->ops.set_fmt = dc_fl_set_fmt; + fu->ops.set_framedimensions = dc_fl_set_framedimensions; +} + +static int dc_fl_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_pe *pe = dc_drm->pe; + struct dc_fl *fl; + struct dc_fu *fu; + int ret; + + fl = drmm_kzalloc(&dc_drm->base, sizeof(*fl), GFP_KERNEL); + if (!fl) + return -ENOMEM; + + fu = &fl->fu; + + fu->reg_pec = devm_platform_ioremap_resource_byname(pdev, "pec"); + if (IS_ERR(fu->reg_pec)) + return PTR_ERR(fu->reg_pec); + + fu->reg_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg"); + if (IS_ERR(fu->reg_cfg)) + return PTR_ERR(fu->reg_cfg); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-fl-id", &fl->id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + fu->link_id = LINK_ID_FETCHLAYER0; + fu->id = DC_FETCHUNIT_FL0; + fu->sub_id = 0; + snprintf(fu->name, sizeof(fu->name), "FetchLayer%u", fl->id); + + dc_fl_set_ops(fu); + + pe->fu_disp[fu->id] = fu; + + return 0; +} + +static const struct component_ops dc_fl_ops = { + .bind = dc_fl_bind, +}; + +static int dc_fl_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_fl_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_fl_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_fl_ops); +} + +static const struct of_device_id dc_fl_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-fetchlayer", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_fl_dt_ids); + +struct platform_driver dc_fl_driver = { + .probe = dc_fl_probe, + .remove_new = dc_fl_remove, + .driver = { + .name = "imx8-dc-fetchlayer", + .of_match_table = dc_fl_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-fu.c b/drivers/gpu/drm/imx/dc/dc-fu.c new file mode 100644 index 000000000000..88793b2366fe --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-fu.c @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include + +#include "dc-fu.h" +#include "dc-pe.h" + +#define STATICCONTROL 0x8 +#define SHDLDREQSTICKY(lm) (((lm) & 0xff) << 24) +#define SHDLDREQSTICKY_MASK (0xff << 24) +#define BASEADDRESSAUTOUPDATE(lm) (((lm) & 0xff) << 16) +#define BASEADDRESSAUTOUPDATE_MASK (0xff << 16) + +#define BURSTBUFFERMANAGEMENT 0xc +#define SETBURSTLENGTH(n) (((n) & 0x1f) << 8) +#define SETBURSTLENGTH_MASK 0x1f00 +#define SETNUMBUFFERS(n) ((n) & 0xff) +#define SETNUMBUFFERS_MASK 0xff +#define LINEMODE_MASK 0x80000000 +#define LINEMODE_SHIFT 31 + +#define BASEADDRESS(fu) (0x10 + SUBID_OFFSET + REG_OFFSET) + +#define SOURCEBUFFERATTRIBUTES(fu) (0x14 + SUBID_OFFSET + REG_OFFSET) +#define BITSPERPIXEL_MASK 0x3f0000 +#define BITSPERPIXEL(bpp) (((bpp) & 0x3f) << 16) +#define STRIDE_MASK 0xffff +#define STRIDE(n) (((n) - 1) & 0xffff) + +#define LAYEROFFSET(fu) (0x24 + SUBID_OFFSET + REG_OFFSET) +#define LAYERXOFFSET(x) ((x) & 0x7fff) +#define LAYERYOFFSET(y) (((y) & 0x7fff) << 16) + +#define CLIPWINDOWOFFSET(fu) (0x28 + SUBID_OFFSET + REG_OFFSET) +#define CLIPWINDOWXOFFSET(x) ((x) & 0x7fff) +#define CLIPWINDOWYOFFSET(y) (((y) & 0x7fff) << 16) + +#define CLIPWINDOWDIMENSIONS(fu) (0x2c + SUBID_OFFSET + REG_OFFSET) +#define CLIPWINDOWWIDTH(w) (((w) - 1) & 0x3fff) +#define CLIPWINDOWHEIGHT(h) ((((h) - 1) & 0x3fff) << 16) + +#define CONSTANTCOLOR(fu) (0x30 + SUBID_OFFSET + REG_OFFSET) + +enum dc_linemode { + /* + * Mandatory setting for operation in the Display Controller. + * Works also for Blit Engine with marginal performance impact. + */ + LINEMODE_DISPLAY = 0, +}; + +struct dc_fu_pixel_format { + u32 pixel_format; + u32 bits; + u32 shifts; +}; + +static const struct dc_fu_pixel_format pixel_formats[] = { + { + DRM_FORMAT_XRGB8888, + R_BITS(8) | G_BITS(8) | B_BITS(8) | A_BITS(0), + R_SHIFT(16) | G_SHIFT(8) | B_SHIFT(0) | A_SHIFT(0), + }, +}; + +void dc_fu_get_pixel_format_bits(struct dc_fu *fu, u32 format, u32 *bits) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) { + if (pixel_formats[i].pixel_format == format) { + *bits = pixel_formats[i].bits; + return; + } + } +} + +void +dc_fu_get_pixel_format_shifts(struct dc_fu *fu, u32 format, u32 *shifts) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) { + if (pixel_formats[i].pixel_format == format) { + *shifts = pixel_formats[i].shifts; + return; + } + } +} + +static void dc_fu_enable_shden(struct dc_fu *fu) +{ + dc_fu_write_mask(fu, STATICCONTROL, SHDEN, SHDEN); +} + +static void dc_fu_baddr_autoupdate(struct dc_fu *fu, u8 layer_mask) +{ + dc_fu_write_mask(fu, STATICCONTROL, BASEADDRESSAUTOUPDATE_MASK, + BASEADDRESSAUTOUPDATE(layer_mask)); +} + +void dc_fu_shdldreq_sticky(struct dc_fu *fu, u8 layer_mask) +{ + dc_fu_write_mask(fu, STATICCONTROL, SHDLDREQSTICKY_MASK, + SHDLDREQSTICKY(layer_mask)); +} + +static void dc_fu_set_linemode(struct dc_fu *fu, enum dc_linemode mode) +{ + dc_fu_write_mask(fu, BURSTBUFFERMANAGEMENT, LINEMODE_MASK, mode); +} + +static void dc_fu_set_numbuffers(struct dc_fu *fu, unsigned int num) +{ + dc_fu_write_mask(fu, BURSTBUFFERMANAGEMENT, SETNUMBUFFERS_MASK, + SETNUMBUFFERS(num)); +} + +static void dc_fu_set_burstlength(struct dc_fu *fu, dma_addr_t baddr) +{ + unsigned int burst_size, burst_length; + + burst_size = 1 << __ffs(baddr); + burst_size = round_up(burst_size, 8); + burst_size = min(burst_size, 128U); + burst_length = burst_size / 8; + + dc_fu_write_mask(fu, BURSTBUFFERMANAGEMENT, SETBURSTLENGTH_MASK, + SETBURSTLENGTH(burst_length)); +} + +static void dc_fu_set_baseaddress(struct dc_fu *fu, dma_addr_t baddr) +{ + dc_fu_write(fu, BASEADDRESS(fu), baddr); +} + +void dc_fu_set_src_bpp(struct dc_fu *fu, unsigned int bpp) +{ + dc_fu_write_mask(fu, SOURCEBUFFERATTRIBUTES(fu), BITSPERPIXEL_MASK, + BITSPERPIXEL(bpp)); +} + +static void dc_fu_set_src_stride(struct dc_fu *fu, unsigned int stride) +{ + dc_fu_write_mask(fu, SOURCEBUFFERATTRIBUTES(fu), STRIDE_MASK, + STRIDE(stride)); +} + +static void dc_fu_set_src_buf_dimensions(struct dc_fu *fu, int w, int h) +{ + dc_fu_write(fu, SOURCEBUFFERDIMENSION(fu), LINEWIDTH(w) | LINECOUNT(h)); +} + +static void dc_fu_layeroffset(struct dc_fu *fu, unsigned int x, unsigned int y) +{ + dc_fu_write(fu, LAYEROFFSET(fu), LAYERXOFFSET(x) | LAYERYOFFSET(y)); +} + +static void dc_fu_clipoffset(struct dc_fu *fu, unsigned int x, unsigned int y) +{ + dc_fu_write(fu, CLIPWINDOWOFFSET(fu), + CLIPWINDOWXOFFSET(x) | CLIPWINDOWYOFFSET(y)); +} + +static void +dc_fu_clipdimensions(struct dc_fu *fu, unsigned int w, unsigned int h) +{ + dc_fu_write(fu, CLIPWINDOWDIMENSIONS(fu), + CLIPWINDOWWIDTH(w) | CLIPWINDOWHEIGHT(h)); +} + +static void dc_fu_set_pixel_blend_mode(struct dc_fu *fu) +{ + dc_fu_write(fu, LAYERPROPERTY(fu), 0); + dc_fu_write(fu, CONSTANTCOLOR(fu), 0); +} + +static void dc_fu_enable_src_buf(struct dc_fu *fu) +{ + dc_fu_write_mask(fu, LAYERPROPERTY(fu), SOURCEBUFFERENABLE, + SOURCEBUFFERENABLE); +} + +static void dc_fu_disable_src_buf(struct dc_fu *fu) +{ + dc_fu_write_mask(fu, LAYERPROPERTY(fu), SOURCEBUFFERENABLE, 0); + + if (fu->lb) { + dc_lb_pec_clken(fu->lb, CLKEN_DISABLE); + dc_lb_mode(fu->lb, LB_NEUTRAL); + } +} + +static void dc_fu_set_layerblend(struct dc_fu *fu, struct dc_lb *lb) +{ + fu->lb = lb; +} + +static enum dc_link_id dc_fu_get_link_id(struct dc_fu *fu) +{ + return fu->link_id; +} + +static const char *dc_fu_get_name(struct dc_fu *fu) +{ + return fu->name; +} + +const struct dc_fu_ops dc_fu_common_ops = { + .set_burstlength = dc_fu_set_burstlength, + .set_baseaddress = dc_fu_set_baseaddress, + .set_src_stride = dc_fu_set_src_stride, + .set_src_buf_dimensions = dc_fu_set_src_buf_dimensions, + .enable_src_buf = dc_fu_enable_src_buf, + .disable_src_buf = dc_fu_disable_src_buf, + .set_layerblend = dc_fu_set_layerblend, + .get_link_id = dc_fu_get_link_id, + .get_name = dc_fu_get_name, +}; + +const struct dc_fu_ops *dc_fu_get_ops(struct dc_fu *fu) +{ + return &fu->ops; +} + +void dc_fu_common_hw_init(struct dc_fu *fu) +{ + dc_fu_baddr_autoupdate(fu, 0x0); + dc_fu_enable_shden(fu); + dc_fu_set_linemode(fu, LINEMODE_DISPLAY); + dc_fu_layeroffset(fu, 0x0, 0x0); + dc_fu_clipoffset(fu, 0x0, 0x0); + dc_fu_clipdimensions(fu, 0x0, 0x0); + dc_fu_set_numbuffers(fu, 16); + dc_fu_disable_src_buf(fu); + dc_fu_set_pixel_blend_mode(fu); +} diff --git a/drivers/gpu/drm/imx/dc/dc-fu.h b/drivers/gpu/drm/imx/dc/dc-fu.h new file mode 100644 index 000000000000..c7c84db85d87 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-fu.h @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_FETCHUNIT_H__ +#define __DC_FETCHUNIT_H__ + +#include +#include + +#include + +#include "dc-pe.h" + +#define REG_OFFSET ((fu)->reg_offset) +#define SUBID_OFFSET (((fu)->sub_id) * 0x28) + +#define SOURCEBUFFERDIMENSION(fu) (0x18 + SUBID_OFFSET + REG_OFFSET) +#define LINEWIDTH(w) (((w) - 1) & 0x3fff) +#define LINECOUNT(h) ((((h) - 1) & 0x3fff) << 16) + +#define COLORCOMPONENTBITS(fu) (0x1c + SUBID_OFFSET + REG_OFFSET) +#define R_BITS(n) (((n) & 0xf) << 24) +#define G_BITS(n) (((n) & 0xf) << 16) +#define B_BITS(n) (((n) & 0xf) << 8) +#define A_BITS(n) ((n) & 0xf) + +#define COLORCOMPONENTSHIFT(fu) (0x20 + SUBID_OFFSET + REG_OFFSET) +#define R_SHIFT(n) (((n) & 0x1f) << 24) +#define G_SHIFT(n) (((n) & 0x1f) << 16) +#define B_SHIFT(n) (((n) & 0x1f) << 8) +#define A_SHIFT(n) ((n) & 0x1f) + +#define LAYERPROPERTY(fu) (0x34 + SUBID_OFFSET + REG_OFFSET) +#define YUVCONVERSIONMODE_MASK 0x60000 +#define YUVCONVERSIONMODE(m) (((m) & 0x3) << 17) +#define SOURCEBUFFERENABLE BIT(31) +#define FRAMEWIDTH(w) (((w) - 1) & 0x3fff) +#define FRAMEHEIGHT(h) ((((h) - 1) & 0x3fff) << 16) +#define INPUTSELECT_MASK 0x18 +#define INPUTSELECT(s) (((s) & 0x3) << 3) +#define RASTERMODE_MASK 0x7 +#define RASTERMODE(m) ((m) & 0x7) + +enum dc_yuvconversionmode { + YUVCONVERSIONMODE_OFF, +}; + +enum dc_inputselect { + INPUTSELECT_INACTIVE, +}; + +enum dc_rastermode { + RASTERMODE_NORMAL, +}; + +enum { + DC_FETCHUNIT_FL0, + DC_FETCHUNIT_FW2, +}; + +struct dc_fu; +struct dc_lb; + +struct dc_fu_ops { + void (*init)(struct dc_fu *fu); + void (*set_burstlength)(struct dc_fu *fu, dma_addr_t baddr); + void (*set_baseaddress)(struct dc_fu *fu, dma_addr_t baddr); + void (*set_src_stride)(struct dc_fu *fu, unsigned int stride); + void (*set_src_buf_dimensions)(struct dc_fu *fu, int w, int h); + void (*set_fmt)(struct dc_fu *fu, const struct drm_format_info *format); + void (*enable_src_buf)(struct dc_fu *fu); + void (*disable_src_buf)(struct dc_fu *fu); + void (*set_framedimensions)(struct dc_fu *fu, int w, int h); + void (*set_layerblend)(struct dc_fu *fu, struct dc_lb *lb); + enum dc_link_id (*get_link_id)(struct dc_fu *fu); + const char *(*get_name)(struct dc_fu *fu); +}; + +struct dc_fu { + void __iomem *reg_pec; + void __iomem *reg_cfg; + char name[13]; + unsigned int reg_offset; + unsigned int id; + unsigned int sub_id; /* for fractional fetch units */ + enum dc_link_id link_id; + struct dc_fu_ops ops; + struct dc_lb *lb; +}; + +extern const struct dc_fu_ops dc_fu_common_ops; + +static inline void +dc_pec_fu_write(struct dc_fu *fu, unsigned int offset, u32 value) +{ + writel(value, fu->reg_pec + offset); +} + +static inline u32 dc_fu_read(struct dc_fu *fu, unsigned int offset) +{ + return readl(fu->reg_cfg + offset); +} + +static inline void dc_fu_write(struct dc_fu *fu, unsigned int offset, u32 value) +{ + writel(value, fu->reg_cfg + offset); +} + +static inline void +dc_fu_write_mask(struct dc_fu *fu, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_fu_read(fu, offset); + tmp &= ~mask; + dc_fu_write(fu, offset, tmp | value); +} + +void dc_fu_get_pixel_format_bits(struct dc_fu *fu, u32 format, u32 *bits); +void dc_fu_get_pixel_format_shifts(struct dc_fu *fu, u32 format, u32 *shifts); +void dc_fu_shdldreq_sticky(struct dc_fu *fu, u8 layer_mask); +void dc_fu_set_src_bpp(struct dc_fu *fu, unsigned int bpp); +void dc_fu_common_hw_init(struct dc_fu *fu); + +const struct dc_fu_ops *dc_fu_get_ops(struct dc_fu *fu); + +#endif /* __DC_FETCHUNIT_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-fw.c b/drivers/gpu/drm/imx/dc/dc-fw.c new file mode 100644 index 000000000000..77258e59a7af --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-fw.c @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "dc-drv.h" +#include "dc-fu.h" +#include "dc-pe.h" + +#define PIXENGCFG_DYNAMIC 0x8 + +#define FRAMEDIMENSIONS 0x150 +#define CONTROL 0x170 + +struct dc_fw { + struct dc_fu fu; + u32 id; +}; + +static void +dc_fw_set_fmt(struct dc_fu *fu, const struct drm_format_info *format) +{ + u32 val, bits = 0, shifts = 0; + + dc_fu_set_src_bpp(fu, format->cpp[0] * 8); + + val = dc_fu_read(fu, CONTROL); + val &= ~INPUTSELECT_MASK; + val &= ~RASTERMODE_MASK; + val |= INPUTSELECT(INPUTSELECT_INACTIVE); + val |= RASTERMODE(RASTERMODE_NORMAL); + dc_fu_write(fu, CONTROL, val); + + val = dc_fu_read(fu, LAYERPROPERTY(fu)); + val &= ~YUVCONVERSIONMODE_MASK; + val |= YUVCONVERSIONMODE(YUVCONVERSIONMODE_OFF); + dc_fu_write(fu, LAYERPROPERTY(fu), val); + + dc_fu_get_pixel_format_bits(fu, format->format, &bits); + dc_fu_get_pixel_format_shifts(fu, format->format, &shifts); + + dc_fu_write(fu, COLORCOMPONENTBITS(fu), bits); + dc_fu_write(fu, COLORCOMPONENTSHIFT(fu), shifts); +} + +static void dc_fw_set_framedimensions(struct dc_fu *fu, int w, int h) +{ + dc_fu_write(fu, FRAMEDIMENSIONS, FRAMEWIDTH(w) | FRAMEHEIGHT(h)); +} + +static void dc_fw_init(struct dc_fu *fu) +{ + dc_pec_fu_write(fu, PIXENGCFG_DYNAMIC, LINK_ID_NONE); + dc_fu_common_hw_init(fu); + dc_fu_shdldreq_sticky(fu, 0xff); +} + +static void dc_fw_set_ops(struct dc_fu *fu) +{ + memcpy(&fu->ops, &dc_fu_common_ops, sizeof(dc_fu_common_ops)); + fu->ops.init = dc_fw_init; + fu->ops.set_fmt = dc_fw_set_fmt; + fu->ops.set_framedimensions = dc_fw_set_framedimensions; +} + +static int dc_fw_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_pe *pe = dc_drm->pe; + struct dc_fw *fw; + struct dc_fu *fu; + int ret; + + fw = drmm_kzalloc(&dc_drm->base, sizeof(*fw), GFP_KERNEL); + if (!fw) + return -ENOMEM; + + fu = &fw->fu; + + fu->reg_pec = devm_platform_ioremap_resource_byname(pdev, "pec"); + if (IS_ERR(fu->reg_pec)) + return PTR_ERR(fu->reg_pec); + + fu->reg_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg"); + if (IS_ERR(fu->reg_cfg)) + return PTR_ERR(fu->reg_cfg); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-fw-id", &fw->id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + fu->link_id = LINK_ID_FETCHWARP2; + fu->id = DC_FETCHUNIT_FW2; + fu->sub_id = 0; + snprintf(fu->name, sizeof(fu->name), "FetchWarp%u", fw->id); + + dc_fw_set_ops(fu); + + pe->fu_disp[fu->id] = fu; + + return 0; +} + +static const struct component_ops dc_fw_ops = { + .bind = dc_fw_bind, +}; + +static int dc_fw_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_fw_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_fw_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_fw_ops); +} + +static const struct of_device_id dc_fw_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-fetchwarp", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_fw_dt_ids); + +struct platform_driver dc_fw_driver = { + .probe = dc_fw_probe, + .remove_new = dc_fw_remove, + .driver = { + .name = "imx8-dc-fetchwarp", + .of_match_table = dc_fw_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-lb.c b/drivers/gpu/drm/imx/dc/dc-lb.c new file mode 100644 index 000000000000..cd98777f68d1 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-lb.c @@ -0,0 +1,301 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "dc-drv.h" +#include "dc-pe.h" + +#define PIXENGCFG_DYNAMIC 0x8 +#define PIXENGCFG_DYNAMIC_PRIM_SEL_MASK 0x3f +#define PIXENGCFG_DYNAMIC_SEC_SEL_SHIFT 8 +#define PIXENGCFG_DYNAMIC_SEC_SEL_MASK 0x3f00 + +#define STATICCONTROL 0x8 +#define SHDTOKSEL_MASK 0x18 +#define SHDTOKSEL(n) ((n) << 3) +#define SHDLDSEL_MASK 0x6 +#define SHDLDSEL(n) ((n) << 1) + +#define CONTROL 0xc +#define CTRL_MODE_MASK BIT(0) + +#define BLENDCONTROL 0x10 +#define ALPHA(a) (((a) & 0xff) << 16) +#define PRIM_C_BLD_FUNC__ZERO 0x0 +#define SEC_C_BLD_FUNC__CONST_ALPHA (0x6 << 4) +#define PRIM_A_BLD_FUNC__ZERO (0x0 << 8) +#define SEC_A_BLD_FUNC__ZERO (0x0 << 12) + +#define POSITION 0x14 +#define XPOS(x) ((x) & 0x7fff) +#define YPOS(y) (((y) & 0x7fff) << 16) + +struct dc_lb_priv { + struct dc_lb lb; + void __iomem *reg_pec; + void __iomem *reg_cfg; + enum dc_link_id link; +}; + +enum dc_lb_shadow_sel { + BOTH = 0x2, +}; + +static const enum dc_link_id lb_links[] = { + LINK_ID_LAYERBLEND0, + LINK_ID_LAYERBLEND1, + LINK_ID_LAYERBLEND2, + LINK_ID_LAYERBLEND3, +}; + +static const enum dc_link_id prim_sels[] = { + /* common options */ + LINK_ID_NONE, + LINK_ID_CONSTFRAME0, + LINK_ID_CONSTFRAME1, + LINK_ID_CONSTFRAME4, + LINK_ID_CONSTFRAME5, + /* + * special options: + * layerblend(n) has n special options, + * from layerblend0 to layerblend(n - 1), e.g., + * layerblend3 has 3 special options - + * layerblend0/1/2. + */ + LINK_ID_LAYERBLEND0, + LINK_ID_LAYERBLEND1, + LINK_ID_LAYERBLEND2, + LINK_ID_LAYERBLEND3, +}; + +static const enum dc_link_id sec_sels[] = { + LINK_ID_NONE, + LINK_ID_FETCHWARP2, + LINK_ID_FETCHLAYER0, +}; + +static inline struct dc_lb_priv *to_lb_priv(struct dc_lb *lb) +{ + return container_of(lb, struct dc_lb_priv, lb); +} + +static inline u32 dc_pec_lb_read(struct dc_lb *lb, unsigned int offset) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + + return readl(priv->reg_pec + offset); +} + +static inline void +dc_pec_lb_write(struct dc_lb *lb, unsigned int offset, u32 value) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + + writel(value, priv->reg_pec + offset); +} + +static inline void +dc_pec_lb_write_mask(struct dc_lb *lb, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_pec_lb_read(lb, offset); + tmp &= ~mask; + dc_pec_lb_write(lb, offset, tmp | value); +} + +static inline u32 dc_lb_read(struct dc_lb *lb, unsigned int offset) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + + return readl(priv->reg_cfg + offset); +} + +static inline void dc_lb_write(struct dc_lb *lb, unsigned int offset, u32 value) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + + writel(value, priv->reg_cfg + offset); +} + +static inline void +dc_lb_write_mask(struct dc_lb *lb, unsigned int offset, u32 mask, u32 value) +{ + u32 tmp; + + tmp = dc_lb_read(lb, offset); + tmp &= ~mask; + dc_lb_write(lb, offset, tmp | value); +} + +enum dc_link_id dc_lb_get_link_id(struct dc_lb *lb) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + + return priv->link; +} + +void dc_lb_pec_dynamic_prim_sel(struct dc_lb *lb, enum dc_link_id prim) +{ + struct dc_lb_priv *priv = to_lb_priv(lb); + int fixed_sels_num = ARRAY_SIZE(prim_sels) - 4; + int i; + + for (i = 0; i < fixed_sels_num + priv->lb.id; i++) { + if (prim_sels[i] == prim) { + dc_pec_lb_write_mask(lb, PIXENGCFG_DYNAMIC, + PIXENGCFG_DYNAMIC_PRIM_SEL_MASK, + prim); + return; + } + } +} + +void dc_lb_pec_dynamic_sec_sel(struct dc_lb *lb, enum dc_link_id sec) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(sec_sels); i++) { + if (sec_sels[i] == sec) { + dc_pec_lb_write_mask(lb, PIXENGCFG_DYNAMIC, + PIXENGCFG_DYNAMIC_SEC_SEL_MASK, + sec << PIXENGCFG_DYNAMIC_SEC_SEL_SHIFT); + return; + } + } +} + +void dc_lb_pec_clken(struct dc_lb *lb, enum dc_pec_clken clken) +{ + dc_pec_lb_write_mask(lb, PIXENGCFG_DYNAMIC, CLKEN_MASK, CLKEN(clken)); +} + +static void dc_lb_enable_shden(struct dc_lb *lb) +{ + dc_lb_write_mask(lb, STATICCONTROL, SHDEN, SHDEN); +} + +static void dc_lb_shdtoksel(struct dc_lb *lb, enum dc_lb_shadow_sel sel) +{ + dc_lb_write_mask(lb, STATICCONTROL, SHDTOKSEL_MASK, SHDTOKSEL(sel)); +} + +static void dc_lb_shdldsel(struct dc_lb *lb, enum dc_lb_shadow_sel sel) +{ + dc_lb_write_mask(lb, STATICCONTROL, SHDLDSEL_MASK, SHDLDSEL(sel)); +} + +void dc_lb_mode(struct dc_lb *lb, enum dc_lb_mode mode) +{ + dc_lb_write_mask(lb, CONTROL, CTRL_MODE_MASK, mode); +} + +void dc_lb_blendcontrol(struct dc_lb *lb) +{ + u32 val = PRIM_A_BLD_FUNC__ZERO | SEC_A_BLD_FUNC__ZERO | + PRIM_C_BLD_FUNC__ZERO | SEC_C_BLD_FUNC__CONST_ALPHA | + ALPHA(DRM_BLEND_ALPHA_OPAQUE >> 8); + + dc_lb_write(lb, BLENDCONTROL, val); +} + +void dc_lb_position(struct dc_lb *lb, int x, int y) +{ + dc_lb_write(lb, POSITION, XPOS(x) | YPOS(y)); +} + +unsigned int dc_lb_get_id(struct dc_lb *lb) +{ + return lb->id; +} + +void dc_lb_init(struct dc_lb *lb) +{ + dc_lb_pec_dynamic_prim_sel(lb, LINK_ID_NONE); + dc_lb_pec_dynamic_sec_sel(lb, LINK_ID_NONE); + dc_lb_pec_clken(lb, CLKEN_DISABLE); + dc_lb_shdldsel(lb, BOTH); + dc_lb_shdtoksel(lb, BOTH); + dc_lb_enable_shden(lb); +} + +static int dc_lb_bind(struct device *dev, struct device *master, void *data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = data; + struct dc_pe *pe = dc_drm->pe; + struct dc_lb_priv *priv; + int ret; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->reg_pec = devm_platform_ioremap_resource_byname(pdev, "pec"); + if (IS_ERR(priv->reg_pec)) + return PTR_ERR(priv->reg_pec); + + priv->reg_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg"); + if (IS_ERR(priv->reg_cfg)) + return PTR_ERR(priv->reg_cfg); + + ret = of_property_read_u32(dev->of_node, "fsl,dc-lb-id", &priv->lb.id); + if (ret) { + dev_err(dev, "failed to get instance number: %d\n", ret); + return ret; + } + + priv->link = lb_links[priv->lb.id]; + + pe->lb[priv->lb.id] = &priv->lb; + + return 0; +} + +static const struct component_ops dc_lb_ops = { + .bind = dc_lb_bind, +}; + +static int dc_lb_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_lb_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_lb_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_lb_ops); +} + +static const struct of_device_id dc_lb_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-layerblend", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_lb_dt_ids); + +struct platform_driver dc_lb_driver = { + .probe = dc_lb_probe, + .remove_new = dc_lb_remove, + .driver = { + .name = "imx8-dc-layerblend", + .of_match_table = dc_lb_dt_ids, + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-pe.c b/drivers/gpu/drm/imx/dc/dc-pe.c new file mode 100644 index 000000000000..a20a5adab231 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-pe.c @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-drv.h" +#include "dc-fu.h" +#include "dc-pe.h" + +struct dc_pe_priv { + struct dc_pe engine; + struct clk *clk_axi; +}; + +static int dc_pe_bind(struct device *dev, struct device *master, void *data) +{ + struct dc_drm_device *dc_drm = data; + struct dc_pe_priv *priv; + int ret; + + priv = drmm_kzalloc(&dc_drm->base, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->clk_axi = devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk_axi)) + return dev_err_probe(dev, PTR_ERR(priv->clk_axi), + "failed to get AXI clock\n"); + + priv->engine.dev = dev; + + dev_set_drvdata(dev, priv); + + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; + + dc_drm->pe = &priv->engine; + + return 0; +} + +static const struct component_ops dc_pe_ops = { + .bind = dc_pe_bind, +}; + +static int dc_pe_probe(struct platform_device *pdev) +{ + int ret; + + ret = devm_of_platform_populate(&pdev->dev); + if (ret < 0) + return ret; + + ret = component_add(&pdev->dev, &dc_pe_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_pe_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_pe_ops); +} + +static int dc_pe_runtime_suspend(struct device *dev) +{ + struct dc_pe_priv *priv = dev_get_drvdata(dev); + + clk_disable_unprepare(priv->clk_axi); + + return 0; +} + +static int dc_pe_runtime_resume(struct device *dev) +{ + struct dc_pe_priv *priv = dev_get_drvdata(dev); + struct dc_pe *engine = &priv->engine; + int i, ret; + + ret = clk_prepare_enable(priv->clk_axi); + if (ret) { + dev_err(dev, "failed to enable AXI clock: %d\n", ret); + return ret; + } + + for (i = 0; i < ARRAY_SIZE(engine->cf_safe); i++) + dc_cf_init(engine->cf_safe[i]); + + for (i = 0; i < ARRAY_SIZE(engine->cf_cont); i++) + dc_cf_init(engine->cf_cont[i]); + + for (i = 0; i < ARRAY_SIZE(engine->ed_safe); i++) + dc_ed_init(engine->ed_safe[i]); + + for (i = 0; i < ARRAY_SIZE(engine->ed_cont); i++) + dc_ed_init(engine->ed_cont[i]); + + for (i = 0; i < ARRAY_SIZE(engine->fu_disp); i++) + engine->fu_disp[i]->ops.init(engine->fu_disp[i]); + + for (i = 0; i < ARRAY_SIZE(engine->lb); i++) + dc_lb_init(engine->lb[i]); + + return 0; +} + +static const struct dev_pm_ops dc_pe_pm_ops = { + RUNTIME_PM_OPS(dc_pe_runtime_suspend, dc_pe_runtime_resume, NULL) +}; + +static const struct of_device_id dc_pe_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-pixel-engine", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_pe_dt_ids); + +struct platform_driver dc_pe_driver = { + .probe = dc_pe_probe, + .remove_new = dc_pe_remove, + .driver = { + .name = "imx8-dc-pixel-engine", + .of_match_table = dc_pe_dt_ids, + .pm = pm_sleep_ptr(&dc_pe_pm_ops), + }, +}; diff --git a/drivers/gpu/drm/imx/dc/dc-pe.h b/drivers/gpu/drm/imx/dc/dc-pe.h new file mode 100644 index 000000000000..82fee7fe112d --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-pe.h @@ -0,0 +1,91 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_PIXEL_ENGINE_H__ +#define __DC_PIXEL_ENGINE_H__ + +#include + +#include "dc-de.h" + +#define SHDEN BIT(0) + +#define CLKEN_MASK_SHIFT 24 +#define CLKEN_MASK (0x3 << CLKEN_MASK_SHIFT) +#define CLKEN(n) ((n) << CLKEN_MASK_SHIFT) + +#define DC_DISP_FETCHUNIT_CNT 2 +#define DC_LAYERBLEND_CNT 4 + +enum dc_link_id { + LINK_ID_NONE = 0x00, + LINK_ID_CONSTFRAME0 = 0x0c, + LINK_ID_CONSTFRAME4 = 0x0e, + LINK_ID_CONSTFRAME1 = 0x10, + LINK_ID_CONSTFRAME5 = 0x12, + LINK_ID_FETCHWARP2 = 0x14, + LINK_ID_FETCHLAYER0 = 0x1a, + LINK_ID_LAYERBLEND0 = 0x21, + LINK_ID_LAYERBLEND1 = 0x22, + LINK_ID_LAYERBLEND2 = 0x23, + LINK_ID_LAYERBLEND3 = 0x24, +}; + +enum dc_lb_mode { + LB_NEUTRAL, /* Output is same as primary input. */ + LB_BLEND, +}; + +enum dc_pec_clken { + CLKEN_DISABLE, + CLKEN_AUTOMATIC, +}; + +struct dc_cf { +}; + +struct dc_ed { + struct device *dev; + int irq_shdld; +}; + +struct dc_lb { + int id; +}; + +struct dc_pe { + struct device *dev; + struct dc_cf *cf_safe[DC_DISPLAYS]; + struct dc_cf *cf_cont[DC_DISPLAYS]; + struct dc_ed *ed_safe[DC_DISPLAYS]; + struct dc_ed *ed_cont[DC_DISPLAYS]; + struct dc_fu *fu_disp[DC_DISP_FETCHUNIT_CNT]; + struct dc_lb *lb[DC_LAYERBLEND_CNT]; +}; + +/* Constant Frame Unit */ +enum dc_link_id dc_cf_get_link_id(struct dc_cf *cf); +void dc_cf_framedimensions(struct dc_cf *cf, unsigned int w, unsigned int h); +void dc_cf_constantcolor_black(struct dc_cf *cf); +void dc_cf_constantcolor_blue(struct dc_cf *cf); +void dc_cf_init(struct dc_cf *cf); + +/* External Destination Unit */ +void dc_ed_pec_src_sel(struct dc_ed *ed, enum dc_link_id src); +void dc_ed_pec_sync_trigger(struct dc_ed *ed); +void dc_ed_init(struct dc_ed *ed); + +/* Layer Blend Unit */ +enum dc_link_id dc_lb_get_link_id(struct dc_lb *lb); +void dc_lb_pec_dynamic_prim_sel(struct dc_lb *lb, enum dc_link_id prim); +void dc_lb_pec_dynamic_sec_sel(struct dc_lb *lb, enum dc_link_id sec); +void dc_lb_pec_clken(struct dc_lb *lb, enum dc_pec_clken clken); +void dc_lb_mode(struct dc_lb *lb, enum dc_lb_mode mode); +void dc_lb_blendcontrol(struct dc_lb *lb); +void dc_lb_position(struct dc_lb *lb, int x, int y); +unsigned int dc_lb_get_id(struct dc_lb *lb); +void dc_lb_init(struct dc_lb *lb); + +#endif /* __DC_PIXEL_ENGINE_H__ */ From patchwork Fri Jul 5 09:09:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724590 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 5B4C1C30658 for ; Fri, 5 Jul 2024 09:01:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6E4610E21C; Fri, 5 Jul 2024 09:01:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Sf5E05U/"; dkim-atps=neutral Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2088.outbound.protection.outlook.com [40.107.22.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DBAB10E21C for ; Fri, 5 Jul 2024 09:01:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gaiYgUzxQCrzzkGeRBnHmxXsK1FTsqGYIMCuvmUetXpNg9gKa+COXuan9TUzQvyic8KJx1NJS4fXZAEcsl9iUI3nrDeIiqjlnq24j8NRSicPDHzpTRy97Ykp3jHxMpStCMLHV5LmzgM5mRcZqahtDxJ+bIiS7omtKrHIgcut4FOT0FfvV3iG8tKqFHc3Q/ZViCudh41/jnPj21UNcwrpcdi8Shtyxh70C8InT/LMOOw85I+oRgf/IzjbE8cj6HtyuWebsM50IXCyQKR+yeaX+64MkziVX+X8WURUr2QeF91GSC2nmfB0ykovl9ERi08/ClSZG6VJbgLi0fPA6VI03g== 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=+MeLRpZn1o42MnoTkWGwyA65gNRDqvVGA2ryZXyt1N4=; b=WlI6l9GcRxMKnIGhX0f+SlpAH56jxfjdn3w/JLB/m3uSM93IRPe8ivUkIxNy4nDYdjFehYumCFG95iCb3a517zhdBOzm8Zv1WcxcS2PyYvvCKac1j/eVDpmf2ibuIdqj5QHUeYa6+CUeGDsHzojw6nKmnSsjpvYsVFjNOYi1yeiNpdtb6F2gQ446hb5vwXVMKewS9zOHmMOPyy0QtZP/fYs8LYBrKCpd5yrSASEgds+mXYoE8n36IQO8qRzhtEsPaA7mP8xYDL/V6fbvhDoaSaTU/JAOWv9o4W9oJ8jGwzDHleuz+H9sybcd/YbHrpaQ2Finnbk3n+ojIkJXByEGqw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+MeLRpZn1o42MnoTkWGwyA65gNRDqvVGA2ryZXyt1N4=; b=Sf5E05U/WpBU5r+nI3ifP6a8gBXr72dm0eKAeKLSbMFF6QmpduO9UoBwQUHcXH77H+QU4jaIb7CG2GtLxXU5eXuOmSRI8IySYkciSyCiTghZyfR22eDUzjVwWVwbqlkoohRC6I2lEH5Bd6NhWCHy9ZsXJX443N+nKH2svNMAqSY= 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 AS8PR04MB8038.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:38 +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.7741.027; Fri, 5 Jul 2024 09:01:38 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 08/10] drm/imx: Add i.MX8qxp Display Controller interrupt controller Date: Fri, 5 Jul 2024 17:09:30 +0800 Message-Id: <20240705090932.1880496-9-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8038:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e049ad2-f5bd-4389-12ed-08dc9cd11443 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 5aw53LDPX3S6xZ/RfMGMY7kNvWCnHOSTYltv0N39AZAQY6fw6TpaFkStY4WUvOsT4ArxHrMx347zTbuLIY+MzLWtv4kGM+2PVsfV+WALvdvBMqvl0yPKv81Tg4iY+nRRlCRI54Zu8JwhPE3++5isa9rU3Q/TBjY74qXz5CYz2PaOUv/Qhi9XCGFQo7FBVjr0pddVOd3eY1bxvF8OQTx0Bd4RIyVnm+kJ1tz7k/N/rQnoY2lBXnv7kRmv2ih4QwxNXw2zsWXdFqBFbo9WUmG1raEiDB1BMJaTtt4kFi7ZeyKfnweyxPWpSbKDSYvKzVDwXUq4tcD1UWOCsGaXfS2KLhJ3IyUg9D4En+ZrXN3gUPaG5THzkKNACGMs/am83qZ3VxO0TVqx+D9Bm1FQXNTcHKV8zh8yHCMV+xEHaqaPTNrTSECDzefLD/eMV7IBFRPAoobzpb83UTobHTat34+UWHmrjGYP4700INYkU8OZeBtgHEhvOYPj1bGftnh0ERPmpMKDlGWGQTKHIx8mUZ/ES934i60GuRVGrksdJs+4TPsVysenee2WnAHvOW+dvHhN1WTlAj+w6sGRrCCb4X8ggH0+kUAzJvmqT3zO5GST/+qP8eAayfT99FyZ5FalBVgc8/EFSNSiCRp56F//ZCDCLUFY7DAtEHs3twDLovZl/iv3m2zf7VAUROZJw8Ae4cWD8gZoEd+PZ/g4/LScx7qToNxO6vi/w8vM8HDE7eDXTQIR1ysoM8bHVavGJoTBOIBl712x4PTOGVV9rX8nMq/MeiPDK1yQ38dgjCIvMxznaW1E1vLAjyJLAajrpFbc5pmrJVM2hXTI5zQXZIYRivXl+yONSpMQCsqEsedyLmANkWd1ukQoMqwVYw66ZIGleO++9vwYdbF+R1YYw147X3YdAc48jod9fCgNCzFz1/T1xEpiV1BDcfGEbLxUHig/JcxL6neYFR1VuOcaBNMfmIc9mNthBFzEomHy3+TnSTmpOmLCRD0cZ7FYw9aStJs6gfyi7abOvudBakcJ3KpeetcGLDGXn9m6YPYxp8uIkKU/wmU1vufix+mLEYhx1Ats7gFQPy5Bze0tXIle7ZLI4ywaH0Wr4oc8rpdTw07tclbVB9zqyUFuoLx+2+hOYqKd3CWxjmXTtSCtfmtin1yRdV20FfsjIJea+YQJNTxSBHIwePiOnn0qG4s2E/2ZNR/zUuncsgHc1/d3DGKTHpYxoIUgMu8hAYRtVgzVKSkrwZJTZwLbHrO7KuDuVVRW+GVy3Q+CKM2Da8h+9c+B5jNg8QywMZt7zMUryvS2urdNHRY/D/PUaJW542bQ7JKLobMeVBQBmFIMpuleHVva4oXF3EzyIDV8tkAUa4YhGHfM8ryox0bqmpBfTjf3y4ZwKRdWXjDkRbX2rvJyJsswU6S9q58o1g== 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)(1800799024)(7416014)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pmVUTf/DfFl+TzJsTNRKnDDRL59mz77pEA8hSZly3nQAxfiNvZm7ceyTTdyHM9QYk0+63w8TkrozcSfJcLUAqehiPjQrwtz3RESIk+HC54uO8SkIiIBJA3zjlDtAlLlsJqH+/GcJQjlQ5IZVi5gW9g+Yec2kSLi9/jn9r8VBFI4WbKQogCLfXQt+hkROGalayguJlXK12lpnn0ymoIypz20XU0Ncvi6e4PQW646ujL4v/77QjwueeBKXFvgdNuP7ZtLEGUY8xIsf4u9TnRWTWEZ+D6CB0vPi6nV67yZnskczKA0dGVC/ZwLC/i8IZqXod+efp1j6dtkeCjtGukXz2s8qZo6p47R+I+gP3dBUsey132cLEqD8G9GcOaNvsGrMU8mJqjaMq3MZkNG0r8WDuEknQF7BTj+zk5tx2t2mM0bFbDBnyUcze4EgpjjqSrRHO6ydHawowU61RPgX2KJaRttJCPDx1zQYIRAF7wRsHJLyfoqmOSgUNKZ0AkeCI55CtCuJ7LOO/pvTcBu8gCb04pHbSZA4Ck0dTxTPt1qSNk2KC175VVP0m59EtD8wqyRxA/n2IjI8bo5g2PE5bjdEGrf8MqGry8Bic3jpqRm067mgmgXSqDF9JnhV8d0bF+inhKJQhmh4uZchbuCDY57fg7ZPfuLnTzaiHo3j/S2seA4/6FHI6aQW/8H7nnZEoTen1DF4kjfMRaFiKT2NJ9BhftyRt0F82qNh6XcuGTmwANjhnngAyEWE14yl1XhNqv70pZwVZJvlwgDo2BeWs3EdgOf3uohX/dZlNnMytEAFpofqurjujieJ3rrnVilRtgo8/aMnDeg/Z3O1gFXXHuaFnEqj0aJ3jomdr0bzWYUDYCBGuXQ9ucwSquaXDmkh3hjygDR3Qhge+KUQFJGFVjsADvh/6JRazPtz7iMoXYAbT0Wm7DEcgEOdBLpyJZmAzFT3EEjhZQpRdG5XXl4emtD1rRy0mpHDVjHUznjzIY1gdDyCHN2wrEp7XzJM7Zyf61+3uwHGXuwW6xX3nFmt9NhNpRVgZnou+RnGcocrR4OFbK8Rimug+4v1UvIn1LPKL8dt2TKcrryvZckQM8N7uSMGQMgBqoLB0ep7KtqhYrnWi40FIdEGFVRXxG8HzQ2mqLDgg5MMhFjb1XEdV9yGJtguRESEvQs4CwohkRc+PA3Rfl0BXbzab9AM6F2W92QzvWca0JAy0Y7c4IXypBWokaRzbqHbER2SOg1PD08/msfWmzpM7w8v9WkopIqEFJdPuG2EbndX5nPMqXoGmKctaWH8VPHKsl3zm526MXIl/Mn8mRmLaxalgkvUtAXzmZ5ttrz8lMmzDkoie5qTpvcZTTspS3tyNqAtxcBcOtS+FZWiePx06H1Ggjuy0gTD9d7UZl6MTzClq7veFxve9IAiZnyYQwnJmOElucGmwahVl/D5cDFf31H/z4tips09KkFCIX+LVLvVYunrwYzcmbBW1iJuEgaIPj9E0z2qZloqHvG/zYHMeK4G3NNYPrNpKQNbRId6Ydjvm5R3GIBxoURX5cO6UkqTviaSgr0Cxmsbs+nwyhK926Kh7v8maFjHSMPdgX3E X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e049ad2-f5bd-4389-12ed-08dc9cd11443 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:38.4296 (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: cxwaCzw4OfaWL+gV0MEmY+rL3Qf5+YiEk6fpE/+/uug3Ned/5HdZiwdXJGwmGI6Txh2vwIb3SEFhvwCqlHsmng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8038 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.MX8qxp Display Controller has a built-in interrupt controller to support Enable/Status/Preset/Clear interrupt bit. Add driver for it. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/dc/Kconfig | 1 + drivers/gpu/drm/imx/dc/Makefile | 2 +- drivers/gpu/drm/imx/dc/dc-drv.c | 1 + drivers/gpu/drm/imx/dc/dc-drv.h | 1 + drivers/gpu/drm/imx/dc/dc-ic.c | 249 ++++++++++++++++++++++++++++++++ 5 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/imx/dc/dc-ic.c diff --git a/drivers/gpu/drm/imx/dc/Kconfig b/drivers/gpu/drm/imx/dc/Kconfig index 32d7471c49d0..b66b815fbdf1 100644 --- a/drivers/gpu/drm/imx/dc/Kconfig +++ b/drivers/gpu/drm/imx/dc/Kconfig @@ -1,5 +1,6 @@ config DRM_IMX8_DC tristate "Freescale i.MX8 Display Controller Graphics" depends on DRM && COMMON_CLK && OF && (ARCH_MXC || COMPILE_TEST) + select GENERIC_IRQ_CHIP help enable Freescale i.MX8 Display Controller(DC) graphics support diff --git a/drivers/gpu/drm/imx/dc/Makefile b/drivers/gpu/drm/imx/dc/Makefile index 2942ae6fd5bd..1ce3e8a8db22 100644 --- a/drivers/gpu/drm/imx/dc/Makefile +++ b/drivers/gpu/drm/imx/dc/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 imx8-dc-drm-objs := dc-cf.o dc-de.o dc-drv.o dc-ed.o dc-fg.o dc-fl.o dc-fu.o \ - dc-fw.o dc-lb.o dc-pe.o dc-tc.o + dc-fw.o dc-ic.o dc-lb.o dc-pe.o dc-tc.o obj-$(CONFIG_DRM_IMX8_DC) += imx8-dc-drm.o diff --git a/drivers/gpu/drm/imx/dc/dc-drv.c b/drivers/gpu/drm/imx/dc/dc-drv.c index 7c64acc863ad..fd68861f770a 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.c +++ b/drivers/gpu/drm/imx/dc/dc-drv.c @@ -15,6 +15,7 @@ static struct platform_driver * const dc_drivers[] = { &dc_fg_driver, &dc_fl_driver, &dc_fw_driver, + &dc_ic_driver, &dc_lb_driver, &dc_pe_driver, &dc_tc_driver, diff --git a/drivers/gpu/drm/imx/dc/dc-drv.h b/drivers/gpu/drm/imx/dc/dc-drv.h index c687a36b8153..3b11f4862c6c 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.h +++ b/drivers/gpu/drm/imx/dc/dc-drv.h @@ -25,6 +25,7 @@ extern struct platform_driver dc_de_driver; extern struct platform_driver dc_fg_driver; extern struct platform_driver dc_fl_driver; extern struct platform_driver dc_fw_driver; +extern struct platform_driver dc_ic_driver; extern struct platform_driver dc_lb_driver; extern struct platform_driver dc_pe_driver; extern struct platform_driver dc_tc_driver; diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c new file mode 100644 index 000000000000..8540a0414b39 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-ic.c @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "dc-drv.h" + +#define USERINTERRUPTMASK(n) (0x8 + 4 * (n)) +#define INTERRUPTENABLE(n) (0x10 + 4 * (n)) +#define INTERRUPTCLEAR(n) (0x20 + 4 * (n)) +#define INTERRUPTSTATUS(n) (0x28 + 4 * (n)) +#define USERINTERRUPTENABLE(n) (0x40 + 4 * (n)) +#define USERINTERRUPTCLEAR(n) (0x50 + 4 * (n)) +#define USERINTERRUPTSTATUS(n) (0x58 + 4 * (n)) + +#define IRQ_COUNT 49 +#define IRQ_RESERVED 35 +#define REG_NUM 2 + +struct dc_ic_data { + void __iomem *regs; + struct clk *clk_axi; + int irq[IRQ_COUNT]; + struct irq_domain *domain; +}; + +struct dc_ic_entry { + struct dc_ic_data *data; + int irq; +}; + +static void dc_ic_irq_handler(struct irq_desc *desc) +{ + struct dc_ic_entry *entry = irq_desc_get_handler_data(desc); + struct dc_ic_data *data = entry->data; + unsigned int virq; + u32 status; + + chained_irq_enter(irq_desc_get_chip(desc), desc); + + status = readl(data->regs + USERINTERRUPTSTATUS(entry->irq / 32)); + status &= readl(data->regs + USERINTERRUPTENABLE(entry->irq / 32)); + + if (status & BIT(entry->irq % 32)) { + virq = irq_linear_revmap(data->domain, entry->irq); + if (virq) + generic_handle_irq(virq); + } + + chained_irq_exit(irq_desc_get_chip(desc), desc); +} + +static const unsigned long unused_irq[REG_NUM] = {0x00000000, 0xfffe0008}; + +static int +dc_ic_bind(struct device *dev, struct device *master, void *master_data) +{ + struct platform_device *pdev = to_platform_device(dev); + struct dc_drm_device *dc_drm = master_data; + struct dc_ic_entry *entry; + struct irq_chip_generic *gc; + struct dc_ic_data *data; + struct irq_chip_type *ct; + int i, ret; + + data = drmm_kzalloc(&dc_drm->base, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + entry = drmm_kcalloc(&dc_drm->base, IRQ_COUNT, sizeof(*entry), + GFP_KERNEL); + if (!entry) + return -ENOMEM; + + data->regs = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(data->regs)) { + dev_err(dev, "failed to initialize reg\n"); + return PTR_ERR(data->regs); + } + + data->clk_axi = devm_clk_get(dev, NULL); + if (IS_ERR(data->clk_axi)) + return dev_err_probe(dev, PTR_ERR(data->clk_axi), + "failed to get AXI clock\n"); + + dev_set_drvdata(dev, data); + + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) { + dev_err(dev, "failed to get runtime PM sync: %d\n", ret); + return ret; + } + + for (i = 0; i < REG_NUM; i++) { + /* mask and clear all interrupts */ + writel(0x0, data->regs + USERINTERRUPTENABLE(i)); + writel(0x0, data->regs + INTERRUPTENABLE(i)); + writel(0xffffffff, data->regs + USERINTERRUPTCLEAR(i)); + writel(0xffffffff, data->regs + INTERRUPTCLEAR(i)); + + /* set all interrupts to user mode */ + writel(0xffffffff, data->regs + USERINTERRUPTMASK(i)); + } + + data->domain = irq_domain_add_linear(dev->of_node, IRQ_COUNT, + &irq_generic_chip_ops, data); + if (!data->domain) { + dev_err(dev, "failed to create IRQ domain\n"); + pm_runtime_put(dev); + return -ENOMEM; + } + irq_domain_set_pm_device(data->domain, &pdev->dev); + + ret = irq_alloc_domain_generic_chips(data->domain, 32, 1, "DC", + handle_level_irq, 0, 0, 0); + if (ret) { + dev_err(dev, "failed to alloc generic IRQ chips: %d\n", ret); + irq_domain_remove(data->domain); + pm_runtime_put(dev); + return ret; + } + + for (i = 0; i < IRQ_COUNT; i += 32) { + gc = irq_get_domain_generic_chip(data->domain, i); + gc->reg_base = data->regs; + gc->unused = unused_irq[i / 32]; + ct = gc->chip_types; + ct->chip.irq_ack = irq_gc_ack_set_bit; + ct->chip.irq_mask = irq_gc_mask_clr_bit; + ct->chip.irq_unmask = irq_gc_mask_set_bit; + ct->regs.ack = USERINTERRUPTCLEAR(i / 32); + ct->regs.mask = USERINTERRUPTENABLE(i / 32); + } + + for (i = 0; i < IRQ_COUNT; i++) { + /* skip the reserved IRQ */ + if (i == IRQ_RESERVED) + continue; + + data->irq[i] = irq_of_parse_and_map(dev->of_node, i); + + entry[i].data = data; + entry[i].irq = i; + + irq_set_chained_handler_and_data(data->irq[i], + dc_ic_irq_handler, &entry[i]); + } + + return 0; +} + +static void +dc_ic_unbind(struct device *dev, struct device *master, void *master_data) +{ + struct dc_ic_data *data = dev_get_drvdata(dev); + int i; + + for (i = 0; i < IRQ_COUNT; i++) { + if (i == IRQ_RESERVED) + continue; + + irq_set_chained_handler_and_data(data->irq[i], NULL, NULL); + } + + irq_domain_remove(data->domain); + + pm_runtime_put_sync(dev); +} + +static const struct component_ops dc_ic_ops = { + .bind = dc_ic_bind, + .unbind = dc_ic_unbind, +}; + +static int dc_ic_probe(struct platform_device *pdev) +{ + int ret; + + ret = component_add(&pdev->dev, &dc_ic_ops); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component\n"); + + return 0; +} + +static void dc_ic_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dc_ic_ops); +} + +static int dc_ic_runtime_suspend(struct device *dev) +{ + struct dc_ic_data *data = dev_get_drvdata(dev); + + clk_disable_unprepare(data->clk_axi); + + return 0; +} + +static int dc_ic_runtime_resume(struct device *dev) +{ + struct dc_ic_data *data = dev_get_drvdata(dev); + int ret; + + ret = clk_prepare_enable(data->clk_axi); + if (ret) + dev_err(dev, "failed to enable AXI clock: %d\n", ret); + + return ret; +} + +static const struct dev_pm_ops dc_ic_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) + RUNTIME_PM_OPS(dc_ic_runtime_suspend, dc_ic_runtime_resume, NULL) +}; + +static const struct of_device_id dc_ic_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc-intc", }, + { /* sentinel */ } +}; + +struct platform_driver dc_ic_driver = { + .probe = dc_ic_probe, + .remove_new = dc_ic_remove, + .driver = { + .name = "imx8-dc-intc", + .of_match_table = dc_ic_dt_ids, + .pm = pm_sleep_ptr(&dc_ic_pm_ops), + }, +}; From patchwork Fri Jul 5 09:09:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724591 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 A9652C3271F for ; Fri, 5 Jul 2024 09:01:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E98C10E22B; Fri, 5 Jul 2024 09:01:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="HR8ra7r/"; dkim-atps=neutral Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2041.outbound.protection.outlook.com [40.107.22.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 946FE10E22B for ; Fri, 5 Jul 2024 09:01:48 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M4JxXCRAFsE6BI2e+Q+u/vSotoGfKt6isg5/iIAZvv30Za1XSn/UMht0PT0yW8Zwx1ndAjbuvprESVipaS44NcPgsYc5WzAl14BA8bgKK1DtlYn99gdYbD4sDnCY2Ou+XZ98v9nTL2LzCibTCLGGChuO6rTvUSyVyGO+tywaD2jdu00kAfW/oyXCgztldONLM4vh7tjOj+/mqsDvTVN2qNDpgo+CwE1q6i7QJMfS2xpRt3+NttIDz0eAapnNIALCYbe0/If/LVXBWLUGSge+t9e92hyECuIrBbEisp/EAD6ZMSPshB/OTP+lOY5OZPUjI1IKTgv82to3OW2sHFhytQ== 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=angJoPM4p44lXvGR77wbxgpMtdf/rnCAMZZ8qRGNa6g=; b=X78GiQorWIBF9wfKddss+YoD2uevTAU1RvhDog9s3nsJYkzIxsDiTiczy8UTDSknRnNOsdGx09HCzxjNjQGsMbM6Ck9N6MrBp73fGrZByUHRdGLXAHZ0vycl5kXzHFchrw6AzMItoUaoStdpr3b41+Ot30kDyUASojzaT1SYWRhPY6KBZhsQpD63wjmbg+PS7vbJGDVXYMAg5w109K6jFkWHFTLimQ+X5dk0JkoB88PGffxyE1PfBcAXowSGU3V8olB2UvigTB3OECQouhMQTZOmrBq9ZGkJEIrto7jT4h8TaVou9axUi3s8Pxfw0CWa2vlerfo326s19ujJFyxrHw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=angJoPM4p44lXvGR77wbxgpMtdf/rnCAMZZ8qRGNa6g=; b=HR8ra7r/4IqHxSu0ZSNxI+4BT2ERIvyCgYr2f7oLF82lVDOmDIJFIfA/wy5ZjOwY8/k5HqWjBDZLLCsU+vkq3OXLVI8D4TJCP1Oo1Bl/UHsZCve0ttnesGHkzgFnqnqsyrUej+Z70n9Vf5Hd2ZWpt8rpfoCpmdnkhHEiJts3mts= 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 AS8PR04MB8038.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:45 +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.7741.027; Fri, 5 Jul 2024 09:01:45 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 09/10] drm/imx: Add i.MX8qxp Display Controller KMS Date: Fri, 5 Jul 2024 17:09:31 +0800 Message-Id: <20240705090932.1880496-10-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8038:EE_ X-MS-Office365-Filtering-Correlation-Id: c97b6de6-cf90-4b97-b4d5-08dc9cd11866 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: n9IeDz5lOGOdNE7P+4MY3AhBU38axYy+wogpfBG8a9wuElPnTS7ODjZVno0YR0ueYa4M2k0j7ksqhPPSU7Z9LjiwArERYphlikLXbvlcz2l/bc6kQea+iFzgMLAY9DMLuJbVZgFVoftIVHHgSluhfM95pLA84syyph78lETJ5N7RTATRdbyS457nvUIc5sUukITe9/U39KAyOLE9sejCpBgXOQ4BbD8T+BFFFhHlu6sDaPbLTrMProhQ4m3HCKh7yfhNsRo2HqAi3GUcbTsh8cqQBKKAyp0KHF1obYZNUnAPHdfOy8XVPtxeocgLOEW1KeCaz0+qp7KaqbdVABDVgzG6l+bUpQ8yR0zDdeuaXjVW0QXTNvc2fnpa01dxGW23IzAxoShSdixipZiqfsQdO6iZiHHFgwcha03cvbRVLS/si3TQLhe4T71u3uU1a/vRlvo+koaONiIoENNrr5SOIxJ/zZHHkD9Twzy32SO9h5kuGDnX9SiCaOR1Y9Z2ms+ArAAZW42fpDB0p5I+966mpYCI0Dp05LLIfWWCxeq0kytyvGhGl0AaWyjojOlwEu2Qd2tN3aT/Q1K/LnmlmYha+4/fE8iI3PoHut++T3cVQQW9xKBV0V7PSMDYFNB6bRQH4XWMjDwuuakkap096jlzycfql5Rn7W/3bBNYfzsad823xxnceq0VR2jf8KwVZcIyltireHWz1mgPFP3DwBRMg3dawPy1YxRMSmQN/200Y123wKmY4kZrbqjgLlmMjHYgvZGwzL3vB4dqybeRE8ExVVHJa1AKHT2mpDsU8lR3GZZeRdvKK45OHIC13Kgmix1gTbaR2y65cq/knmgpSYo+ykwZ2heU7fzZC7CN+Eu8XOmTsI212Mums0AMWXfKIBFEBi2Je1cbKyEol88KraXANLgV+FXMwHCOgJE6sdaTKyFOFlVuFQ7h2aoQjmc7hX5hrRqwC/iGZZfe4lW9HwlOldjhjS1eF7ei0d06rfnr8aG16mcmKEqTvQpMN4CQrh/EQjMFlGE6BJBGUcHEfLQWlTREm8egviFL1JfOXoZntNOvm3DQhGs3JqX78vSWwNKSnt78nRGsEoz58j4NpFQio3XSO0qEmPvq87kjf6EpQEgDGprARIpl5zgTEnkkIPv8gTSxOFzsm06zXLKWtEVwbdmaJ1ebzidWCIoXRJBG9As6IReIljkrmJr/k1msWdvf4FSrhriwyYX9l32veqOKn36bJmBuUv6kCgmKXE1tKNBaGlJR8txC8GcIT5Emdaf7Ah25L7i9Je05Zd5OJ+xrF6vUknalvPFigzCQzF8AjQUop402wb+SgSpm9Y/AgKXv4RWhX0sSrN4TlH/a/65qptnhkggiKuLl8Lm6/+OclaI0uXKzBuZHlnmwXEL/kve1sZeYfcTXD+P2sS9Uis2ktw== 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)(1800799024)(7416014)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u89r4v3HEyXbbam65ttR0yLmvkOVYyw2gfBoU3TgWvexboGadkplgWeq6tab0DitQhvuB+iLClOkKbWp/z6o69ZY6DHgzMevwqjlHh6RqPqmIMH33LieyEbYAVXM3zIdjg5F/sJ/vZoslqyVoNtJbYFGFIUoK8Y91R2I4OvGqL2Du6ac52lgnOHaJCUczcc4EuJRLcXR1e81tI8e1mePwN4Oa5l/KL3n9YAEnv3LmweR246E+oZRWFEnwxAewy3u7KQTqAeKcBVAq1X3FLxxvjdAD+V9sWtuqG9NP6vw+bdojXpKpOuf3YPuuPMBA4glSn6hFVSnvhjB4rJkUNuJGU9+4EGlKUrneYJNRR6kwNQTRJtiqXUll+HsNc1xSftd0UP7KZCGLGl6qlibv9QGJKHK6YJzlnilgtstKjJ3oGqI5Wo7CWmLJQPjH/XlkZM7GPlakGfLCrPkNo2/oxZ+IwSUzrx+GubU6pejz5xhFTRAPGwEESNPAuQTe7e+Ab5l3iAg/Or70O5oNn8Z4qExNk9u3IgzTTc614WZoJwJFJL2bmMav9NhLszvXqMcIqewfhbKAlEQu46XVeTN6Z/PDJ1xuptd27Q/z/cn2pdmv6z1qHYtwvBDrL4srepWsb87ADnMM+/sB2phBF8oNixgudMoegXWQfzX6QJzDLZZSFXBLk487YvLSXdAxtio4zbrqnnz5Q4kN/7621j2K7jaFpFNh9soLIZUQ1rWmz1QDHfqrYE/tth2IOuJTMB/WVKt4KKipw5eQz9gs9ScysHB3gdeF5ct+JWO/pDFDcQLWNo/M6ZkrLOZkDihByD4ReqgYmXD1ww+idvm8qFRoACmxYzbvK/CjascLkFYZL+kHgbBTOtRuDxroVsLeAW+1RfwgM75NTDaJQ9vU7X1lEXW17XOHfCS90oRx5SSAyyyWWFeCWeJGBfrWdiZ+aZsTU9FzqLFLF3OqL+1CzGwLtZv6z0z0qWSid9IXqLCgKisxBWJUvUr3wpeDwbnMEthMlHoeHnHc46HGU6JCTr9mxq5pP1WoLcNLmJNQaN+u+VfvbZv2mmk565TDwR/VISQ0dZNWdFa7Pmrylfujv6ZSO5geDS/HIepEN1sSzxqdSz+KuTKZLOSFMok8+DpUw8xNzqS0/QLwurnsPTeQJFCMHjEWWqg6PKbf2h34qngQpGrXhTAqksyJO7Fl1L/xgHltfd8NAusYa/VnZbVuQ+3am9p4P9YdCiJAXUO0H7IL4HjCIHSOFTuaYZFC852Jb1dJAOYHttoQWcPgnr2JRoLSSIi5nzpFI6Qdu8t/9UAjcACoeJMb05yDjCinMjeKzwplwNDnO+0nIBqK4ifQ0H924GLRfgS3GuVX3BIgCDAAzsUAiT9sR77/YUsStXHV3qHXvyW/steRu2dFEU8+XpDIiNmighEMMOJ49E0uuRXgKG84fdu/RSRdPDcNsO4NDguKWT3VBadoOiIIvQ8SrQDtn0rEgQq90wIeV0ALMPV/BIPdNp5zI+5UZ3AKgMIU+7cMl+IrqaHE4lisX+gLcdDTVEhdYIIaT3yrSyvlZumzyamRjRYHH2FFLG053msy3aJge2l X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c97b6de6-cf90-4b97-b4d5-08dc9cd11866 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:45.5167 (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: 4812sC/FizP+qRnFY8DoQwaKyXJzyklHiaxwqynKC8uqGVHLysTcbuJO0v1j+l32GtMqyGxH9mIfWO01egSqLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8038 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.MX8qxp Display Controller(DC) is comprised of three main components that include a blit engine for 2D graphics accelerations, display controller for display output processing, as well as a command sequencer. Add kernel mode setting support for the display controller part with two CRTCs and two primary planes(backed by FetchLayer and FetchWarp respectively). The registers of the display controller is accessed without command sequencer involved, instead just by using CPU. The command sequencer is supposed to be used by the blit engine. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/dc/Kconfig | 2 + drivers/gpu/drm/imx/dc/Makefile | 5 +- drivers/gpu/drm/imx/dc/dc-crtc.c | 578 ++++++++++++++++++++++++++++++ drivers/gpu/drm/imx/dc/dc-crtc.h | 67 ++++ drivers/gpu/drm/imx/dc/dc-de.h | 3 + drivers/gpu/drm/imx/dc/dc-drv.c | 241 +++++++++++++ drivers/gpu/drm/imx/dc/dc-drv.h | 21 ++ drivers/gpu/drm/imx/dc/dc-kms.c | 143 ++++++++ drivers/gpu/drm/imx/dc/dc-kms.h | 15 + drivers/gpu/drm/imx/dc/dc-plane.c | 227 ++++++++++++ drivers/gpu/drm/imx/dc/dc-plane.h | 37 ++ 11 files changed, 1337 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/imx/dc/dc-crtc.c create mode 100644 drivers/gpu/drm/imx/dc/dc-crtc.h create mode 100644 drivers/gpu/drm/imx/dc/dc-kms.c create mode 100644 drivers/gpu/drm/imx/dc/dc-kms.h create mode 100644 drivers/gpu/drm/imx/dc/dc-plane.c create mode 100644 drivers/gpu/drm/imx/dc/dc-plane.h diff --git a/drivers/gpu/drm/imx/dc/Kconfig b/drivers/gpu/drm/imx/dc/Kconfig index b66b815fbdf1..dac0de009273 100644 --- a/drivers/gpu/drm/imx/dc/Kconfig +++ b/drivers/gpu/drm/imx/dc/Kconfig @@ -1,6 +1,8 @@ config DRM_IMX8_DC tristate "Freescale i.MX8 Display Controller Graphics" depends on DRM && COMMON_CLK && OF && (ARCH_MXC || COMPILE_TEST) + select DRM_GEM_DMA_HELPER + select DRM_KMS_HELPER select GENERIC_IRQ_CHIP help enable Freescale i.MX8 Display Controller(DC) graphics support diff --git a/drivers/gpu/drm/imx/dc/Makefile b/drivers/gpu/drm/imx/dc/Makefile index 1ce3e8a8db22..b9d33c074984 100644 --- a/drivers/gpu/drm/imx/dc/Makefile +++ b/drivers/gpu/drm/imx/dc/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 -imx8-dc-drm-objs := dc-cf.o dc-de.o dc-drv.o dc-ed.o dc-fg.o dc-fl.o dc-fu.o \ - dc-fw.o dc-ic.o dc-lb.o dc-pe.o dc-tc.o +imx8-dc-drm-objs := dc-cf.o dc-crtc.o dc-de.o dc-drv.o dc-ed.o dc-fg.o dc-fl.o \ + dc-fu.o dc-fw.o dc-ic.o dc-kms.o dc-lb.o dc-pe.o \ + dc-plane.o dc-tc.o obj-$(CONFIG_DRM_IMX8_DC) += imx8-dc-drm.o diff --git a/drivers/gpu/drm/imx/dc/dc-crtc.c b/drivers/gpu/drm/imx/dc/dc-crtc.c new file mode 100644 index 000000000000..e151e14a6677 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-crtc.c @@ -0,0 +1,578 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dc-crtc.h" +#include "dc-de.h" +#include "dc-drv.h" +#include "dc-pe.h" +#include "dc-plane.h" + +#define DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(c) \ +do { \ + unsigned long ret; \ + ret = wait_for_completion_timeout(&dc_crtc->c, HZ); \ + if (ret == 0) \ + dc_crtc_err(crtc, "%s: wait for " #c " timeout\n", \ + __func__); \ +} while (0) + +#define DC_CRTC_CHECK_FRAMEGEN_FIFO(fg) \ +do { \ + typeof(fg) _fg = (fg); \ + if (dc_fg_secondary_requests_to_read_empty_fifo(_fg)) { \ + dc_fg_secondary_clear_channel_status(_fg); \ + dc_crtc_err(crtc, "%s: FrameGen FIFO empty\n", \ + __func__); \ + } \ +} while (0) + +#define DC_CRTC_WAIT_FOR_FRAMEGEN_SECONDARY_SYNCUP(fg) \ +do { \ + if (dc_fg_wait_for_secondary_syncup(fg)) \ + dc_crtc_err(crtc, \ + "%s: FrameGen secondary channel isn't syncup\n",\ + __func__); \ +} while (0) + +static u32 dc_crtc_get_vblank_counter(struct drm_crtc *crtc) +{ + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + + return dc_fg_get_frame_index(dc_crtc->fg); +} + +static int dc_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + + enable_irq(dc_crtc->irq_dec_framecomplete); + + return 0; +} + +static void dc_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + + disable_irq_nosync(dc_crtc->irq_dec_framecomplete); +} + +static irqreturn_t +dc_crtc_dec_framecomplete_irq_handler(int irq, void *dev_id) +{ + struct dc_crtc *dc_crtc = dev_id; + struct drm_crtc *crtc = &dc_crtc->base; + unsigned long flags; + + drm_crtc_handle_vblank(crtc); + + spin_lock_irqsave(&crtc->dev->event_lock, flags); + if (dc_crtc->event) { + drm_crtc_send_vblank_event(crtc, dc_crtc->event); + dc_crtc->event = NULL; + drm_crtc_vblank_put(crtc); + } + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); + + return IRQ_HANDLED; +} + +static irqreturn_t dc_crtc_common_irq_handler(int irq, void *dev_id) +{ + struct dc_crtc *dc_crtc = dev_id; + struct drm_crtc *crtc = &dc_crtc->base; + + if (irq == dc_crtc->irq_dec_seqcomplete) { + complete(&dc_crtc->dec_seqcomplete_done); + } else if (irq == dc_crtc->irq_dec_shdld) { + complete(&dc_crtc->dec_shdld_done); + } else if (irq == dc_crtc->irq_ed_cont_shdld) { + complete(&dc_crtc->ed_cont_shdld_done); + } else if (irq == dc_crtc->irq_ed_safe_shdld) { + complete(&dc_crtc->ed_safe_shdld_done); + } else { + dc_crtc_err(crtc, "invalid CRTC irq(%u)\n", irq); + return IRQ_NONE; + } + + return IRQ_HANDLED; +} + +static const struct drm_crtc_funcs dc_crtc_funcs = { + .reset = drm_atomic_helper_crtc_reset, + .destroy = drm_crtc_cleanup, + .set_config = drm_atomic_helper_set_config, + .page_flip = drm_atomic_helper_page_flip, + .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .get_vblank_counter = dc_crtc_get_vblank_counter, + .enable_vblank = dc_crtc_enable_vblank, + .disable_vblank = dc_crtc_disable_vblank, + .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp, +}; + +static void dc_crtc_queue_state_event(struct drm_crtc_state *crtc_state) +{ + struct drm_crtc *crtc = crtc_state->crtc; + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + + spin_lock_irq(&crtc->dev->event_lock); + if (crtc_state->event) { + WARN_ON(drm_crtc_vblank_get(crtc)); + WARN_ON(dc_crtc->event); + dc_crtc->event = crtc_state->event; + crtc_state->event = NULL; + } + spin_unlock_irq(&crtc->dev->event_lock); +} + +static enum drm_mode_status +dc_crtc_check_clock(struct dc_crtc *dc_crtc, int clk_khz) +{ + return dc_fg_check_clock(dc_crtc->fg, clk_khz); +} + +static enum drm_mode_status +dc_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) +{ + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + enum drm_mode_status status; + + status = dc_crtc_check_clock(dc_crtc, mode->clock); + if (status != MODE_OK) + return status; + + if (mode->crtc_clock > DC_FRAMEGEN_MAX_CLOCK_KHZ) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + +static int +dc_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) +{ + struct drm_crtc_state *new_crtc_state = + drm_atomic_get_new_crtc_state(state, crtc); + struct drm_display_mode *adj = &new_crtc_state->adjusted_mode; + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + enum drm_mode_status status; + + status = dc_crtc_check_clock(dc_crtc, adj->clock); + if (status != MODE_OK) + return -EINVAL; + + return 0; +} + +static void +dc_crtc_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state) +{ + struct drm_crtc_state *new_crtc_state = + drm_atomic_get_new_crtc_state(state, crtc); + struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev); + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + int idx, ret; + + if (!drm_atomic_crtc_needs_modeset(new_crtc_state) || + !new_crtc_state->active) + return; + + if (!drm_dev_enter(crtc->dev, &idx)) + return; + + /* request pixel engine power-on when CRTC starts to be active */ + ret = pm_runtime_resume_and_get(dc_crtc->pe->dev); + if (ret) + dc_crtc_err(crtc, "failed to get DC pixel engine RPM: %d\n", + ret); + + atomic_inc(&dc_drm->pe_rpm_count); + + drm_dev_exit(idx); +} + +static void +dc_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) +{ + struct drm_crtc_state *old_crtc_state = + drm_atomic_get_old_crtc_state(state, crtc); + struct drm_crtc_state *new_crtc_state = + drm_atomic_get_new_crtc_state(state, crtc); + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + int idx; + + if (drm_atomic_crtc_needs_modeset(new_crtc_state) || + (!old_crtc_state->active && !new_crtc_state->active)) + return; + + if (!drm_dev_enter(crtc->dev, &idx)) + goto out; + + enable_irq(dc_crtc->irq_ed_cont_shdld); + + /* flush plane update out to display */ + dc_ed_pec_sync_trigger(dc_crtc->ed_cont); + + DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(ed_cont_shdld_done); + + disable_irq(dc_crtc->irq_ed_cont_shdld); + + DC_CRTC_CHECK_FRAMEGEN_FIFO(dc_crtc->fg); + + drm_dev_exit(idx); + +out: + dc_crtc_queue_state_event(new_crtc_state); +} + +static void +dc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) +{ + struct drm_crtc_state *new_crtc_state = + drm_atomic_get_new_crtc_state(state, crtc); + struct drm_display_mode *adj = &new_crtc_state->adjusted_mode; + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + enum dc_link_id cf_link; + int idx, ret; + + dc_crtc_dbg(crtc, "mode " DRM_MODE_FMT "\n", DRM_MODE_ARG(adj)); + + drm_crtc_vblank_on(crtc); + + if (!drm_dev_enter(crtc->dev, &idx)) + goto out; + + /* request display engine power-on when CRTC is enabled */ + ret = pm_runtime_resume_and_get(dc_crtc->de->dev); + if (ret < 0) + dc_crtc_err(crtc, "failed to get DC display engine RPM: %d\n", + ret); + + enable_irq(dc_crtc->irq_dec_shdld); + enable_irq(dc_crtc->irq_ed_cont_shdld); + enable_irq(dc_crtc->irq_ed_safe_shdld); + + dc_fg_displaymode(dc_crtc->fg, FG_DM_SEC_ON_TOP); + dc_fg_panic_displaymode(dc_crtc->fg, FG_DM_CONSTCOL); + dc_fg_cfg_videomode(dc_crtc->fg, adj); + + dc_cf_framedimensions(dc_crtc->cf_cont, + adj->crtc_hdisplay, adj->crtc_vdisplay); + dc_cf_framedimensions(dc_crtc->cf_safe, + adj->crtc_hdisplay, adj->crtc_vdisplay); + + /* constframe in safety stream shows blue frame */ + dc_cf_constantcolor_blue(dc_crtc->cf_safe); + cf_link = dc_cf_get_link_id(dc_crtc->cf_safe); + dc_ed_pec_src_sel(dc_crtc->ed_safe, cf_link); + + /* show CRTC background if no plane is enabled */ + if (new_crtc_state->plane_mask == 0) { + /* constframe in content stream shows black frame */ + dc_cf_constantcolor_black(dc_crtc->cf_cont); + + cf_link = dc_cf_get_link_id(dc_crtc->cf_cont); + dc_ed_pec_src_sel(dc_crtc->ed_cont, cf_link); + } + + dc_fg_enable_clock(dc_crtc->fg); + dc_ed_pec_sync_trigger(dc_crtc->ed_cont); + dc_ed_pec_sync_trigger(dc_crtc->ed_safe); + dc_fg_shdtokgen(dc_crtc->fg); + dc_fg_enable(dc_crtc->fg); + + DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(ed_safe_shdld_done); + DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(ed_cont_shdld_done); + DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(dec_shdld_done); + + disable_irq(dc_crtc->irq_ed_safe_shdld); + disable_irq(dc_crtc->irq_ed_cont_shdld); + disable_irq(dc_crtc->irq_dec_shdld); + + DC_CRTC_WAIT_FOR_FRAMEGEN_SECONDARY_SYNCUP(dc_crtc->fg); + + DC_CRTC_CHECK_FRAMEGEN_FIFO(dc_crtc->fg); + + drm_dev_exit(idx); + +out: + dc_crtc_queue_state_event(new_crtc_state); +} + +static void +dc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) +{ + struct drm_crtc_state *new_crtc_state = + drm_atomic_get_new_crtc_state(state, crtc); + struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev); + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + int idx, ret; + + if (!drm_dev_enter(crtc->dev, &idx)) + goto out; + + enable_irq(dc_crtc->irq_dec_seqcomplete); + dc_fg_disable(dc_crtc->fg); + DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(dec_seqcomplete_done); + disable_irq(dc_crtc->irq_dec_seqcomplete); + + dc_fg_disable_clock(dc_crtc->fg); + + /* request pixel engine power-off as plane is off too */ + ret = pm_runtime_put(dc_crtc->pe->dev); + if (ret) + dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n", + ret); + + atomic_dec(&dc_drm->pe_rpm_count); + + /* request display engine power-off when CRTC is disabled */ + ret = pm_runtime_put(dc_crtc->de->dev); + if (ret < 0) + dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n", + ret); + + drm_dev_exit(idx); + +out: + drm_crtc_vblank_off(crtc); + + spin_lock_irq(&crtc->dev->event_lock); + if (new_crtc_state->event && !new_crtc_state->active) { + drm_crtc_send_vblank_event(crtc, new_crtc_state->event); + new_crtc_state->event = NULL; + } + spin_unlock_irq(&crtc->dev->event_lock); +} + +void dc_crtc_disable_at_unbind(struct drm_crtc *crtc) +{ + struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev); + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + int ret; + + if (atomic_dec_if_positive(&dc_drm->pe_rpm_count) >= 0) { + ret = pm_runtime_put_sync(dc_crtc->pe->dev); + if (ret) + dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n", + ret); + } + + if (!dc_fg_wait_for_frame_index_moving(dc_crtc->fg)) + return; + + dc_fg_disable_clock(dc_crtc->fg); + + ret = pm_runtime_put_sync(dc_crtc->de->dev); + if (ret < 0) + dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n", + ret); +} + +static bool dc_crtc_get_scanout_position(struct drm_crtc *crtc, + bool in_vblank_irq, + int *vpos, int *hpos, + ktime_t *stime, ktime_t *etime, + const struct drm_display_mode *mode) +{ + struct dc_crtc *dc_crtc = to_dc_crtc(crtc); + int vdisplay = mode->crtc_vdisplay; + int vtotal = mode->crtc_vtotal; + bool reliable; + int line; + int idx; + + if (stime) + *stime = ktime_get(); + + if (!drm_dev_enter(crtc->dev, &idx)) { + reliable = false; + *vpos = 0; + *hpos = 0; + goto out; + } + + /* line index starts with 0 for the first active output line */ + line = dc_fg_get_line_index(dc_crtc->fg); + + if (line < vdisplay) + /* active scanout area - positive */ + *vpos = line + 1; + else + /* inside vblank - negative */ + *vpos = line - (vtotal - 1); + + *hpos = 0; + + reliable = true; + + drm_dev_exit(idx); +out: + if (etime) + *etime = ktime_get(); + + return reliable; +} + +static const struct drm_crtc_helper_funcs dc_helper_funcs = { + .mode_valid = dc_crtc_mode_valid, + .atomic_check = dc_crtc_atomic_check, + .atomic_begin = dc_crtc_atomic_begin, + .atomic_flush = dc_crtc_atomic_flush, + .atomic_enable = dc_crtc_atomic_enable, + .atomic_disable = dc_crtc_atomic_disable, + .get_scanout_position = dc_crtc_get_scanout_position, +}; + +static void dc_crtc_free_irq(struct drm_device *drm, void *ptr) +{ + struct dc_crtc_irq *irq = ptr; + + free_irq(irq->irq, irq->dc_crtc); +} + +static int +dc_crtc_request_irq(struct dc_crtc *dc_crtc, struct device *dev, + unsigned int irq, + irqreturn_t (*irq_handler)(int irq, void *dev_id)) +{ + int ret; + + ret = request_irq(irq, irq_handler, IRQF_NO_AUTOEN, dev_name(dev), + dc_crtc); + if (ret < 0) + dev_err(dev, "failed to request irq(%u): %d\n", irq, ret); + + return ret; +} + +static int dc_crtc_request_irqs(struct drm_device *drm, struct dc_crtc *dc_crtc) +{ + struct { + struct device *dev; + unsigned int irq; + irqreturn_t (*irq_handler)(int irq, void *dev_id); + } irqs[] = { + { + dc_crtc->de->dev, + dc_crtc->irq_dec_framecomplete, + dc_crtc_dec_framecomplete_irq_handler, + }, { + dc_crtc->de->dev, + dc_crtc->irq_dec_seqcomplete, + dc_crtc_common_irq_handler, + }, { + dc_crtc->de->dev, + dc_crtc->irq_dec_shdld, + dc_crtc_common_irq_handler, + }, { + dc_crtc->ed_cont->dev, + dc_crtc->irq_ed_cont_shdld, + dc_crtc_common_irq_handler, + }, { + dc_crtc->ed_safe->dev, + dc_crtc->irq_ed_safe_shdld, + dc_crtc_common_irq_handler, + }, + }; + struct drm_crtc *crtc = &dc_crtc->base; + int i, ret; + + dc_crtc->irqs = drmm_kcalloc(drm, ARRAY_SIZE(irqs), + sizeof(*dc_crtc->irqs), GFP_KERNEL); + if (!dc_crtc->irqs) { + dev_err(drm->dev, "failed to allocate CRTC%u irqs\n", + crtc->index); + return -ENOMEM; + } + + for (i = 0; i < ARRAY_SIZE(irqs); i++) { + struct dc_crtc_irq *irq = &dc_crtc->irqs[i]; + + ret = dc_crtc_request_irq(dc_crtc, irqs[i].dev, irqs[i].irq, + irqs[i].irq_handler); + if (ret) + return ret; + + irq->dc_crtc = dc_crtc; + irq->irq = irqs[i].irq; + + ret = drmm_add_action_or_reset(drm, dc_crtc_free_irq, irq); + if (ret) + return ret; + } + + return 0; +} + +int dc_crtc_init(struct dc_drm_device *dc_drm, int crtc_index) +{ + struct dc_crtc *dc_crtc = &dc_drm->dc_crtc[crtc_index]; + struct drm_device *drm = &dc_drm->base; + struct dc_de *de = dc_drm->de[crtc_index]; + struct dc_pe *pe = dc_drm->pe; + struct dc_plane *dc_primary; + int ret; + + dc_crtc->de = de; + dc_crtc->pe = pe; + + init_completion(&dc_crtc->dec_seqcomplete_done); + init_completion(&dc_crtc->dec_shdld_done); + init_completion(&dc_crtc->ed_cont_shdld_done); + init_completion(&dc_crtc->ed_safe_shdld_done); + + dc_crtc->cf_cont = pe->cf_cont[crtc_index]; + dc_crtc->cf_safe = pe->cf_safe[crtc_index]; + dc_crtc->ed_cont = pe->ed_cont[crtc_index]; + dc_crtc->ed_safe = pe->ed_safe[crtc_index]; + dc_crtc->fg = de->fg; + + dc_crtc->irq_dec_framecomplete = de->irq_framecomplete; + dc_crtc->irq_dec_seqcomplete = de->irq_seqcomplete; + dc_crtc->irq_dec_shdld = de->irq_shdld; + dc_crtc->irq_ed_safe_shdld = dc_crtc->ed_safe->irq_shdld; + dc_crtc->irq_ed_cont_shdld = dc_crtc->ed_cont->irq_shdld; + + dc_primary = &dc_drm->dc_primary[crtc_index]; + ret = dc_plane_init(dc_drm, dc_primary); + if (ret) { + dev_err(drm->dev, + "failed to init primary plane for display engine%u: %d\n", + de->id, ret); + return ret; + } + + drm_crtc_helper_add(&dc_crtc->base, &dc_helper_funcs); + + ret = drm_crtc_init_with_planes(drm, &dc_crtc->base, &dc_primary->base, + NULL, &dc_crtc_funcs, NULL); + if (ret) { + dev_err(drm->dev, + "failed to add CRTC for display engine%u: %d\n", + de->id, ret); + return ret; + } + + return dc_crtc_request_irqs(drm, dc_crtc); +} diff --git a/drivers/gpu/drm/imx/dc/dc-crtc.h b/drivers/gpu/drm/imx/dc/dc-crtc.h new file mode 100644 index 000000000000..9f28d0d4d712 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-crtc.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_CRTC_H__ +#define __DC_CRTC_H__ + +#include +#include + +#include +#include +#include + +#include "dc-de.h" +#include "dc-pe.h" + +#define dc_crtc_dbg(crtc, fmt, ...) \ +do { \ + typeof(crtc) _crtc = (crtc); \ + drm_dbg_kms(_crtc->dev, "[CRTC:%d:%s] " fmt, \ + _crtc->base.id, _crtc->name, ##__VA_ARGS__); \ +} while (0) + +#define dc_crtc_err(crtc, fmt, ...) \ +do { \ + typeof(crtc) _crtc = (crtc); \ + drm_err(_crtc->dev, "[CRTC:%d:%s] " fmt, \ + _crtc->base.id, _crtc->name, ##__VA_ARGS__); \ +} while (0) + +struct dc_crtc { + struct drm_crtc base; + struct dc_de *de; + struct dc_pe *pe; + struct dc_cf *cf_cont; + struct dc_cf *cf_safe; + struct dc_ed *ed_cont; + struct dc_ed *ed_safe; + struct dc_fg *fg; + unsigned int irq_dec_framecomplete; + unsigned int irq_dec_seqcomplete; + unsigned int irq_dec_shdld; + unsigned int irq_ed_cont_shdld; + unsigned int irq_ed_safe_shdld; + struct completion dec_seqcomplete_done; + struct completion dec_shdld_done; + struct completion ed_safe_shdld_done; + struct completion ed_cont_shdld_done; + struct drm_pending_vblank_event *event; + struct dc_crtc_irq *irqs; +}; + +struct dc_crtc_irq { + struct dc_crtc *dc_crtc; + unsigned int irq; +}; + +static inline struct dc_crtc *to_dc_crtc(struct drm_crtc *crtc) +{ + return container_of(crtc, struct dc_crtc, base); +} + +void dc_crtc_disable_at_unbind(struct drm_crtc *crtc); + +#endif /* __DC_CRTC_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-de.h b/drivers/gpu/drm/imx/dc/dc-de.h index 5fe340c88f91..a4d9afe6fe8f 100644 --- a/drivers/gpu/drm/imx/dc/dc-de.h +++ b/drivers/gpu/drm/imx/dc/dc-de.h @@ -11,6 +11,9 @@ #define DC_DISPLAYS 2 +#define DC_FRAMEGEN_MAX_FRAME_INDEX 0x3ffff +#define DC_FRAMEGEN_MAX_CLOCK_KHZ 300000 + enum dc_fg_syncmode { FG_SYNCMODE_OFF, /* No side-by-side synchronization. */ }; diff --git a/drivers/gpu/drm/imx/dc/dc-drv.c b/drivers/gpu/drm/imx/dc/dc-drv.c index fd68861f770a..6869816e48bc 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.c +++ b/drivers/gpu/drm/imx/dc/dc-drv.c @@ -3,11 +3,251 @@ * Copyright 2024 NXP */ +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dc-crtc.h" +#include "dc-de.h" #include "dc-drv.h" +struct dc_priv { + struct drm_device *drm; + struct clk *clk_cfg; +}; + +DEFINE_DRM_GEM_DMA_FOPS(dc_drm_driver_fops); + +static struct drm_driver dc_drm_driver = { + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, + DRM_GEM_DMA_DRIVER_OPS, + .fops = &dc_drm_driver_fops, + .name = "imx8-dc", + .desc = "i.MX8 DC DRM graphics", + .date = "20240530", + .major = 1, + .minor = 0, + .patchlevel = 0, +}; + +static void +dc_add_components(struct device *dev, struct component_match **matchptr) +{ + struct device_node *child, *grandchild; + + for_each_available_child_of_node(dev->of_node, child) { + drm_of_component_match_add(dev, matchptr, component_compare_of, + child); + + for_each_available_child_of_node(child, grandchild) { + if (of_node_name_eq(grandchild, "port")) + continue; + + drm_of_component_match_add(dev, matchptr, + component_compare_of, + grandchild); + } + } +} + +static void dc_drm_component_unbind_all(struct drm_device *drm, void *ptr) +{ + struct dc_drm_device *dc_drm = ptr; + + component_unbind_all(drm->dev, dc_drm); +} + +static int dc_drm_bind(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + struct dc_drm_device *dc_drm; + struct drm_device *drm; + int ret; + + dc_drm = devm_drm_dev_alloc(dev, &dc_drm_driver, struct dc_drm_device, + base); + if (IS_ERR(dc_drm)) + return PTR_ERR(dc_drm); + + drm = &dc_drm->base; + + ret = component_bind_all(dev, dc_drm); + if (ret) + return ret; + + ret = drmm_add_action_or_reset(drm, dc_drm_component_unbind_all, + dc_drm); + if (ret) + return ret; + + ret = dc_kms_init(dc_drm); + if (ret) + return ret; + + ret = drm_dev_register(drm, 0); + if (ret) { + dev_err(dev, "failed to register drm device: %d\n", ret); + goto err; + } + + drm_fbdev_dma_setup(drm, 32); + + priv->drm = drm; + + return 0; + +err: + dc_kms_uninit(dc_drm); + + return ret; +} + +static void dc_drm_unbind(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + struct dc_drm_device *dc_drm = to_dc_drm_device(priv->drm); + struct drm_device *drm = &dc_drm->base; + struct drm_crtc *crtc; + + priv->drm = NULL; + drm_dev_unplug(drm); + dc_kms_uninit(dc_drm); + drm_atomic_helper_shutdown(drm); + + drm_for_each_crtc(crtc, drm) + dc_crtc_disable_at_unbind(crtc); +} + +static const struct component_master_ops dc_drm_ops = { + .bind = dc_drm_bind, + .unbind = dc_drm_unbind, +}; + +static int dc_probe(struct platform_device *pdev) +{ + struct component_match *match = NULL; + struct dc_priv *priv; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->clk_cfg = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(priv->clk_cfg)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cfg), + "failed to get cfg clock\n"); + + dev_set_drvdata(&pdev->dev, priv); + + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) + return ret; + + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; + + ret = devm_of_platform_populate(&pdev->dev); + if (ret) + return ret; + + dc_add_components(&pdev->dev, &match); + + ret = component_master_add_with_match(&pdev->dev, &dc_drm_ops, match); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to add component master\n"); + + return 0; +} + +static void dc_remove(struct platform_device *pdev) +{ + component_master_del(&pdev->dev, &dc_drm_ops); +} + +static int dc_runtime_suspend(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + + clk_disable_unprepare(priv->clk_cfg); + + return 0; +} + +static int dc_runtime_resume(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + int ret; + + ret = clk_prepare_enable(priv->clk_cfg); + if (ret) + dev_err(dev, "failed to enable cfg clock: %d\n", ret); + + return ret; +} + +static int dc_suspend(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + + return drm_mode_config_helper_suspend(priv->drm); +} + +static int dc_resume(struct device *dev) +{ + struct dc_priv *priv = dev_get_drvdata(dev); + + return drm_mode_config_helper_resume(priv->drm); +} + +static void dc_shutdown(struct platform_device *pdev) +{ + struct dc_priv *priv = dev_get_drvdata(&pdev->dev); + + drm_atomic_helper_shutdown(priv->drm); +} + +static const struct dev_pm_ops dc_pm_ops = { + RUNTIME_PM_OPS(dc_runtime_suspend, dc_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(dc_suspend, dc_resume) +}; + +static const struct of_device_id dc_dt_ids[] = { + { .compatible = "fsl,imx8qxp-dc", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, dc_dt_ids); + +static struct platform_driver dc_driver = { + .probe = dc_probe, + .remove_new = dc_remove, + .shutdown = dc_shutdown, + .driver = { + .name = "imx8-dc", + .of_match_table = dc_dt_ids, + .pm = pm_sleep_ptr(&dc_pm_ops), + }, +}; + static struct platform_driver * const dc_drivers[] = { &dc_cf_driver, &dc_de_driver, @@ -19,6 +259,7 @@ static struct platform_driver * const dc_drivers[] = { &dc_lb_driver, &dc_pe_driver, &dc_tc_driver, + &dc_driver, }; static int __init dc_drm_init(void) diff --git a/drivers/gpu/drm/imx/dc/dc-drv.h b/drivers/gpu/drm/imx/dc/dc-drv.h index 3b11f4862c6c..827318f1dbf3 100644 --- a/drivers/gpu/drm/imx/dc/dc-drv.h +++ b/drivers/gpu/drm/imx/dc/dc-drv.h @@ -6,19 +6,40 @@ #ifndef __DC_DRV_H__ #define __DC_DRV_H__ +#include #include #include +#include +#include "dc-crtc.h" #include "dc-de.h" +#include "dc-kms.h" #include "dc-pe.h" +#include "dc-plane.h" struct dc_drm_device { struct drm_device base; + struct dc_crtc dc_crtc[DC_CRTCS]; + struct dc_plane dc_primary[DC_PRIMARYS]; + struct drm_encoder encoder[DC_ENCODERS]; struct dc_de *de[DC_DISPLAYS]; struct dc_pe *pe; + atomic_t pe_rpm_count; }; +static inline struct dc_drm_device *to_dc_drm_device(struct drm_device *drm) +{ + return container_of(drm, struct dc_drm_device, base); +} + +int dc_crtc_init(struct dc_drm_device *dc_drm, int crtc_index); + +int dc_kms_init(struct dc_drm_device *dc_drm); +void dc_kms_uninit(struct dc_drm_device *dc_drm); + +int dc_plane_init(struct dc_drm_device *dc_drm, struct dc_plane *dc_plane); + extern struct platform_driver dc_cf_driver; extern struct platform_driver dc_ed_driver; extern struct platform_driver dc_de_driver; diff --git a/drivers/gpu/drm/imx/dc/dc-kms.c b/drivers/gpu/drm/imx/dc/dc-kms.c new file mode 100644 index 000000000000..f629696ca451 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-kms.c @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dc-crtc.h" +#include "dc-de.h" +#include "dc-drv.h" +#include "dc-kms.h" + +static const struct drm_mode_config_funcs dc_drm_mode_config_funcs = { + .fb_create = drm_gem_fb_create, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, +}; + +static int dc_kms_init_encoder_per_crtc(struct dc_drm_device *dc_drm, + int crtc_index) +{ + struct dc_crtc *dc_crtc = &dc_drm->dc_crtc[crtc_index]; + struct drm_device *drm = &dc_drm->base; + struct drm_crtc *crtc = &dc_crtc->base; + struct drm_connector *connector; + struct device *dev = drm->dev; + struct drm_encoder *encoder; + struct device_node *remote; + struct drm_bridge *bridge; + int ret = 0; + + remote = of_graph_get_remote_node(dc_crtc->de->dev->of_node, 0, -1); + if (!of_device_is_available(remote)) + goto out; + + bridge = of_drm_find_bridge(remote); + if (!bridge) { + ret = -EPROBE_DEFER; + dev_err_probe(dev, ret, "failed to find bridge for CRTC%u\n", + crtc->index); + goto out; + } + + encoder = &dc_drm->encoder[crtc_index]; + ret = drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE); + if (ret) { + dev_err(dev, "failed to initialize encoder for CRTC%u: %d\n", + crtc->index, ret); + goto out; + } + + encoder->possible_crtcs = drm_crtc_mask(crtc); + + ret = drm_bridge_attach(encoder, bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (ret) { + dev_err(dev, + "failed to attach bridge to encoder for CRTC%u: %d\n", + crtc->index, ret); + goto out; + } + + connector = drm_bridge_connector_init(drm, encoder); + if (IS_ERR(connector)) { + ret = PTR_ERR(connector); + dev_err(dev, "failed to init bridge connector for CRTC%u: %d\n", + crtc->index, ret); + goto out; + } + + ret = drm_connector_attach_encoder(connector, encoder); + if (ret) + dev_err(dev, + "failed to attach encoder to connector for CRTC%u: %d\n", + crtc->index, ret); + +out: + of_node_put(remote); + return ret; +} + +int dc_kms_init(struct dc_drm_device *dc_drm) +{ + struct drm_device *drm = &dc_drm->base; + int ret, i; + + ret = drmm_mode_config_init(drm); + if (ret) + return ret; + + atomic_set(&dc_drm->pe_rpm_count, 0); + + drm->mode_config.min_width = 60; + drm->mode_config.min_height = 60; + drm->mode_config.max_width = 8192; + drm->mode_config.max_height = 8192; + drm->mode_config.funcs = &dc_drm_mode_config_funcs; + + drm->vblank_disable_immediate = true; + drm->max_vblank_count = DC_FRAMEGEN_MAX_FRAME_INDEX; + + for (i = 0; i < DC_CRTCS; i++) { + ret = dc_crtc_init(dc_drm, i); + if (ret) + return ret; + + ret = dc_kms_init_encoder_per_crtc(dc_drm, i); + if (ret) + return ret; + } + + ret = drm_vblank_init(drm, DC_CRTCS); + if (ret) { + dev_err(drm->dev, "failed to init vblank support: %d\n", ret); + return ret; + } + + drm_mode_config_reset(drm); + + drm_kms_helper_poll_init(drm); + + return 0; +} + +void dc_kms_uninit(struct dc_drm_device *dc_drm) +{ + drm_kms_helper_poll_fini(&dc_drm->base); +} diff --git a/drivers/gpu/drm/imx/dc/dc-kms.h b/drivers/gpu/drm/imx/dc/dc-kms.h new file mode 100644 index 000000000000..4f66b11c106a --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-kms.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_KMS_H__ +#define __DC_KMS_H__ + +#include "dc-de.h" + +#define DC_CRTCS DC_DISPLAYS +#define DC_ENCODERS DC_DISPLAYS +#define DC_PRIMARYS DC_DISPLAYS + +#endif /* __DC_KMS_H__ */ diff --git a/drivers/gpu/drm/imx/dc/dc-plane.c b/drivers/gpu/drm/imx/dc/dc-plane.c new file mode 100644 index 000000000000..a49b043ca167 --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-plane.c @@ -0,0 +1,227 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dc-drv.h" +#include "dc-fu.h" +#include "dc-plane.h" + +#define DC_PLANE_MAX_PITCH 0x10000 +#define DC_PLANE_MAX_PIX_CNT 8192 + +static const uint32_t dc_plane_formats[] = { + DRM_FORMAT_XRGB8888, +}; + +static const struct drm_plane_funcs dc_plane_funcs = { + .update_plane = drm_atomic_helper_update_plane, + .disable_plane = drm_atomic_helper_disable_plane, + .destroy = drm_plane_cleanup, + .reset = drm_atomic_helper_plane_reset, + .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, +}; + +static int dc_plane_check_no_off_screen(struct drm_plane_state *state, + struct drm_crtc_state *crtc_state) +{ + if (state->dst.x1 < 0 || state->dst.y1 < 0 || + state->dst.x2 > crtc_state->adjusted_mode.hdisplay || + state->dst.y2 > crtc_state->adjusted_mode.vdisplay) { + dc_plane_dbg(state->plane, "no off screen\n"); + return -EINVAL; + } + + return 0; +} + +static int dc_plane_check_max_source_resolution(struct drm_plane_state *state) +{ + int src_h = drm_rect_height(&state->src) >> 16; + int src_w = drm_rect_width(&state->src) >> 16; + + if (src_w > DC_PLANE_MAX_PIX_CNT || src_h > DC_PLANE_MAX_PIX_CNT) { + dc_plane_dbg(state->plane, "invalid source resolution\n"); + return -EINVAL; + } + + return 0; +} + +static int dc_plane_check_fb(struct drm_plane_state *state) +{ + struct drm_framebuffer *fb = state->fb; + dma_addr_t baseaddr = drm_fb_dma_get_gem_addr(fb, state, 0); + + /* base address alignment */ + if (baseaddr & 0x3) { + dc_plane_dbg(state->plane, "fb bad baddr alignment\n"); + return -EINVAL; + } + + /* pitches[0] range */ + if (fb->pitches[0] > DC_PLANE_MAX_PITCH) { + dc_plane_dbg(state->plane, "fb pitches[0] is out of range\n"); + return -EINVAL; + } + + /* pitches[0] alignment */ + if (fb->pitches[0] & 0x3) { + dc_plane_dbg(state->plane, "fb bad pitches[0] alignment\n"); + return -EINVAL; + } + + return 0; +} + +static int +dc_plane_atomic_check(struct drm_plane *plane, struct drm_atomic_state *state) +{ + struct drm_plane_state *plane_state = + drm_atomic_get_new_plane_state(state, plane); + struct drm_crtc_state *crtc_state; + int ret; + + /* ok to disable */ + if (!plane_state->fb) + return 0; + + if (!plane_state->crtc) { + dc_plane_dbg(plane, "no CRTC in plane state\n"); + return -EINVAL; + } + + crtc_state = + drm_atomic_get_existing_crtc_state(state, plane_state->crtc); + if (WARN_ON(!crtc_state)) + return -EINVAL; + + ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, + DRM_PLANE_NO_SCALING, + DRM_PLANE_NO_SCALING, + true, false); + if (ret) { + dc_plane_dbg(plane, "failed to check plane state: %d\n", ret); + return ret; + } + + ret = dc_plane_check_no_off_screen(plane_state, crtc_state); + if (ret) + return ret; + + ret = dc_plane_check_max_source_resolution(plane_state); + if (ret) + return ret; + + return dc_plane_check_fb(plane_state); +} + +static void +dc_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) +{ + struct drm_plane_state *new_state = + drm_atomic_get_new_plane_state(state, plane); + struct dc_plane *dplane = to_dc_plane(plane); + struct drm_framebuffer *fb = new_state->fb; + const struct dc_fu_ops *fu_ops; + struct dc_lb *lb = dplane->lb; + struct dc_fu *fu = dplane->fu; + dma_addr_t baseaddr; + int src_w, src_h; + int idx; + + if (!drm_dev_enter(plane->dev, &idx)) + return; + + src_w = drm_rect_width(&new_state->src) >> 16; + src_h = drm_rect_height(&new_state->src) >> 16; + + baseaddr = drm_fb_dma_get_gem_addr(fb, new_state, 0); + + fu_ops = dc_fu_get_ops(dplane->fu); + + fu_ops->set_layerblend(fu, lb); + fu_ops->set_burstlength(fu, baseaddr); + fu_ops->set_src_stride(fu, fb->pitches[0]); + fu_ops->set_src_buf_dimensions(fu, src_w, src_h); + fu_ops->set_fmt(fu, fb->format); + fu_ops->set_framedimensions(fu, src_w, src_h); + fu_ops->set_baseaddress(fu, baseaddr); + fu_ops->enable_src_buf(fu); + + dc_plane_dbg(plane, "uses %s\n", fu_ops->get_name(fu)); + + dc_lb_pec_dynamic_prim_sel(lb, dc_cf_get_link_id(dplane->cf)); + dc_lb_pec_dynamic_sec_sel(lb, fu_ops->get_link_id(fu)); + dc_lb_mode(lb, LB_BLEND); + dc_lb_blendcontrol(lb); + dc_lb_position(lb, new_state->dst.x1, new_state->dst.y1); + dc_lb_pec_clken(lb, CLKEN_AUTOMATIC); + + dc_plane_dbg(plane, "uses LayerBlend%u\n", dc_lb_get_id(lb)); + + /* set ExtDst's source to LayerBlend */ + dc_ed_pec_src_sel(dplane->ed, dc_lb_get_link_id(lb)); + + drm_dev_exit(idx); +} + +static void dc_plane_atomic_disable(struct drm_plane *plane, + struct drm_atomic_state *state) +{ + struct dc_plane *dplane = to_dc_plane(plane); + const struct dc_fu_ops *fu_ops; + int idx; + + if (!drm_dev_enter(plane->dev, &idx)) + return; + + /* disable fetchunit in shadow */ + fu_ops = dc_fu_get_ops(dplane->fu); + fu_ops->disable_src_buf(dplane->fu); + + /* set ExtDst's source to ConstFrame */ + dc_ed_pec_src_sel(dplane->ed, dc_cf_get_link_id(dplane->cf)); + + drm_dev_exit(idx); +} + +static const struct drm_plane_helper_funcs dc_plane_helper_funcs = { + .atomic_check = dc_plane_atomic_check, + .atomic_update = dc_plane_atomic_update, + .atomic_disable = dc_plane_atomic_disable, +}; + +int dc_plane_init(struct dc_drm_device *dc_drm, struct dc_plane *dc_plane) +{ + struct drm_plane *plane = &dc_plane->base; + int ret; + + ret = drm_universal_plane_init(&dc_drm->base, plane, 0, &dc_plane_funcs, + dc_plane_formats, + ARRAY_SIZE(dc_plane_formats), + NULL, DRM_PLANE_TYPE_PRIMARY, NULL); + if (ret) + return ret; + + drm_plane_helper_add(plane, &dc_plane_helper_funcs); + + dc_plane->fu = dc_drm->pe->fu_disp[plane->index]; + dc_plane->cf = dc_drm->pe->cf_cont[plane->index]; + dc_plane->lb = dc_drm->pe->lb[plane->index]; + dc_plane->ed = dc_drm->pe->ed_cont[plane->index]; + + return 0; +} diff --git a/drivers/gpu/drm/imx/dc/dc-plane.h b/drivers/gpu/drm/imx/dc/dc-plane.h new file mode 100644 index 000000000000..e72c3a7cb66f --- /dev/null +++ b/drivers/gpu/drm/imx/dc/dc-plane.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2024 NXP + */ + +#ifndef __DC_PLANE_H__ +#define __DC_PLANE_H__ + +#include + +#include +#include + +#include "dc-fu.h" +#include "dc-pe.h" + +#define dc_plane_dbg(plane, fmt, ...) \ +do { \ + typeof(plane) _plane = (plane); \ + drm_dbg_kms(_plane->dev, "[PLANE:%d:%s] " fmt, \ + _plane->base.id, _plane->name, ##__VA_ARGS__); \ +} while (0) + +struct dc_plane { + struct drm_plane base; + struct dc_fu *fu; + struct dc_cf *cf; + struct dc_lb *lb; + struct dc_ed *ed; +}; + +static inline struct dc_plane *to_dc_plane(struct drm_plane *plane) +{ + return container_of(plane, struct dc_plane, base); +} + +#endif /* __DC_PLANE_H__ */ From patchwork Fri Jul 5 09:09:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13724634 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 D872FC30658 for ; Fri, 5 Jul 2024 09:01:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63DA910E236; Fri, 5 Jul 2024 09:01:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="qk/8mGsA"; dkim-atps=neutral Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3247310E236 for ; Fri, 5 Jul 2024 09:01:55 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dsC+1szMCycAtXLji6XPHjqbV+wYRaU46GR3TjuL3vMeBNIvfkFAerjAcIgB6smIc5wt+fTmEDPRYHaRCQkvB/+ItcRBzOqJZhpTstXdCYsE7vjhEJnPBJGMPwtBd+Kj1tCSFm7KXEhUcj636TZhAWQJQ8JKsX/PTbDctHWD/qEsft3IHnrWEJBT3Vb8nWESVl2Bj03M/qJA0RvEHb0KBQEuC1Qnq9OZsWRZddqlZsOS71Rotv2Wr4KF89CvIYQ1lLoNqDeWlEl2QsVJAhmgm43n3Be+62mrk28/c4ShVkfpoFGmnnmTOHNQmHGXS7vjbK1e1D0ieoCdiTW6AtxWUA== 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=0onEkYsCpb4TyXKESfp4UE6eeOBu6AQ2Fei7XQzRTeE=; b=Jh79UU15dXjTRu24NY9eqn6lgVcY9dwv6bS0wNPw/fwDsz7VGFD1JYp0TzXZxCqXsVOGR0fyWTL2YkREKYtyS7glV6IoMfzdGUirEUyMb5ypp9J7WqhSu0GmYPvNKPzk0lPrsSXFJ4W6kquHFsZq8GmnNYnIDV6TFcxuOIfgym5B5/HNJruT137VaKpgLuFHiN65JUTbbGXsyhpgzSyj436Ap+MyZ01rWJE4968VeS6TVZSl62hwovls6vObXz5zy9RqCfOYM1hHrY10S/GNSgbf65Zbl72fHEd1Rs68VcjPtlcc+Nnxk+Od+ze4x6wWyQzsKS3NI5NW9f8heoWYcA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0onEkYsCpb4TyXKESfp4UE6eeOBu6AQ2Fei7XQzRTeE=; b=qk/8mGsAb+0T2fEm1GkX7NAHfbGpqRLp0M+Uzu142pKUhSwoO+GgcpBSTIRRw5LXl9mItrsKGqW5YFfmJFFKDYFo6uHXGoaS1YqM6fkml0psG8IPpp7jrYs+eqEA3q8vVzoFXAfhLdL4o7QWZ0MtWcGkzAxPyGepq/CMzjzQnzo= 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 AS8PR04MB8038.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Fri, 5 Jul 2024 09:01:52 +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.7741.027; Fri, 5 Jul 2024 09:01:52 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, tglx@linutronix.de Subject: [PATCH 10/10] MAINTAINERS: Add maintainer for i.MX8qxp Display Controller Date: Fri, 5 Jul 2024 17:09:32 +0800 Message-Id: <20240705090932.1880496-11-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240705090932.1880496-1-victor.liu@nxp.com> References: <20240705090932.1880496-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0110.apcprd03.prod.outlook.com (2603:1096:4:91::14) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8038:EE_ X-MS-Office365-Filtering-Correlation-Id: bf337f2d-a8fa-44b8-56a1-08dc9cd11c6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: f7Dbn9jKnDoAnRXfGaQkuEkcMURxJ0pQEraa5576iuEVFL71mlmhXWSe/+3Arn77l74bbLej5bh51IEHTodaz2MdDhrAgFnxuYNKmiZ36MHFW3Kvn3sLPa1XP9AXU7GLtSVcwVNpAebozyRk2EdwNFVAxq0EsNI6hdMrKEzhyuZGvlACPJxax4G4I9YJieAxplZ4xU/6J/07wD0AFqQgLrzBxTVF4rjz6nBLLKrNpXYQnwnrIj7pNQMGMdYll7cJunrT2L/QC4qiE030FGKcWPKRKf9ClyTwQ5jYZWqWi8cT47L8yszRVVQrx5Gn8ZH88fqz3ubOCfm6eHXgxmZDqWgcmDPMBbNbXXsUxk54FQP7ledRZoA6XJektOFuALhukLvEU+hb8YpcHj/KUczaV5Q/LNXbQdopQQy2Jg25yqICVDoh0i/gtC046Ywgx7OVlNuF7XYgDHJtGJQbhFGOI7sTbx5PrkVPc1wEPtE4vl23YgC9fKZJaWAEOqEMpwg63BwWmswmLd+DaaTgWurF6wcl5s6QkX/i5do8VT1f4SdDhE5QWSnuge05BL8M/W7BVwLy8OwG73ZEYGTk6u4DLsvNbbALZC8HrbP2KosNLpH9+mJN4UX/8FgyUVBUdkkLp7T9f74JM4nqhn1q884OU7c0+NkIpt6QvgSWhZunwNK4EiG+lD0NG/1BYqZFK4n9urwKUZTM3Wl8qNTu6XGikiDMm+DUrarmIzGOfBBMI0ImPvSmYVCK5rETS5IF2iF2C4XGZs7QsFiVIl9nNmw3HeQ7HkvUzJdwBNS7f0sqWfHcNvPK6/jnPM73/dDY8AXp60wb2GhK5yeGvqZ5M29QZ5K6wL2MGRtvcZ3VNKgo3+X0R+hoW+SrPLvUmDTXNoE1IVk6fb+P4D1Fsx4PUEUIXRgul+VuTE4oE1jfr3z98OfZDB8TBb5uMqeUYXSYm0NwdQV5Iu4SXFWeNfX8ToZUI1/V8swXCL7Vssl6c5hT5wYpmaWrw1TcJ6BTqDb8ibcyKxvt/dt6IK5nyrmrXbtmbfhWkIU/wCxOkI2OYgVsgnYklXJIODl8Eg+whJ/zogDWavSoyJVUvRsJNZjPp6c5kJKQx3SyEcQBKWelf3eoKCKdqqPUIgw6CMbMs5eD69BZfpZMHcKiNAn59B3hEQneLSyoCXjP/ZrdFUwqQGN80PvSyQLbd+D/2QYaf4CoRcRMGEcxaGs9ruitzyX0V2zAPMHP0+GAnquduAzZNEhukkWgYfZKmuCbeO8MxZy1Z05z2v5CXqfVFL4YvzzkQoZAVEjLGm4tzOJ3M/meaBphBrSg3Unv26f9c6Hm3TMHexqKj0v5iLLF8lAHC4hUZyYZKuZNg6FD4ZoES3abBoFVQEc= 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)(1800799024)(7416014)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 71mU7FPIRCo8A2xe6X7CpslF49Dwr114suFQi5XBFZZ5GcHYE/ADlND2TdXj1OTachMHxfzbdWf73PlS6RwOUhSrAJNJdmiGpd+8VvE3JuC4K8+LMs0jboPke9tpJsPU8djWeb4IM808ImkFen2NfcthRnOTjz2swuhUVdXiYX5l4PtUT0Dk1bLZLqmX/YO97e3URZug567vR1CmbR4guYJj5xg4P5Q9i3lIRAAH0PQ21tzXwzjhQmWZPbI7F/FHK8h3rMTpZtrOb10ipBxLXLxzssNF5N1Bs/8C9uSPYuPsAEn4r22mfFgcLkhcUV/Z9uPljMc0MeVQvK6z/zIstc1pLNAq1bhA8QyiN9ExNFlAdlMKQnLmuJ8laN+29olhsbfe9tbYrBtXptKdCc03KFzDv4sll0Yw5/MDY/AWaeylUbrnUR4TR4+RBknInx7Axji2zhWsBAUadn8qOnR6BtoA05yBMWg1mJUfyEs8/iqB1xqfZGD4JbFhGHK17r4CAe7OCTi5GyvrTDRpCkhYWan+8lNLu9zN4grDCJN58vajOFL9KA1Y3fYp8+noRx48Ptyxv1DthLJD5F4xl9Y2TuunxTdh+26os5Xvs4yU+HRY9ZQ+n1KWAFvY/RvaAeHCLMvrGO2mjvje/GpDqGqCTfn3ScHF0VdWK15svEu7hiQneJiMXPuqfvUc5oOkR2OcYuaChL9nZIgkO9NqrqP+rMeqO1hXgSNcpaiZwzfXH+akPNfrPNaghk0id9T3XantCCw/Q0P+35sbCLL7OGFutHL5ZrC67+AWVfhz6IjIHyJRpYupb82oID8vHvFZ54nAASJAhMNeJj69cCa9b1VGFPjTWACb8WrJuLZi3Sbn76fQJClvZ+tZauuxHEfdFKHe82TWWN3L7kDPFRz1PfhaBEVuYiFrPVThAqNcI+YgGYXx2WPujYt5A1H+9Zjm3GBek/6I51M52DXoVnbiALGNTLG51tHY2wVP8FqKpTTWv2jWj48RFCNEuCtJWxdji87fUS6I/doky30+v4qtso6/+X0cimdCLtD1wC4ckrYggqg1aS/jaMude28XEDJ5I+1ZNXZAfKgtsAAYqysb+FGK4QHZEEM/fyJ+m1kyWRkB52MoTf7ag8ZNlUNknlHPkZvvwdlMne+3sUPVc0AsjaBk0h5yHfc6HJMfMLzYjylZlPmLUorQVJGoe6DZDeTHY1dXkcwTo4r6q3uVW2sJsHBinOmCQO2bsR3DU8J2btTEvzVptPrJZhD9E6Fl0R/0szTvSJLBIVgsPWRBKDxsCI+lzUZ2HrJQszwI5pHk5hqqaWsKZRghu5Whx3HhgxeexdaJFcbQfF1xYbgSlL3gPCRdIwKjGQG0BTOxQVgboPmu2ulbHmFBo+La7X79x1G3LdaZ22TysOy7fWyMY/UKCR44V8ZT6dB7P/MvHLE+8vmJqAud44rUY2L0o8A7I8Rv6Vs9yvDyoT0Mh6gygyUEWNuVuRtQv4nJKPA5iQpqaidcXGWaNxi8CZYp1QYdNF+lsWl7Z0NOEHdbTqK64JdM60l3mBzGbi8YgxdXHTtiCUQ5tvel4gzjA5DspSOrMS8gVuvv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf337f2d-a8fa-44b8-56a1-08dc9cd11c6b X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 09:01:52.0639 (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: scHpJtnZw1ZdaTbQJ5UgWVvwUljD+vRhMIQOZozynMnXo5Vl/iHTIBMEwNwaVr3z4a3Z+oA0VcHafpm6pqWVAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8038 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" Add myself as the maintainer of i.MX8qxp Display Controller. Signed-off-by: Liu Ying --- MAINTAINERS | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 35db18d26c11..29c9d52e74d1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7379,6 +7379,25 @@ F: Documentation/devicetree/bindings/display/imx/ F: drivers/gpu/drm/imx/ipuv3/ F: drivers/gpu/ipu-v3/ +DRM DRIVERS FOR FREESCALE IMX8 DISPLAY CONTROLLER +M: Liu Ying +L: dri-devel@lists.freedesktop.org +S: Maintained +T: git https://gitlab.freedesktop.org/drm/misc/kernel.git +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-constframe.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-display-engine.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-extdst.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchlayer.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchunit-common.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-fetchwarp.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-framegen.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-intc.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-layerblend.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-pixel-engine.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc-tcon.yaml +F: Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-dc.yaml +F: drivers/gpu/drm/imx/dc/ + DRM DRIVERS FOR FREESCALE IMX BRIDGE M: Liu Ying L: dri-devel@lists.freedesktop.org