From patchwork Fri Oct 18 06:48:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13841278 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2089.outbound.protection.outlook.com [40.107.249.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B3C41885B8 for ; Fri, 18 Oct 2024 06:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729234121; cv=fail; b=jZlYqxWZIN7RlkkkTRc7grv8QKAdLFBSHs+0LHTlWoKz+7vfqwfspEQyZ9Eh21TSJokLelc6GGqzr8/Mv8lfcVLodeyhdDlIf70F4ZN/SfB1GLytlmV2TN1hDoJH15hcpcmH9uwYVdkXgHGFFWllMYSaFnMOFqVE6Bs66SHeZ78= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729234121; c=relaxed/simple; bh=KLOCICtliJdnjdEbs24yLUuFDF4BU3dLTeko+zXzVQg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=pMHigWSUXEjwKmF4OSN7Oim0IDPdigUqb7EUcwIhmtfFSOko4PZbiPqbbJmLSEJm9KS5vv/snSK09r+CelXBITAD+IChMm5e+yRfbO3nmAqXl5qaIbwXCuXoxdkTGaY256/hcVl/kH9qS/Tnojd5Ap6rdccEqE8j0okBRkwc+oM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=UDcoUJNW; arc=fail smtp.client-ip=40.107.249.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="UDcoUJNW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nshbs9BsrYxm/CfvvaguOhLGeKtalJKKyHJobmyFfZU36VHFSMcsAJjM1Zq+88x7oTToGIqo4NgFpjVmRIVr35ESk7oYzkcLBnp80aiyDCkm8rf+sx/Qw4JqO8y4LRqZA3qG+L0BZvbyS9QDwjcHGKG4tTTq960JStWIbtAF4kLf11h8P/HnoVZKbUlrKTd4VGAs/BirQt6wYmlAh6WufEI7M2Da6ebYoBuLOs3w8//sAQMQQQ0bDBQh01ftJ0YQW2MQ3vR0fWVsQ4dVMfSw9wDvLZgcBhTqKa8aEqQG9In9kHpdlMRFg2Gd4eBy5SCmwGUbarfFMSx4w5haM7Vf3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zwSh//d1CaRqxOSZh6QlhILY+X1BgTdgaYR7pJsi57M=; b=glCAvg5uGR/KCUY5xC9viL9iGu5hNqu1C2kW+kEipHZPjM1k8O3QjIHbfPN+pd3tt8KSNWV98RWq8x76namhl1TG3p9sQ5ah+bURLeyirZANm+mq3j0/sM6JXya47jACa7I5cuBMDLfWHuZHposf1g3+r/IjZ1seHqkuuMIt7p/8d103nTjxQA8uA1BABb/wF0yxobHvOynS/LoyUC0YiUKfGE5UbQWe+VUub1dVhHXl0uPeADsRiU8YeOea0lymu/gDaozGUJ140bdOagv/twFouNYWf6uJoPLQ3FGmQOeim0BfRNiJWvivAc1Rg4Wj7jQlgH9tRSrYOC1dat2FRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zwSh//d1CaRqxOSZh6QlhILY+X1BgTdgaYR7pJsi57M=; b=UDcoUJNWbQ0NyXwyDB7tUYnEy89bUwDtoSPziXNrbGAxAeItFVI1GK+mXwQqbo7djYhMVCG7IJ/tXCchuQ0A54m3JBMVybnbPxoRaC7vkLnGfTum/L8B7ohuV0HNrND/rHmoPNx+E0VPPX0djXuW0NW3gU5YthtpIRRWsH17LRXJvoN8AWlTJi2KFLXyanpY8dVAqghwGE4txfF8Qic2sFUi3yl0l0oE2ZKtbxzoEgx2NbjenHTxsmTaAYnmUd4O9LCNWfPY4plcsT/iIcF70qaMfFMi5CgZb8RCtpH5xGt5Ni4bRf+WYF6VoClh+Z4G8Nl0CRh/geNFYmT/weKpDQ== 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 VI1PR04MB9787.eurprd04.prod.outlook.com (2603:10a6:800:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 06:48:35 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%4]) with mapi id 15.20.8069.020; Fri, 18 Oct 2024 06:48:35 +0000 From: Liu Ying To: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, marex@denx.de, stefan@agner.ch, dmitry.baryshkov@linaro.org Subject: [PATCH 5/5] drm: lcdif: Use drm_bridge_connector Date: Fri, 18 Oct 2024 14:48:13 +0800 Message-Id: <20241018064813.2750016-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018064813.2750016-1-victor.liu@nxp.com> References: <20241018064813.2750016-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR04CA0204.apcprd04.prod.outlook.com (2603:1096:4:187::16) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|VI1PR04MB9787:EE_ X-MS-Office365-Filtering-Correlation-Id: 248c1190-f928-4c4e-addb-08dcef40e31d X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: TQtdneAbOqSU9/IE47q8irRGA6D2M2py9mbdu7OaESwkQ42NpV4hgNpUAZgAaFAV1PuYBfi8T03MZd44JNOq+avtU/jUcw6vzuxe7bIT9aeZWTZc8Kun5atZrWlTpjcYVqaV4a5ArXac/GW6Grp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CwCeMgAK/mjTNw/L+piymu5lhwu9aVQ/NswSOmOFhlrbxAiTXq5Oc+mMef3CG9FLdX24ggwQqmX41PqY/ociRrKp8X1+n9yaZkvWcQoPMEJS9h6ghimEeVIDgj5r8DH20QZnAe88HDFnbd3X/xNrmMJTtRmRE/P0hz6QyUcRcI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3EwSxJdXLDEu/JgcugezO0m9T7m2jbn4JFcmVLYGbkRWfme7TAaHDTJZ2cxrUN2Mc8ZCoNHZGX2woeftr++9JZ5lngJevtYft5IfTpPuAaT2sTvEltI1tNW8Ml8gOjP1A/ISP8ikF7l4tCfXn2x5o1tWS0sNkAiakB9qfCQQIjMkDOoHqEZrchH0Rq56rxJo2u4aWb9jLFOAlE/LfN6DLauZfvPvt8ls0e8wMG26B8bxKrpeYHiW5HwSGCzUSazYMzypEGOyx4oVPZGS7gvbvva0rfhWdOxzLtvqBEMH3AZ94awiouviIKwQ5TK1UF4q0bHTtVYVERIF+nkIbjuCVsCpGnu6zDWvbAKsyA7b/INF/3NieQXyiPLeh9+pQKIMoNth5MATFi7R48Rv2XBuUROyeM/zsEI0wS0AiUni9DHkdpdzdxACHJTaKNa1h5h+Z2f8QwEmjEEku0cBO+r6N77qhuteRWE+fNJ6Dl2oAj7hxCHLjnCYCCbE52+1IuMU01ASbJPNcjvXSujuRPCY1OYSZapWPMg5Lu1cucuIGdrcAT4YSCNRLaRgrlPEo3Z4p3tZAUW95YjY4jKflJYcYMxm4YjvdTST3zjMfIfxZ/5biR0JlElxHj/oDEVQ/cgtOCwpUqpJir6qSatYWSY5UZq+7nbBQugtz3opkgrZ5qSgPVp1ARYeJZpcuwAKDw7gbp0vC7c9ERc8BWCKx1Tac1ooG8UfrwLJuNHlfLrEsqxikKNZfFWFFY45TiwUOQ70uDJYa6abIR5AbFyb1tuQn2FsKbftpjsI3XT9wvfrhHa5kRlt3bUnGzbkd+xrS1+yb6SgCtmH/7ZliPAilMyePywttSuYMaaA4GzK/KgGlDNFP9tat086tfsvb7oyqNe9fe9+b/HJkK5mbOVPn7O18y28jLF67G0MCyue4w900m5uzrfZ9HXRE+sWzM2artDQYIZ4mgyDmbiFmNa5tzfc21vMasj2JNRKpvGj1GpQMRFPL8hzCL5HsFf4xWbWft5A6nFgy4I5b955B/nvrovbME/U2G7GtvALwMRcdgjlhX9DyjXHYEZW+5pxpJkw19yqgpyg0wkNA6NqOZeVx4B2Z0+kMWW29Bs6Aetha/GABoT7AL4cz11/QPBczzrWqfNlMp1ulVoRmAC4sRUaHKAOMGGR+rdwyh158lPjRB4yNiibeVBSg15omZ7cCBnumQPJWb3+svS3kVCkMwZkl8FSH+5PrmXlAommREdzkONz7OlqNDqVte74UO74tKdyYtKFUAAjpTLU2mb08MkYm43Zd45ywscqptdjYNArqK2sMICkp7xlfAC8FaXR1H9mHTDUa6UUCwn3qZg5rJcYVjm+9LGOu0p6oABxnPeKXX/ZyRC7W1WLFEf6m45u9k2hOe9obdOt4HneUdZPtCdyoDborPqsXmLp+dTz4ERBsIL6cAcrz39xvpKpNSJZaH4zkdbtQtYbQeZEPZtwEuCvlZhF9HAq2l3sFFyktywJ2dAxIEKLYZhs7bsshyR3TjuFY/En7i4rrlFo5ooGQgvtqxS8COGZcoYIIsc7cU28vjxxvTLdY9SvrgY6nXtFx3893t+7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 248c1190-f928-4c4e-addb-08dcef40e31d X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 06:48:34.9886 (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: S9Nv6ftxpUDn4c+dAE6w3tuyELWUYZhKmczAa1xakPFP1ZOn5yzGKzNkhv1u9IBBz/iTy4o9q7zq6/a9ApUwBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9787 Initialize a connector by calling drm_bridge_connector_init() for each encoder so that down stream bridge drivers don't need to create connectors any more. Signed-off-by: Liu Ying Tested-by: Alexander Stein Reviewed-by: Biju Das --- drivers/gpu/drm/mxsfb/Kconfig | 1 + drivers/gpu/drm/mxsfb/lcdif_drv.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig index 264e74f45554..06c95e556380 100644 --- a/drivers/gpu/drm/mxsfb/Kconfig +++ b/drivers/gpu/drm/mxsfb/Kconfig @@ -27,6 +27,7 @@ config DRM_IMX_LCDIF depends on DRM && OF depends on COMMON_CLK depends on ARCH_MXC || COMPILE_TEST + select DRM_BRIDGE_CONNECTOR select DRM_CLIENT_SELECTION select DRM_MXS select DRM_KMS_HELPER diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 58ccad9c425d..d4521da6675e 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -16,7 +16,9 @@ #include #include +#include #include +#include #include #include #include @@ -56,6 +58,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) struct device_node *remote; struct of_endpoint of_ep; struct drm_encoder *encoder; + struct drm_connector *connector; remote = of_graph_get_remote_port_parent(ep); if (!of_device_is_available(remote)) { @@ -97,13 +100,25 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) return ret; } - ret = drm_bridge_attach(encoder, bridge, NULL, 0); + ret = drm_bridge_attach(encoder, bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret) { of_node_put(ep); return dev_err_probe(dev, ret, "Failed to attach bridge for endpoint%u\n", of_ep.id); } + + connector = drm_bridge_connector_init(lcdif->drm, encoder); + if (IS_ERR(connector)) { + ret = PTR_ERR(connector); + dev_err(dev, "Failed to initialize bridge connector: %d\n", + ret); + of_node_put(ep); + return ret; + } + + drm_connector_attach_encoder(connector, encoder); } return 0;