From patchwork Mon May 8 05:57:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234070 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 E973EC77B73 for ; Mon, 8 May 2023 05:53:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25C2110E08A; Mon, 8 May 2023 05:53:17 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2044.outbound.protection.outlook.com [40.107.13.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id A674210E08A for ; Mon, 8 May 2023 05:53:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqhq0fa287zTbKI/yExq7STQCXo201S/MLumVSwBPpzswcgftJF/aJZGdKuoy1usjeTeNFONrxplwiBQFmOx/lw47LCCOn0ZuCa8bRPkby9dC96tZ1xNE1Mg5La9EXFxarkN7HKLnGT0IS18RUByQ76qao3QoIis7jwmBCVLr1vmsfSrcqQp0kLVz71EEy1N/W6M7aSE6rAe45k2rpPpE9NACD4jYvB6dltvqecH1FiBswTBecOsJLYOj0pQcezBwA8DLhLrU0qzeMsVCFiHdP4vorIy1ues4gY+qBd0PDVEIFxXYT5K2NGXFxU6F3d4tqv3oPlHLdp2XGE6rSNZfA== 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=rTqmd6wjKDTiYonnYhCMa3pTYWUODQo5SE5fXcvBTG8=; b=jdw/Lrrds/KWIta1ofk29iBdmBQf4pc2/F3eoqdax+skTJTXZFjAa2bG088VIK71Miicrwb6aD4qc0Jx2cIh+AZ53ZcIcnv3tESYGM8vMDdhuuGt/1ArqLAHttyszf5x2rA9oP4GABL3beUnCd8dpldpnEhFJW9/Jkj7h71ApRN4xwH8KmH/jLAf3qE8dgNLDr49AwmAJUxmwKfidHDKKZIbDBvLbpVh51CsQPHX10e3OQa6b8CF4BJ4StyEg0seMwTqsMrOHF4aG+Qyvl3bMZimqKCKhZf4O+DuU5jDW+WKNVfTcnuT27Rue8Ed0MGhJ/g/TKQkWqgfyY+guAKz6w== 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=rTqmd6wjKDTiYonnYhCMa3pTYWUODQo5SE5fXcvBTG8=; b=JKO1FVIvHxnzV21tLJhK2SPl1WV2WUolVdxYRkaKAVfxcmxHBRlmc9xazDpaW+34ffR7JH5GBl94NNzqna9X/yiIpjWS3TEVhulCcWFwviEVvHsBo9oxzwf+ODfWPnec/LrZSeoi1H4eqbNqGBQn5wa3Gw+rmnH8oqQGJxBWzio= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:13 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:12 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/6] dt-bindings: lcdif: Add i.MX93 LCDIF support Date: Mon, 8 May 2023 13:57:35 +0800 Message-Id: <20230508055740.635256-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: 05693f9e-36d9-421a-36f9-08db4f88827e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GNw7hpwz3C8fu4/A49kZUOy2zfh0Ugjg2bsQOD2AQOE+59tvJLNNANV44BmS2aZeKKPcxcbEUN5OQ9jI9M5T8uK4sJaI7lN1Zn97OSjr+eUPjgaJsmK0R3O17doumz9Pzve+XJJ/OhpWaxCdE+lzFZPeAoQRTO4CLXMffWH3Rh+mM37mYN8mvSXR/vH6UfVWTZVDUE9Tkj2QpMrxSsEPLkg/3GzZaygUBL3D4OPpTVvrGnjMqMt0aU2iiYUw3twSw8vgiXqj1VBypdmsnQieLbiv0LcuYwTY4A82iqdxOGlRvdc5lBl9ArnWq6stNkRXbSdgWPfXLMNBRRlqezf1UrP1GXnXMXPzgOEZJy7+vesPTRsvOhnesfgoGtGWUW5LWAZqcsiAf/gi9yTiLXt7JoxQuMVbrpZNfly0edEJLDMnihzz7j5vCMeWIiHYpYJ83KwZoL2rWa+QaS2sNDoI94PHDN12hdjDAhVd1HTUdRJ3gzE6vWAS2AjVGYuxvPljHYorouqud9RJJCyJzFMyJEdE9QqFE4CGY/qPoBGO4W3cFv9D2D0m61mzJnORUF00XPvmYwIkdD4EoDxrfrFqLYHewabJv51bhGmWJqK162fNJ/uMJr3p3clR3q8veQBf 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(6666004)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6ZG1IjuQejF5nrbBkWCRHwY7SI6sLdF0ywtRQFSWHuRjRXhIMoC02sgiATRcZ8fX6HQyRWc28114XJkO4mmV0JRvNsCHxnSwJGSlTuTrFWuamZe+ntZKvmpYZeZg3N+iBouZE8vhfkhmDJ1NyZNObS3V7otw0JJiY2bzuuX3wS89bNaBVeEfC1ZCjjbY942KtiJhggefKicdYyzjZgE3ii9EBX0vXah+lfKVqOU9D0ZHJAHnYCzIVmqxenbmVLneewnVfm6MFEZ6h+Jt2BYpip5ci9KVtFC3inI5K5H8jAWjf4uGScGP9g1U3AntxhPyh33Pa+v3IbNjsnTiAP24/Bu5ePu67E8ag4FnL3y8t7607WpbDa+ONURIeIEp8Pr8MEZ/1w8gvBOHK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odv/4Bq5FElyYbvzxVmbGGQ9r+rbPwrz76PhydobkRaJABv84VBNukInhLP+ZIcmuPd2msKyGDt5eEQ2luFJ1vyUAEAlH1UEfzQ+PevLN2uRPTlCAk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05693f9e-36d9-421a-36f9-08db4f88827e X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:12.8951 (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: +0tTLWPOuUmA5XuyYiB1bthG7Btae6cIV42wf5/WGgb9O7ZuhXJJ/q+oV97zXKc9FueCTHhsnQle3IjooH2Cvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is one LCDIF embedded in i.MX93 SoC to connect with MIPI DSI controller through LCDIF cross line pattern(controlled by mediamix blk-ctrl) or connect with LVDS display bridge(LDB) directly or connect with a parallel display through parallel display format(also controlled by mediamix blk-ctrl). i.MX93 LCDIF IP is essentially the same to i.MX8MP LCDIF IP. Add device tree binding for i.MX93 LCDIF. Acked-by: Krzysztof Kozlowski Reviewed-by: Marek Vasut Reviewed-by: Alexander Stein Signed-off-by: Liu Ying --- v4->v5: * No change. v3->v4: * Add Alexander's R-b tag. v2->v3: * No change. v1->v2: * Add Krzysztof's A-b and Marek's R-b tags. Documentation/devicetree/bindings/display/fsl,lcdif.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml index 75b4efd70ba8..fc11ab5fc465 100644 --- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml +++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml @@ -21,6 +21,7 @@ properties: - fsl,imx28-lcdif - fsl,imx6sx-lcdif - fsl,imx8mp-lcdif + - fsl,imx93-lcdif - items: - enum: - fsl,imx6sl-lcdif @@ -88,7 +89,9 @@ allOf: properties: compatible: contains: - const: fsl,imx8mp-lcdif + enum: + - fsl,imx8mp-lcdif + - fsl,imx93-lcdif then: properties: clocks: @@ -107,6 +110,7 @@ allOf: enum: - fsl,imx6sx-lcdif - fsl,imx8mp-lcdif + - fsl,imx93-lcdif then: properties: clocks: @@ -123,6 +127,7 @@ allOf: - fsl,imx8mm-lcdif - fsl,imx8mn-lcdif - fsl,imx8mp-lcdif + - fsl,imx93-lcdif then: required: - power-domains From patchwork Mon May 8 05:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234071 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 18B87C77B73 for ; Mon, 8 May 2023 05:53:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B53F710E092; Mon, 8 May 2023 05:53:22 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8928310E092 for ; Mon, 8 May 2023 05:53:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n3Om46VrfeyfuWOXlfjpiZi97Lk6ZDlqqk/tnB6n/YX70VkLGC+PQ59x6oyO0lAiUvgrkccLmzWhTpAfcN56W6C9z22yvvayf7hz7rDnU0ZzUz3GRFLDlqF5hJsP1fGcZYQ1Yd3+e5NqxhTMVELB80grs3TqR3IB2OwQF2pysaww/6YJyiuI2+U0jcrlC8mbc4JWbqo3O5P155EBPjmW9Og6rWb6J77t7IJY6RqZHfHL+yYttYxcx996vi0bI3V2Ea64HPrXsO9IfjgIJ4uHUTyLG/UwLAwLbOtYz0jmqKMiPvVXUqqwC/6VDMO05X7rgkGfVS30yp1UGpwuwPfNiA== 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=+T2UgmWqFAqKDrhvvPSzZ+mh+ccd4yNvwL0/htpdppc=; b=I30wnUoTWM2QfEsFJyRVEZXiTPE2PW8B6s769OAHRbK5HmpPNx0+1GiPq+5qriE0343d4cpYy2gYI0DBFX0C4iaydUw2qhUJBFG6DGkbhd0S3KsCM8KnOf19ichhxtaTfNVWvdudg4acsP454HUgMhJ2bFgBtFFlTZ2STP9WzhCcfFTjfbJAxre4gcSyJTfopNSyJHDG1QZdTiympNPJSTGyHc+toHBRzWhf0wnqxoiHeB4EE0WizMd6AJC3bHcoa9ULyrtx8S5jtNxB1RpN3zwP7EKykiWLIi6A1N/56utyaB22wvrpLIPBEpvhTU2jYIzvzwTtXjKTVv2exksN0A== 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=+T2UgmWqFAqKDrhvvPSzZ+mh+ccd4yNvwL0/htpdppc=; b=alqcUNXSR3z1IrvypODFKOjALRZHrOD7UzdyMFj6gtGsLYsw+7qrYfMGRb0We8iCjOCw6g0kXoUFx2LZwMC8X9WEwsCK+IxR62Aq+Y4xHBq5pO+XFNixxCK2v5lglAhpHxATWIXVU3IJ6oDlrvUl+5K0MyhYZoPmcWtbn2fk0yE= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:18 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:18 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 2/6] drm: lcdif: Drop unnecessary NULL pointer check on lcdif->bridge Date: Mon, 8 May 2023 13:57:36 +0800 Message-Id: <20230508055740.635256-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: bfb6126b-35ba-464d-2a71-08db4f88859f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A1gcnyDVqsj0S3hxFxP5qHO00z1meEGa7Wiyhs60+nTgXMaObJOJhCgODuYpZBdnd2eJuMng9Ru/YTyLkDEojPSmj34Lh+egB5CestK3KHw1LbfBhkv2c6ruIf09Os95QSEHwVh3FWF9WRNnJ5uQC6tySdNd72UlOgsjhGE+DdYHfObqVIxDFjP6AII1WgleeE1BXBPQCdfQBzjWPkn7Ybq26jDomAZLMjxyd/7RT4/HEpLHTOg8BYCPSZZjcYt59jVIV8hM84jecQI1t/K2bLMMjbcAKpqqCbLXaYYaCizfzCL4CIpLBIbCniVCEuRX2dt9kvtn6/0gNdHJ5iNz68L/KdYvwmkv7WBLlEI6a/QY64An3dvoJa8s+A7YyJ3Ir8X2TxddQzyetDZzOItHc3Fru9uEhFANnZ4O6sS+MrUHUiH8oaYRdstPv3JwCr+nLdayFUwDS1KtvlG9UEgepAfvawhfa8wyyPHY9EN6cUxyBmdm//xAZS7O26RVsFD9jKF3+ECOJ4U7ootkWp5j3K5U6Xq7aSRLByFaSv+xMXF0jA8nsWy65xxmQWkJKaMOdJafxjP6nffWflCarLY8f34FAvOprklpye6qp2we0lgRCzVBD3BKWaKDiHanPJJ4 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(6666004)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sDY/XlUWavRNrKnsDsQPxHnGGuR6QQLAWMTcvivWxSLLDaUEUww5CBAzG0m2CJTtuQ2QR1sbHFMrxDE3XIXXVKDsVjCXJ1SE9/2+d2slr/+l4hElAyWAlhJreepNwGKqi3PadvHwpGI/0BYrep6KOz/h/pn37u9XNwDWe2UGrJox7/NjF7lq15amh2bx0kX3Xb/x4AKDNFO55XipKdFqnefmShdfIbnRbzxLlutF/FJXggIB5onUJaAIzGwvWiC9lCDuBGu36Grh8J/ASoI/L+VngIoNP/QwKN+UUBMe1uvoRzJi95yElmnXHZuvDXJpoBWVOmSupRCQ31OM1rPckvb+LxnOA2VQsLI9MQJV4maoh+Hr2XEkAeVFJMpnlP/wlfcrJPuai1x6RDsB6YNloEyaS9+bZ5O7mVkQK1WmhSwQfRwzcdwnnLBBZpnQ+yU9p8Gqgl6/AWmr3St9fGir3TvWyUuF/A7wtx1o9GyDT+RebkxiNGXYSANgl6RlISkzk1fBgbgVIKcVTr43UK8HUp77xyzVzXDzDzpOoGpUEstC6JPPDx6CFpYNRPFfzNOqiSMWoNexZHb4HzTORdoMfwxMz2pugnasmIaKWL2OL3JQYpxhemOiEGyfdDR4iJwfLWXqtPeYh5RdZzaZ1dThFHHMGM1o56AIWPlwWqgWObh4gyFWbReqv6Iru6HtLv9kL+A9CAPUjfoV3ky2dEHmEChYCKfaozLyF03bPa9lXiQybtaKRqUXKfTF3dRMsF3ta5iaURmza3SdyUMdJoi30yoxh925slfxxV2sl8Xpl+Q9wybr7lebX0Phy15ZGnRsLli6VUogsGg+2ymSC+Ciww0Mx1wbf03nxFCTpIgkTr94TaBRY9/+/UsWH1KU1p+mOckwypeG6gF5k+a83XuV8KaUQk24hTxwGPht4Zo+BETmxFtx8FoyuKYxnufHSAO7Sp2ZgSaTdaLoydg1K1R//GRVfQV5NWRV61FXUFQReaDEXM/4jHW4aNbidTF4JJLc3i/lzFpZ5AGVT1UHvHrGghkl6zcoLgdtzmJWlV8WfUL0E1V9+brtYd20tUzSTv2llWY9BYZCWGnCuH0Ufe/8dV1+ZfPgqhj2kVTJM5VSFuYHWOanx+bxHLto773P8UKSVIylNPO/Qbc7DbxiGnpCuVIbfI64icZ4EYEDvAs5qy3v5QqGf/oo1UkNdpHsdyBu1x94MMwWJP8vVIHWA9MurUistkCnwYG7Xlxo0tb9q2R8DF9kS9e5Qpu6WOJEJYnP3/vbTp347JVBe21+zdwp9ylhm7Bs/DKAuLZwOjsnlZwW0s3NJc1rNsOVEFJFNXVfduLgBbtCGCz7qWICCYHo7Z7j9Lm/Ry7r19+oIN9PpGWBNSv+JiIaKd4vG2eXickGGGWDTuXW5LaSGzyeUdFz8n10US0VRNUNdAd5YZOzkD2Syke1dwlVTFuVJSTXWFGjd02LoZpWkOC3Gw2kkO4O7vZCEtF0Rxz+jpVEuWcZVbm0+qtYYjH1pIlC/C1T4H/LGQkWNgjVxW8e9MKABxpV/pM9lh1NpKUEALDPvagUu6QhH30DS/MhL9CQR89nwlUz X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfb6126b-35ba-464d-2a71-08db4f88859f X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:18.1004 (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: 1KG03fBWWCizHXCHZFZEIgvKTFVebqpD60LP9W/rrHyecOl00lG40gMl0ec0W59dCU1FjT5WxCHnE2wSZ7hikQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A valid bridge is already found in lcdif_attach_bridge() and set to lcdif->bridge, so lcdif->bridge cannot be a NULL pointer. Drop the unnecessary NULL pointer check in KMS stage. Tested-by: Alexander Stein Reviewed-by: Alexander Stein Signed-off-by: Liu Ying --- v4->v5: * Add Alexander's T-b tag. v3->v4: * Add Alexander's R-b tag. v2->v3: * No change. v1->v2: * Split from patch 2/2 in v1. (Marek, Alexander) drivers/gpu/drm/mxsfb/lcdif_kms.c | 33 +++++++++++-------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 262bc43b1079..e54200a9fcb9 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -394,7 +394,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; u32 bus_flags = 0; - if (lcdif->bridge && lcdif->bridge->timings) + if (lcdif->bridge->timings) bus_flags = lcdif->bridge->timings->input_bus_flags; else if (bridge_state) bus_flags = bridge_state->input_bus_cfg.flags; @@ -463,30 +463,21 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; struct drm_bridge_state *bridge_state = NULL; struct drm_device *drm = lcdif->drm; - u32 bus_format = 0; + u32 bus_format; dma_addr_t paddr; - /* If there is a bridge attached to the LCDIF, use its bus format */ - if (lcdif->bridge) { - bridge_state = - drm_atomic_get_new_bridge_state(state, - lcdif->bridge); - if (!bridge_state) - bus_format = MEDIA_BUS_FMT_FIXED; - else - bus_format = bridge_state->input_bus_cfg.format; - - if (bus_format == MEDIA_BUS_FMT_FIXED) { - dev_warn_once(drm->dev, - "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" - "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); - bus_format = MEDIA_BUS_FMT_RGB888_1X24; - } - } + bridge_state = drm_atomic_get_new_bridge_state(state, lcdif->bridge); + if (!bridge_state) + bus_format = MEDIA_BUS_FMT_FIXED; + else + bus_format = bridge_state->input_bus_cfg.format; - /* If all else fails, default to RGB888_1X24 */ - if (!bus_format) + if (bus_format == MEDIA_BUS_FMT_FIXED) { + dev_warn_once(drm->dev, + "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" + "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); bus_format = MEDIA_BUS_FMT_RGB888_1X24; + } clk_set_rate(lcdif->clk, m->crtc_clock * 1000); From patchwork Mon May 8 05:57:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234072 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 2D247C77B75 for ; Mon, 8 May 2023 05:53:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A595F10E0B6; Mon, 8 May 2023 05:53:29 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 280C010E0A7 for ; Mon, 8 May 2023 05:53:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HOqmslMGLcorGiwGcQT4PVP1uPlq1P9aLeAPSRMei8gie1wxlMj3YW3op2RKNN1g5fBXjKD1ANw9ok6mVIy6DrJyBvdYoIxKD2Bfe44+RrGEkcDbP+i1AVCcAt22O+j9tk2OMndbdM5wrrH/hskfbchpvmORAk3pXPNXERyivYuq6RHLe2pf8CXr1fYt7G1EJNjBzx4HK558VTdAnO6N3qvk46cdaO+veFENxF03YXGBOnNY3yDoGVGilv8zPN9wgDjn2wD65jA/kFTvAyOA4V0KmBKh4Jw7ktorcVbMboO4qhTs8Kn2+rcX9XfRjaXAzgOf0JeVkX/FErZPHF/yHw== 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=2uDYhMYiKSeTrtovzlXlM/aPxP4hsbKM+VTiwZbdzOo=; b=gotLGXROZU/Zc889YgCq+gViRONBw5WmTdGhrLrVj8Z4rv6weXHYrmYj1NSTal+3lbHrodc9ovxc03+A7FDHu1pWSnn0KA6nxYdhrvfdFZ0kp+uRL/8XRvd3SlvDMG/GFM0iSd+St+zgVk9XvUe4vNQM9ZZ1p12jh3i6uqvwtgzWMX2KjkPUDRfXSrwju9ueiLD3+ut11vUVOfEFT/hUXDkpvv5AxkvmGx5TqNGRwfy2pI9EJFBzsI8Ck6/0nVtBDuZsZLInKcWl0TClns+lzRIvE9fgZCbg3Xx/VllLL+ImkSVReV+ezzpgZz10XZDGpYTK1HOvymFOP3YZQdYJsg== 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=2uDYhMYiKSeTrtovzlXlM/aPxP4hsbKM+VTiwZbdzOo=; b=MLjDQ1vaD5VzBK+7+OPeLOWsmsWDTCwTA3PDk11utvwET/lQFQ54d42oIb0qr7fzWrqgT77aj4agzCkm72OA6AHoKAU64WqjSVvZAHF9mIe+YjFd62GDg5NNdFeP4qQXONeh2D4blm2vp57qI50CjbxKDoRiKjsw7r8JcsS6seA= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:23 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:23 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 3/6] drm: lcdif: Determine bus format and flags in ->atomic_check() Date: Mon, 8 May 2023 13:57:37 +0800 Message-Id: <20230508055740.635256-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: eecf5ab4-c0c7-46cc-f313-08db4f8888b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YfgB+PGT3Bq+PAeAY7YPJgR+58kTftqfi4R4sQk+SYi7/V7vmTZmLc0CEuKQ5In5CuAVDHRv2+Sptk2dqhq80lk5yG8lJB7pHer0f3RXlE5Lhr7xYOlK6YAhX3Felo/FobAMrIl48iK/4+FMzLhtPb+s3wKHZnShc1AuZtaO+p2ohwDBs8fNFYGgbcIFOuJGYlMOKtdmuDVM5Tj3Bu4kc+lMoMdGPWuQNrGtPMrgQRa01nO8k2ikAB3OdZCQkaCE24lyawDmkfYRRKeDejTmaLST2WO4wjjLkXQ+GLRbvNvDy8wXifNxX2hds81qz9OT2zcf/ml624Ey6eMsyMBRZmJd9i07fEvK4CnPIrNeDxaNr25H80LQS5cjQgyK5Nrxp2+Jso7f75Is0ou8PZIbrHDUpS11zTPJzz2/qchQI0ZcTwMu/Mw7wNrZZZ0cQU2BFMDhWUcfJJTJP1Tc299OSRlSJPZAV9JedTEHclCL6Jji5tXtqn0BPDwvNDqpqAbsB7BLwphq0oqKJxZX2nOuM4Cdvv5cCMsbVE3eUX82SQuZN89znRck8dpCeDPAowFmoHiCuNk4drgwogWxjDvS4XyXR8Fv5C2AxZOht6RC9B0Okfyn9j9pHm84JA5IcElj 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(6666004)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PWUXLrTBCoiya4GEIpzY8P1v1BsekN/AUz66tb8lSJoYtexOUGbX/DIRTP/vxFBpfVrXcSlLhRNdyuW9KWZmJUZURcTYPwgzdEv4yYbk8i80ayXc4HQTmZvIwUig/GHd9LcoWb0IdY7zNYylYiozlO8EnoSJqMj03xyGtTqfoMC0wvQCobHR8IPTZIQH3AnOLPXF+JAjBrL0CARUxYyiMXEGBJ1t0ubB9K2oMxlRCiK31xyj2mmyEv+ABU+dgrV52ctJ1o5OfG5Ei/Dt9hwoE7F0+A7CoYABR0XY0daLofkSEE43DKeCYfu/OaUMqPWf2crisfwEcMTC0h6AImtex/LVcLUSEI/aS+Rvk54R8nH1+A/YsZNkHgqZ30KTRqulB3ZaWyCQEbWOWiJ+kXrJKiFUxVf3U/dvGktZvU+BautAH84ec4UoasXkbRfqfGob0eyEFuYLc4885m9RzVF0R7ZCx5JX4UcrhQ0Cz0liA4fgvZyViV9QgfsnoSV62XaNCvTwBIlMTACzw20C619f/oQcY82SXl41F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X-MS-Exchange-CrossTenant-Network-Message-Id: eecf5ab4-c0c7-46cc-f313-08db4f8888b8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:23.2895 (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: j2FNOEeTbJmUQyqL/SQimGqX8y04LTHvCUKrdCqVtSOl+dpkeEoaWJxFweMVry6+nANiFQAK8bpHEllrELmJLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of determining LCDIF output bus format and bus flags in ->atomic_enable(), do that in ->atomic_check(). This is a preparation for the upcoming patch to check consistent bus format and bus flags across all first downstream bridges in ->atomic_check(). New lcdif_crtc_state structure is introduced to cache bus format and bus flags states in ->atomic_check() so that they can be read in ->atomic_enable(). Tested-by: Alexander Stein Reviewed-by: Alexander Stein Signed-off-by: Liu Ying Reviewed-by: Marek Vasut --- v4->v5: * Add Alexander's R-b and T-b tags. v3->v4: * Use 'new_{c,p}state' instead of 'new_{crtc,plane}_state'. (Alexander) * Simplify lcdif_crtc_reset() by calling lcdif_crtc_atomic_destroy_state(). (Alexander) * Add '!crtc->state' check in lcdif_crtc_atomic_duplicate_state(). (Alexander) v2->v3: * No change. v1->v2: * Split from patch 2/2 in v1. (Marek, Alexander) * Add comment on the 'base' member of lcdif_crtc_state structure to note it should always be the first member. (Lothar) drivers/gpu/drm/mxsfb/lcdif_kms.c | 134 ++++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index e54200a9fcb9..d46de433cd8e 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -30,6 +30,18 @@ #include "lcdif_drv.h" #include "lcdif_regs.h" +struct lcdif_crtc_state { + struct drm_crtc_state base; /* always be the first member */ + u32 bus_format; + u32 bus_flags; +}; + +static inline struct lcdif_crtc_state * +to_lcdif_crtc_state(struct drm_crtc_state *s) +{ + return container_of(s, struct lcdif_crtc_state, base); +} + /* ----------------------------------------------------------------------------- * CRTC */ @@ -385,48 +397,72 @@ static void lcdif_reset_block(struct lcdif_drm_private *lcdif) readl(lcdif->base + LCDC_V8_CTRL); } -static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, - struct drm_plane_state *plane_state, - struct drm_bridge_state *bridge_state, - const u32 bus_format) +static void lcdif_crtc_mode_set_nofb(struct drm_crtc_state *crtc_state, + struct drm_plane_state *plane_state) { - struct drm_device *drm = lcdif->crtc.dev; - struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; - u32 bus_flags = 0; - - if (lcdif->bridge->timings) - bus_flags = lcdif->bridge->timings->input_bus_flags; - else if (bridge_state) - bus_flags = bridge_state->input_bus_cfg.flags; + struct lcdif_crtc_state *lcdif_crtc_state = to_lcdif_crtc_state(crtc_state); + struct drm_device *drm = crtc_state->crtc->dev; + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(drm); + struct drm_display_mode *m = &crtc_state->adjusted_mode; DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n", m->crtc_clock, (int)(clk_get_rate(lcdif->clk) / 1000)); DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n", - bus_flags); + lcdif_crtc_state->bus_flags); DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags); /* Mandatory eLCDIF reset as per the Reference Manual */ lcdif_reset_block(lcdif); - lcdif_set_formats(lcdif, plane_state, bus_format); + lcdif_set_formats(lcdif, plane_state, lcdif_crtc_state->bus_format); - lcdif_set_mode(lcdif, bus_flags); + lcdif_set_mode(lcdif, lcdif_crtc_state->bus_flags); } static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { + struct drm_device *drm = crtc->dev; + struct lcdif_drm_private *lcdif = to_lcdif_drm_private(drm); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); + struct lcdif_crtc_state *lcdif_crtc_state = to_lcdif_crtc_state(crtc_state); bool has_primary = crtc_state->plane_mask & drm_plane_mask(crtc->primary); + struct drm_bridge_state *bridge_state; + struct drm_bridge *bridge = lcdif->bridge; + int ret; /* The primary plane has to be enabled when the CRTC is active. */ if (crtc_state->active && !has_primary) return -EINVAL; - return drm_atomic_add_affected_planes(state, crtc); + ret = drm_atomic_add_affected_planes(state, crtc); + if (ret) + return ret; + + bridge_state = drm_atomic_get_new_bridge_state(state, bridge); + if (!bridge_state) + lcdif_crtc_state->bus_format = MEDIA_BUS_FMT_FIXED; + else + lcdif_crtc_state->bus_format = bridge_state->input_bus_cfg.format; + + if (lcdif_crtc_state->bus_format == MEDIA_BUS_FMT_FIXED) { + dev_warn_once(drm->dev, + "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" + "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); + lcdif_crtc_state->bus_format = MEDIA_BUS_FMT_RGB888_1X24; + } + + if (bridge->timings) + lcdif_crtc_state->bus_flags = bridge->timings->input_bus_flags; + else if (bridge_state) + lcdif_crtc_state->bus_flags = bridge_state->input_bus_cfg.flags; + else + lcdif_crtc_state->bus_flags = 0; + + return 0; } static void lcdif_crtc_atomic_flush(struct drm_crtc *crtc, @@ -458,32 +494,18 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); + struct drm_crtc_state *new_cstate = drm_atomic_get_new_crtc_state(state, crtc); struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state, crtc->primary); struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; - struct drm_bridge_state *bridge_state = NULL; struct drm_device *drm = lcdif->drm; - u32 bus_format; dma_addr_t paddr; - bridge_state = drm_atomic_get_new_bridge_state(state, lcdif->bridge); - if (!bridge_state) - bus_format = MEDIA_BUS_FMT_FIXED; - else - bus_format = bridge_state->input_bus_cfg.format; - - if (bus_format == MEDIA_BUS_FMT_FIXED) { - dev_warn_once(drm->dev, - "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" - "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); - bus_format = MEDIA_BUS_FMT_RGB888_1X24; - } - clk_set_rate(lcdif->clk, m->crtc_clock * 1000); pm_runtime_get_sync(drm->dev); - lcdif_crtc_mode_set_nofb(lcdif, new_pstate, bridge_state, bus_format); + lcdif_crtc_mode_set_nofb(new_cstate, new_pstate); /* Write cur_buf as well to avoid an initial corrupt frame */ paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); @@ -520,6 +542,48 @@ static void lcdif_crtc_atomic_disable(struct drm_crtc *crtc, pm_runtime_put_sync(drm->dev); } +static void lcdif_crtc_atomic_destroy_state(struct drm_crtc *crtc, + struct drm_crtc_state *state) +{ + __drm_atomic_helper_crtc_destroy_state(state); + kfree(to_lcdif_crtc_state(state)); +} + +static void lcdif_crtc_reset(struct drm_crtc *crtc) +{ + struct lcdif_crtc_state *state; + + if (crtc->state) + lcdif_crtc_atomic_destroy_state(crtc, crtc->state); + + crtc->state = NULL; + + state = kzalloc(sizeof(*state), GFP_KERNEL); + if (state) + __drm_atomic_helper_crtc_reset(crtc, &state->base); +} + +static struct drm_crtc_state * +lcdif_crtc_atomic_duplicate_state(struct drm_crtc *crtc) +{ + struct lcdif_crtc_state *old = to_lcdif_crtc_state(crtc->state); + struct lcdif_crtc_state *new; + + if (WARN_ON(!crtc->state)) + return NULL; + + new = kzalloc(sizeof(*new), GFP_KERNEL); + if (!new) + return NULL; + + __drm_atomic_helper_crtc_duplicate_state(crtc, &new->base); + + new->bus_format = old->bus_format; + new->bus_flags = old->bus_flags; + + return &new->base; +} + static int lcdif_crtc_enable_vblank(struct drm_crtc *crtc) { struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); @@ -548,12 +612,12 @@ static const struct drm_crtc_helper_funcs lcdif_crtc_helper_funcs = { }; static const struct drm_crtc_funcs lcdif_crtc_funcs = { - .reset = drm_atomic_helper_crtc_reset, + .reset = lcdif_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, + .atomic_duplicate_state = lcdif_crtc_atomic_duplicate_state, + .atomic_destroy_state = lcdif_crtc_atomic_destroy_state, .enable_vblank = lcdif_crtc_enable_vblank, .disable_vblank = lcdif_crtc_disable_vblank, }; From patchwork Mon May 8 05:57:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234073 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 2181EC7EE2A for ; Mon, 8 May 2023 05:53:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E25910E0A1; Mon, 8 May 2023 05:53:35 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20621.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::621]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8948410E0A1 for ; Mon, 8 May 2023 05:53:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eKZSi0Ksuc1QhIiJ+ZPvU4j80I7OwkmGcSP074KrLvLCv9sCrcvHaA3poCfU63lFd90Qp046PqcP5yz/nPu6D/P7Q8J5YEyIgleM9YC0F6KLe2K5oL3BVZ+jl+RTbCHiUBpBiMo0VH/NTDV05Hn+dCALpQBEYuv+vLqW/QorRfesRfMCWmgvkCkpetMhyopGIaLNdjKPoEwYIj8/F8gpuFRlCued1h2WA5TEaHbBYhPfWNPb++qKGRFGyfJPW/6cfjthu2+MvGi5weIfUnYFeXsTdf5T+zflPj5qwqIZbb/qR0fl67kl6QoJWR/d4jAx0oKmWu0d5orqbcYENeUP4w== 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=V3NIRcgyyGTK4xWE3hKpBxefpObjD++6U5Pt6ulOiE4=; b=USGdmst07aucnFZG89hdRyONeiEI1QSgMGBvihqoc0G83Gpx7XBX51NK9y+xtz5jYJvy9UijDn57a9iufKumFW6WAhYgJwLOCQeVXmol5QykmodYVYJR6xWo95pwoDgsRQ7pappZbR6kl9YhZQiLD2PCIiWYKF3Zy4OtZqkvO3XGLrFqLTLaLXNJftx2klpalSeGJhpfc3ZXh+CtFs1DioMf2naNb1qJZ619kQYHfXuwe6WGstI7fGGmVZcyWQzxroapGEzEF1z7fLyvUm+xbRxx6TScj1D+l8lUvOnRZvNXWz6G3bHiALI2/EsE9IQwt9fTNtRzFkoDd6r/9HMUGg== 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=V3NIRcgyyGTK4xWE3hKpBxefpObjD++6U5Pt6ulOiE4=; b=e2laNdjX2q9+YzdSFjc+WuQmGhNpgRp6WNp2SPvxY9ixM8ON/+ZGFjuI7xmfwfd6ZhDp3WQ2lnXxk9JnCPwwlwRVLqiqZvwkDTG1B1aembGiyiMZ+Suhi8s8xL8qWGXmjAH3/eiUCev531ymw0vvAM84xBrHw17qVDq+ul1znSc= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:28 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:28 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 4/6] drm: lcdif: Check consistent bus format and flags across first bridges Date: Mon, 8 May 2023 13:57:38 +0800 Message-Id: <20230508055740.635256-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: 9404ddd5-4b98-4d6b-21a7-08db4f888bd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pb3n3d0MvwRbS2eYyGIeK4CPUFFdTlWH2RKHiB/wm6Gm2I71dem3B0DrIMQ1MMF2sbyvNMqmvG1PUv+aCS+pmWO/Pis/ZoKsaWwq0wLfwrzqkViu845yKeVk814oQ4RTcXzGr/HlyORPt0HsmJFmPhkwZG41+8Lm/4Z34zxTYV4gOKodTv9MKtzPUbtFM2a6PACcWqzR563gE2Tumh/rXrFGpAPLV5d4IKKm5WH7oeyH2+2uoGlBV3cm8QZ/9hX08KiQFnPiztjrwZn5Wg7Kywc9li5JyZlgQTxrdRXAZ7tIkCaKDNBUv+foxvyd620xDk+l13RFAyW/sto9QO6KRd9ZMZQK06+nXBhFC6d9L75xqPnU5hsngF3HNQM0/OuvKeNhQryAQx8A5w1KnOPXaKLytYRLhah1ADJfP+3XjD5447+c0CrAOGROyEt0UD91LdNpQx3cTPRVJMfj1p7qcNmLd8tATWETeDT6r7trMky/QcQ/4QIExZJXm4+ryDAzMaZdbrOCKMHIeANURftvrewxNXMetaMkaa5s4asC8zQcBK5OAL33O6fyq5ucX0Iqd0lSNXiYaCXqUdrmi8DLOqDRycurHn3Qan7CLEKp6Zn8oS3kQKoY93yjwyNg9DB1 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(6666004)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ikmts7ucYTd0XcaqYMeotxvlNtqml8que6joUAtWJhnej29cqblGewl/0T6F5BzGzrU1McSNYnBpO3vK0jZRKiej3I+8oIi3BiRVnJ5EHauKud4564x6m8d/JSdpLqDtpjwLAGwzEw8pQtP4EZVsXhfYO2VXe2T/LifZ29LUCOVx+UBi3TBAthhiXirz+j+a8UuRE1m9mitDyUy8fSeTDanYK3hkwRMxXv3toeO26r6OUt6UjiAfGKejKCQxnxubH7Au/feucYvhZmnXO1aAhjSRese21t+IjS6hRTgbDuM1+TZpOKi+QJQ/v+PkqhlMIX3qmyyWWI8/AtlDz6kYSexzCBmEWvHrMRSB4avVSwSIaFqCdDDwg31n55KH1FIYly6u5UwBkf9cKVxDMeajRuvG+Z/JPtWVn2PlfjTC2A6fwMf3Ghajdk8BcvRu6q3+uqF0m7+4Bgn572q85Pj7nZ+9dabl6cmOKGFKJDpACTPP0MmhA3ByU7HhH8zwnNnBT5rjGLMCxu5hNB4X6av1+3TPEAuaxYtRPntyo1JRUj+/Rg4zs7No8yQR2h+kaDKNdS8X9bu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5-4b98-4d6b-21a7-08db4f888bd5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:28.5042 (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: KIBbZ9IB2ZIcISSBHRyf7/c8kTNYrfXKTJynXaOnQhzYp3zBYZbjsL+j9fXUCrmRLN25DOhr/y+UaWUiiIxEww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The single LCDIF embedded in i.MX93 SoC may drive multiple displays simultaneously. Check bus format and flags across first bridges in ->atomic_check() to ensure they are consistent. This is a preparation for adding i.MX93 LCDIF support. Acked-by: Alexander Stein Tested-by: Alexander Stein Signed-off-by: Liu Ying Reviewed-by: Marek Vasut --- v4->v5: * Add Alexander's A-b and T-b tags. v3->v4: * No change. v2->v3: * No change. v1->v2: * Split from patch 2/2 in v1. (Marek, Alexander) * Drop a comment about bridge input bus format from lcdif_crtc_atomic_check(). drivers/gpu/drm/mxsfb/lcdif_drv.c | 2 - drivers/gpu/drm/mxsfb/lcdif_drv.h | 1 - drivers/gpu/drm/mxsfb/lcdif_kms.c | 76 ++++++++++++++++++++++--------- 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 6fb5b469ee5a..e816f87828fb 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -52,8 +52,6 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) if (ret) return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n"); - lcdif->bridge = bridge; - return 0; } diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.h b/drivers/gpu/drm/mxsfb/lcdif_drv.h index 6cdba6e20c02..aa6d099a1897 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.h +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.h @@ -31,7 +31,6 @@ struct lcdif_drm_private { } planes; struct drm_crtc crtc; struct drm_encoder encoder; - struct drm_bridge *bridge; }; static inline struct lcdif_drm_private * diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index d46de433cd8e..d6009b353a16 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -424,15 +425,19 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct drm_device *drm = crtc->dev; - struct lcdif_drm_private *lcdif = to_lcdif_drm_private(drm); struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct lcdif_crtc_state *lcdif_crtc_state = to_lcdif_crtc_state(crtc_state); bool has_primary = crtc_state->plane_mask & drm_plane_mask(crtc->primary); + struct drm_connector_state *connector_state; + struct drm_connector *connector; + struct drm_encoder *encoder; struct drm_bridge_state *bridge_state; - struct drm_bridge *bridge = lcdif->bridge; - int ret; + struct drm_bridge *bridge; + u32 bus_format, bus_flags; + bool format_set = false, flags_set = false; + int ret, i; /* The primary plane has to be enabled when the CRTC is active. */ if (crtc_state->active && !has_primary) @@ -442,26 +447,55 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, if (ret) return ret; - bridge_state = drm_atomic_get_new_bridge_state(state, bridge); - if (!bridge_state) - lcdif_crtc_state->bus_format = MEDIA_BUS_FMT_FIXED; - else - lcdif_crtc_state->bus_format = bridge_state->input_bus_cfg.format; - - if (lcdif_crtc_state->bus_format == MEDIA_BUS_FMT_FIXED) { - dev_warn_once(drm->dev, - "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" - "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); - lcdif_crtc_state->bus_format = MEDIA_BUS_FMT_RGB888_1X24; + /* Try to find consistent bus format and flags across first bridges. */ + for_each_new_connector_in_state(state, connector, connector_state, i) { + if (!connector_state->crtc) + continue; + + encoder = connector_state->best_encoder; + + bridge = drm_bridge_chain_get_first_bridge(encoder); + if (!bridge) + continue; + + bridge_state = drm_atomic_get_new_bridge_state(state, bridge); + if (!bridge_state) + bus_format = MEDIA_BUS_FMT_FIXED; + else + bus_format = bridge_state->input_bus_cfg.format; + + if (bus_format == MEDIA_BUS_FMT_FIXED) { + dev_warn(drm->dev, + "[ENCODER:%d:%s]'s bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" + "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n", + encoder->base.id, encoder->name); + bus_format = MEDIA_BUS_FMT_RGB888_1X24; + } + + if (!format_set) { + lcdif_crtc_state->bus_format = bus_format; + format_set = true; + } else if (lcdif_crtc_state->bus_format != bus_format) { + DRM_DEV_DEBUG_DRIVER(drm->dev, "inconsistent bus format\n"); + return -EINVAL; + } + + if (bridge->timings) + bus_flags = bridge->timings->input_bus_flags; + else if (bridge_state) + bus_flags = bridge_state->input_bus_cfg.flags; + else + bus_flags = 0; + + if (!flags_set) { + lcdif_crtc_state->bus_flags = bus_flags; + flags_set = true; + } else if (lcdif_crtc_state->bus_flags != bus_flags) { + DRM_DEV_DEBUG_DRIVER(drm->dev, "inconsistent bus flags\n"); + return -EINVAL; + } } - if (bridge->timings) - lcdif_crtc_state->bus_flags = bridge->timings->input_bus_flags; - else if (bridge_state) - lcdif_crtc_state->bus_flags = bridge_state->input_bus_cfg.flags; - else - lcdif_crtc_state->bus_flags = 0; - return 0; } From patchwork Mon May 8 05:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234074 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 35295C77B73 for ; Mon, 8 May 2023 05:53:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78FCC10E0D8; Mon, 8 May 2023 05:53:38 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::607]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1534210E10D for ; Mon, 8 May 2023 05:53:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jt/6ePcmQetRnNtdxuRpSxOhwsvDzKLEba3GpaEUlxlHDrcGwcpQsKYRASu0MO9weuCwYF1rmuOoXTPSIKWi24jwuDoteybgu5bDVvskNZsgN2gRWd3S/ToYjCp54Mi0CDl4H/a7Hi5cUqDXhiP9Rb8gDSp4wupTRj0I21PFQBAkj2NAY/wOdc3hgK0z8c/45NS6+A+ZwtjIOZfbmL3EWOV2oFbbgFcet+566XzLnlJSQu+Sbv7b+4QU3HMy97jGfPN7FdZq3nneEsjl2a0zsWqMT/wM6TgNKAm7GF54rxUl3974XU6+Vkckr9OhiDzsdQ2tPQtIl4T0z6HVtLb76A== 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=brKg1su96r3gljeJtfAE0Sts6yWeMD3v1YApnhix4hQ=; b=WboaJpFJzDu5/yzfv7r3UJ2uCIx7zbPzQmRuWd+we7KHmssobfzfrKfEHUbJ/9VnfY5wYIW/Jg4nYAcYn5SS3PK5ysC6RfWf+6AsPP4gdkxN/VCTCyQm9+yiEcVZKiWuZUM+hP6ZYsy7+zm0ZsEAns1G6mffdTXSyjS8TaJXFnFjc5XFgusCYaXX8/aH9L2mNNSBhggg0uPIIttRTe02xIGY0zkvMVtumJ4tP1bNOd/uuQlojz2X8Ma50OPnESnsMgm+umn6DSgvyh/V/ZjgVC6/znO6Cr51xlLzAAs+yW24A3sgKa0qEVDXdY/TSeghLxn9AUX3jkdhy/oypBvdGQ== 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=brKg1su96r3gljeJtfAE0Sts6yWeMD3v1YApnhix4hQ=; b=dZp1s/RzL979cT++52Wf2Ls+6Rt/zw/EnLAMZ9oGPOmxx6AZBE1OeHPfKIQU4BhlMh3vAcoi0VnGt4cDLlwkPVdiLNe4/8HBg+Dog8e3APUa3gdmxuTKHBWcd+OQasNqrQ27Vg3zloCKiJ4a8wkaNBfSHW8EZGqM2IRNeAsOW9A= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:33 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:33 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 5/6] drm: lcdif: Add multiple encoders and first bridges support Date: Mon, 8 May 2023 13:57:39 +0800 Message-Id: <20230508055740.635256-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b8acfe0-db52-4f2c-8878-08db4f888eec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rGT4JHH+US0jg2+q6HrAch6Kn9VGapISagJiRBnbQPBWyEJ26DmxQXFsjH+Du3ms5HEcMKj+Eeia4BrVAXiITp4fKUt6yTgL8iz7ViCF6V7lXkTeXxMSsJYKaoV3aO9e+sjFkmIzbOwbyzBvORjE8v+Pr9TL9J3kjj4xGsu1R/2xpXX7b02bmUIbNnIQNvmWRGCf4A89Mz1voQsqJBl8+nBZGV56b3neD2kvv88NHBaoybpRKVmsWrw4Cnw3ZrrkptxiXW3lnpUsbrwLq5eGr7/MmeP55nzcJBG20y6lyZvM+jxLGonOp8VjpoQ3GmYMC0WZ/EBbeUi2mta1WzzxQL58lE1dR86U7TjpkRt1Lz1y5Kyr8CLW6XqdPe+3o0rVEwECkLUvFVWms4XGN4P5CGQggaFSq+14boG3VskwWSZ2g3XXGOEc7CNkbbQ3BkWXnAUflFTvInRxzxlnDRDT2DuNENbsuD1rrYW5TnlU+2kZOKDQc8hkgA06HEvvpxQXy28taw00JVJ51ex6pW9mgr8vWI4IP+1qI+HE73XDAa97PB07yfib7n0r+YmaXkr3zf+qC20hx6MyHKQYgyeNYVOkctV5V4vGnNzyCU6N4RsTSZZ9O7HbmDANCb42oGCM 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r0uwCVJNMMff2yb8W/j/l2+EpR0j/Fjx/YfJ+o0kM5K9c92ac5EgfdKoP7zaBArf18LXHKP4aDe256fZyzEJFvXRTqNsV2OC68I7k7c9x1yT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NP3rT9SaaG4Ndln7fLxcMhNcXhQ+8ZGZJ66o7XVPmEbjwQ8ezpX4j0khTuPidOfZx2adltFC4HvqGhp8FHWQj9wMHvtlcA9jPST9LhhkWrAqIF3WnOC1pTEmGc6IxLnVACVTqm8WUfxml2Cycoa8HCkLexmTY0YLwiUpEVrXyS+2nxJlY0hY0hB6y0Z3FV+6NQL9q9gRwWRqjdgry1ZSuZ9yY+7Crj+t/P1Utis8m08jJaBYzb5x3wvrPVSbRTKwZryeXDo5AZDYMAlgO8pr5rQUJQUx2ZDqdpBaiUaLQX2dwpxkqQM1y0Fg736CqhIWOCuDYD5mt8SecQGcCNa1aqSg/4XNQZEQrUQa8jmtTPYNDJl3ad063O7hrrLetWnoC3lCUk2QZJywOar3KZTb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b8acfe0-db52-4f2c-8878-08db4f888eec X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:33.6882 (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: y2l3afQYj5UZg5vmF8tA2OnQmWIhLb6t3lEk8GVjhfPhdMKwvprw8cBiYFkvg7K8hkzzV3A9WpMmp1hkO0iZTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The single LCDIF embedded in i.MX93 SoC may drive multiple displays simultaneously. Look at LCDIF output port's remote port parents to find all enabled first bridges. Add an encoder for each found bridge and attach the bridge to the encoder. This is a preparation for adding i.MX93 LCDIF support. Tested-by: Alexander Stein Acked-by: Alexander Stein Signed-off-by: Liu Ying --- v4->v5: * Rebase upon v6.4-rc1 and resolve a trivial conflict. * Add Alexander's A-b and T-b tags. v3->v4: * Improve warning message when ignoring invalid LCDIF OF endpoint ids. (Alexander) v2->v3: * No change. v1->v2: * Split from patch 2/2 in v1. (Marek, Alexander) * Drop '!remote ||' from lcdif_attach_bridge(). (Lothar) * Drop unneeded 'bridges' member from lcdif_drm_private structure. drivers/gpu/drm/mxsfb/lcdif_drv.c | 68 +++++++++++++++++++++++++++---- drivers/gpu/drm/mxsfb/lcdif_drv.h | 4 +- drivers/gpu/drm/mxsfb/lcdif_kms.c | 21 ++-------- 3 files changed, 66 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index e816f87828fb..cf27b63b1899 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -9,13 +9,16 @@ #include #include #include +#include #include +#include #include #include #include #include #include +#include #include #include #include @@ -38,19 +41,68 @@ static const struct drm_mode_config_helper_funcs lcdif_mode_config_helpers = { .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, }; +static const struct drm_encoder_funcs lcdif_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { - struct drm_device *drm = lcdif->drm; + struct device *dev = lcdif->drm->dev; + struct device_node *ep; struct drm_bridge *bridge; int ret; - bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - - ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0); - if (ret) - return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n"); + for_each_endpoint_of_node(dev->of_node, ep) { + struct device_node *remote; + struct of_endpoint of_ep; + struct drm_encoder *encoder; + + remote = of_graph_get_remote_port_parent(ep); + if (!of_device_is_available(remote)) { + of_node_put(remote); + continue; + } + of_node_put(remote); + + ret = of_graph_parse_endpoint(ep, &of_ep); + if (ret < 0) { + dev_err(dev, "Failed to parse endpoint %pOF\n", ep); + of_node_put(ep); + return ret; + } + + if (of_ep.id >= MAX_DISPLAYS) { + dev_warn(dev, "ingoring invalid endpoint id %u\n", of_ep.id); + continue; + } + + bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, of_ep.id); + if (IS_ERR(bridge)) { + of_node_put(ep); + return dev_err_probe(dev, PTR_ERR(bridge), + "Failed to get bridge for endpoint%u\n", + of_ep.id); + } + + encoder = &lcdif->encoders[of_ep.id]; + encoder->possible_crtcs = drm_crtc_mask(&lcdif->crtc); + ret = drm_encoder_init(lcdif->drm, encoder, &lcdif_encoder_funcs, + DRM_MODE_ENCODER_NONE, NULL); + if (ret) { + dev_err(dev, "Failed to initialize encoder for endpoint%u: %d\n", + of_ep.id, ret); + of_node_put(ep); + return ret; + } + + ret = drm_bridge_attach(encoder, bridge, NULL, 0); + if (ret) { + of_node_put(ep); + return dev_err_probe(dev, ret, + "Failed to attach bridge for endpoint%u\n", + of_ep.id); + } + } return 0; } diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.h b/drivers/gpu/drm/mxsfb/lcdif_drv.h index aa6d099a1897..c7400bd9bbd9 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.h +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.h @@ -14,6 +14,8 @@ #include #include +#define MAX_DISPLAYS 3 + struct clk; struct lcdif_drm_private { @@ -30,7 +32,7 @@ struct lcdif_drm_private { /* i.MXRT does support overlay planes, add them here. */ } planes; struct drm_crtc crtc; - struct drm_encoder encoder; + struct drm_encoder encoders[MAX_DISPLAYS]; }; static inline struct lcdif_drm_private * diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index d6009b353a16..c35d769f91dd 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -656,14 +656,6 @@ static const struct drm_crtc_funcs lcdif_crtc_funcs = { .disable_vblank = lcdif_crtc_disable_vblank, }; -/* ----------------------------------------------------------------------------- - * Encoder - */ - -static const struct drm_encoder_funcs lcdif_encoder_funcs = { - .destroy = drm_encoder_cleanup, -}; - /* ----------------------------------------------------------------------------- * Planes */ @@ -756,7 +748,6 @@ int lcdif_kms_init(struct lcdif_drm_private *lcdif) BIT(DRM_COLOR_YCBCR_BT2020); const u32 supported_ranges = BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) | BIT(DRM_COLOR_YCBCR_FULL_RANGE); - struct drm_encoder *encoder = &lcdif->encoder; struct drm_crtc *crtc = &lcdif->crtc; int ret; @@ -780,13 +771,7 @@ int lcdif_kms_init(struct lcdif_drm_private *lcdif) return ret; drm_crtc_helper_add(crtc, &lcdif_crtc_helper_funcs); - ret = drm_crtc_init_with_planes(lcdif->drm, crtc, - &lcdif->planes.primary, NULL, - &lcdif_crtc_funcs, NULL); - if (ret) - return ret; - - encoder->possible_crtcs = drm_crtc_mask(crtc); - return drm_encoder_init(lcdif->drm, encoder, &lcdif_encoder_funcs, - DRM_MODE_ENCODER_NONE, NULL); + return drm_crtc_init_with_planes(lcdif->drm, crtc, + &lcdif->planes.primary, NULL, + &lcdif_crtc_funcs, NULL); } From patchwork Mon May 8 05:57:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13234075 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 E9764C7EE24 for ; Mon, 8 May 2023 05:53:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CE5410E10D; Mon, 8 May 2023 05:53:45 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20614.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::614]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E95710E10D for ; Mon, 8 May 2023 05:53:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhsgXbob9433aY1gkz3qOMH6X1UpeEKl5t4+6nrGAp4JcFzMH/t2NSU4dNxjFpMSaaK4wYneWdCv1hmDrbxgJPjsNh0EPr3Pz1LZz9pU05QTP7UwrUaRVu+WokSEQW1IKrUGsW/v3wpC0eHpOWmnICcPRp62008ridedPBBVk1Lwanrp86AdxFm+IChWLslvGTZkhTR8qwUDx0q9gbbYh0zS0Vbob8yLd3cjssbsigqq/40j2EXyTNBMTll1z7fE/3oYxp5Q53VF1ShxIPa3hoemk/yXpxVcZCtKZCRO0yyn3tAmSsTFMuY50oTQ7sVcuJyY/w6fUrP1hnNlEMTRfA== 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=VP6Xu+Q6I0NhGFzHaSBqhkZ5B2t0WOMmGD7Fe3t9iCQ=; b=i+o8WZJCbYhXLcdXBQkHr59BFh1iq+/hITYaduBJk2XD0yjXIb4rcjLBW8V7psTJLHeBzoDACuTuAK8vlpCwWWhDPzFLd8KVSoiLZ040OqeraUjW0wzZGnQzNBSoSFSuTBRR+SIbH2mYbeIDpjVGajesUlEFF28AskW/POOMjEA3cB9tOcxG7Bydg4otv/D82Wn4TkRYmT5jWykRooaunfzkpDI1gTAFcc2GTtaAkoocqoXRM4AlmMpmNqJixum4TPp0UsHDl/168+KLr29+JrlWr+Hzj8mbTivtXOv3CbKAVnOu2b65/ZbvSn4hGpUDEqxxHH21Sdx1LoF8C/j1jw== 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=VP6Xu+Q6I0NhGFzHaSBqhkZ5B2t0WOMmGD7Fe3t9iCQ=; b=mWFJ/CkFWUUHq9PoF/jCeG3+iaaJ04do2VJp9yeHAyS9nUulsg+Qi+Hygqq5EuEesz3dD8eiU6Yky+CRFS9jqaJVSDtEcQmGEQo0FhiR8qmgi3cCVfm81JSb8aCwP5YWpQkWG/Cxgno1dM2rCi55eRAqNkqMFcJkoSSZVTSxSUU= 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 AM9PR04MB8523.eurprd04.prod.outlook.com (2603:10a6:20b:432::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 05:53:39 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::60e3:2297:61f1:4d1d%4]) with mapi id 15.20.6363.032; Mon, 8 May 2023 05:53:39 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 6/6] drm: lcdif: Add i.MX93 LCDIF compatible string Date: Mon, 8 May 2023 13:57:40 +0800 Message-Id: <20230508055740.635256-7-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230508055740.635256-1-victor.liu@nxp.com> References: <20230508055740.635256-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::15) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM9PR04MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: c753e2f5-4c24-4999-5353-08db4f889206 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FOYQGQRC6Fq42/rOk9sr/d6UFC0bemZ0DpWNtML5S/1l7B1FgicyHk/ysvR92lj2zvrBIOrWYp+6QjAHX7h6fSrkvlyvFeibawCOnubS2B2E8ntdGRa9j0Rp03xFBB/+yrfFLKREeq5AErB/zdeyV/hkmp4YSY+BTzRcFU2rAAMYHU/s9XX3k6VYobbsM5VUNlRehkvxXaPA4ZgTnIkIH8qfiKhR73mnrA5ioeZIONm4Qe5SXkgzyCNHSP1VTgfmYBoQ9i/t9z9ZlBsV9ewSV5rbNRSiLGSkIwwH94SYqdxZeqapIXrfrqRCblmAWN8ZA52EMtf0xx8haDGXbmPRuOajcVfhHXocQ9hNBpg6Zk/YEF8bsHT/geZjk7SU6KrOHPVmWwOZdFTjzoaDt9ws5zqSliUeA7op0t0Tr69DvLGuUgXmQmRNr89HBorTD5IhXXvHq868LDGuj4jEYZ2dM3J6JpvnK6G2yaV18qamnOBKojpVp7FwooxLkHxJQoyoZm5O+/a0FdKRiAwuI/POcJsswLQiMOrr6Ox8ajY3Mjhwaf93lTLCqOhks624YAU/l2NWTyvrIC3GWh8dXOxSez9mYgLHcZNJYh6b+g8HLfWcOX0fhYb28V+bM0/lA8Ak 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:(13230028)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(83380400001)(6666004)(52116002)(6486002)(478600001)(2616005)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(7416002)(36756003)(38100700002)(38350700002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8676002)(8936002)(86362001)(5660300002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8gQr7hBC+KyqqEKwEQNHIyX7RtK5vGFvwDzD17IK6eQHOWTNIanZf8EnWWugQUAan2K1gi4XAHVP9W3w9Q24iZppQcTW6TiwdWZiH86dX+qSbUafBKhzK5CVDAFXasiiXZJWirBx+L+9+omTZSQjHwXyD5uru7ZtZCWzvYJiqiDFXVOZxnKxkBBMOAHZaEp41tMj0ZRdHkNav1MU44pFxdEM04SwYPHaFv/zTwsuT5oGjZBIxOwPvnxEACSQwIEo6KZly7eDlMGGLK/xAk801b0Jm6daXOFgzqZVm74eiRDJSEiVNcUqgoYlo0l28MEE5sygWuiU8gHferxbwVdYf456HRblzh0YzkOx2BbrHTvLa51d6JFOipIBsl3nBFGytk0h24eYVpyZjRqzEXUn55UiL8s72+fssjzFLeAyBiyvsCVBN+L32DErh0d544jRYQ7BFtFHcz+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g0U2JbODPA6zU/XQENtZybyk1oXBs0fa5rGAjMw+dgK3oL6OBIR0xY1Sl5pninbgOk5YCHgfC3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c753e2f5-4c24-4999-5353-08db4f889206 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2023 05:53:39.0655 (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: rxm7xt11BDjsNmkrRNBWx9qkQv4+RZt6aW+7yEde9VUeTDvmgHG9uWx7ljeh9suQCuKfCyozgQdJrKCD2rxFWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8523 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: , Cc: marex@denx.de, conor+dt@kernel.org, alexander.stein@ew.tq-group.com, shawnguo@kernel.org, s.hauer@pengutronix.de, krzysztof.kozlowski@linaro.org, robh+dt@kernel.org, linux-imx@nxp.com, krzysztof.kozlowski+dt@linaro.org, kernel@pengutronix.de, LW@karo-electronics.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With all previous preparations done to make it possible for the single LCDIF embedded in i.MX93 SoC to drive multiple displays simultaneously, add i.MX93 LCDIF compatible string as the last step of adding i.MX93 LCDIF support. Tested-by: Alexander Stein Reviewed-by: Alexander Stein Signed-off-by: Liu Ying Reviewed-by: Marek Vasut --- v4->v5: * Add Alexander's T-b tag. v3->v4: * Add Alexander's R-b tag. v2->v3: * Fix a trivial typo in commit message. v1->v2: * Split from patch 2/2 in v1. (Marek, Alexander) drivers/gpu/drm/mxsfb/lcdif_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index cf27b63b1899..d1bd0f51f451 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -249,6 +249,7 @@ static const struct drm_driver lcdif_driver = { static const struct of_device_id lcdif_dt_ids[] = { { .compatible = "fsl,imx8mp-lcdif" }, + { .compatible = "fsl,imx93-lcdif" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, lcdif_dt_ids);