From patchwork Tue Dec 24 01:46:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13919627 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0CA63E7718B for ; Tue, 24 Dec 2024 01:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zNe+GKAhSRPnsadkibSgwFkYLC+ibmPippji+A4c7qk=; b=SehRx1IRYNwTcJJ4rCDnxr4wBy 1xPVnEB8i/id2Go9BY+00th26PRSn1MejCvKs3mLuk+6OeLE6JAbf6qNkZelJdiVSZNw7vUcFsx1m cKecJ4FxMpTWjEfctg0T0OEOEJb3eOO3IRhGfsqdQp6o5yttAW2gHd530bP4WW01IeibzLQotDEvw YsV3Au/cS2UnX1v+quCodhyFIbvaP/Xm0dMmGQNuovVbTRNUahhox+LyHuKb1Llyxxnzs8Sefu+RG wzLrJF2SVExlSRtPyMDjNC+a7PHsx5XJdeafEFbFhECkrpTjOddcx4Xodi0yLqvkmd2/uEeQp1FN4 IV157Tkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tPu3b-0000000B21w-2tL6; Tue, 24 Dec 2024 01:49:59 +0000 Received: from mx.denx.de ([2a03:4000:64:cc:545d:19ff:fe05:8172]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tPu1G-0000000B1Kr-3nWK for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 01:47:36 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 39C0B101ECBA5; Tue, 24 Dec 2024 02:47:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=mx-20241105; t=1735004852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zNe+GKAhSRPnsadkibSgwFkYLC+ibmPippji+A4c7qk=; b=iQWXibBSxMrJnmEzsOsn86DWym8bCH7wpSM5EKUaQo++UOdBEDZneAsiSdawcgSKXdBXWW lqMJN1IVaD45cQIZSdIVFu9esOLa5LeVJd1Ugwm5FThLJffXd/rkVfo+CTmg3dHNOt3PFw OHmJ3N8s0a8/VGG7d7X8In9XChQRxYf1omh3CJ+LangfRJ6BO66ss/YCI22JBQAdCr5exg FrnReBikiKcPKb5v7gYg+RE2J1EYAJTIuDa4X0nKeZpBN2Gfcg5tuoemHii9yRZUgPcO/m W7WlQerjazdQ6sPpgeQskV5fBGnh2e2OzItvZ4WEdohUTLpnpb8IIbACXtoMoQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Cc: Marek Vasut , Dmitry Baryshkov , Andrzej Hajda , David Airlie , Fabio Estevam , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Liu Ying , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Pengutronix Kernel Team , Robert Foss , Sascha Hauer , Shawn Guo , Simona Vetter , Stefan Agner , Thomas Zimmermann , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach Date: Tue, 24 Dec 2024 02:46:15 +0100 Message-ID: <20241224014701.253490-2-marex@denx.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241224014701.253490-1-marex@denx.de> References: <20241224014701.253490-1-marex@denx.de> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241223_174735_239642_4DD9E605 X-CRM114-Status: GOOD ( 17.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit a25b988ff83f ("drm/bridge: Extend bridge API to disable connector creation") added DRM_BRIDGE_ATTACH_NO_CONNECTOR bridge flag and all bridges handle this flag in some way since then. Newly added bridge drivers must no longer contain the connector creation and will fail probing if this flag isn't set. In order to be able to connect to those newly added bridges as well, make use of drm_bridge_connector API and have the connector initialized by the display controller. Based on 2e87bf389e13 ("drm/rockchip: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach") This makes LT9611 work with i.MX8M Plus. Reviewed-by: Dmitry Baryshkov Signed-off-by: Marek Vasut --- Cc: Andrzej Hajda Cc: David Airlie Cc: Fabio Estevam Cc: Jernej Skrabec Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Liu Ying Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Neil Armstrong Cc: Pengutronix Kernel Team Cc: Robert Foss Cc: Sascha Hauer Cc: Shawn Guo Cc: Simona Vetter Cc: Stefan Agner Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org --- V2: Add RB from Dmitry --- drivers/gpu/drm/mxsfb/Kconfig | 1 + drivers/gpu/drm/mxsfb/lcdif_drv.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig index 264e74f455547..07fb6901996ae 100644 --- a/drivers/gpu/drm/mxsfb/Kconfig +++ b/drivers/gpu/drm/mxsfb/Kconfig @@ -30,6 +30,7 @@ config DRM_IMX_LCDIF select DRM_CLIENT_SELECTION select DRM_MXS select DRM_KMS_HELPER + select DRM_BRIDGE_CONNECTOR select DRM_GEM_DMA_HELPER select DRM_PANEL select DRM_PANEL_BRIDGE diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 8ee00f59ca821..40dfbc3e6118e 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,8 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs = { static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct device *dev = lcdif->drm->dev; + struct drm_device *drm = lcdif->drm; + struct drm_connector *connector; struct device_node *ep; struct drm_bridge *bridge; int ret; @@ -97,13 +100,31 @@ 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(drm, encoder); + if (IS_ERR(connector)) { + ret = PTR_ERR(connector); + dev_err_probe(drm->dev, ret, + "Failed to initialize bridge connector: %pe\n", + connector); + return ret; + } + + ret = drm_connector_attach_encoder(connector, encoder); + if (ret < 0) { + dev_err_probe(drm->dev, ret, + "Failed to attach encoder.\n"); + drm_connector_cleanup(connector); + return ret; + } } return 0;