From patchwork Wed Apr 8 21:11:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 11480917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BA2781 for ; Wed, 8 Apr 2020 21:13:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E62922074F for ; Wed, 8 Apr 2020 21:13:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="f/BGc4la" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E62922074F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MzrNN93UtLHPUkGYeE2WSZrrfloy+33vNnFU0LRgH14=; b=f/BGc4laZ8vxMu AUhGffZGkwODiqSTtjTD+hZcLZLpy4n925bN/wGKDAfCbjKZLjlfRzB9R9ygGMzFwrVPCrbm0YbtX y2eF4lpOaWBk4DLfeG6fqznInz9nUDXGUgXIiVF6nw5FrDEzq+StPct2maAwqalCn1mbFjcVxgE2J AY1BJFfBhDAswgrody62Rl3HBR36LxxwyYShmT2N3E5oBDH1GYvY/ppJPoLJAK0GLMAADqCHL7J3d iVf5+FV80Vx4nIqLcoo/QYzuqr8IpBv/VNs3V+Hw+9q60mR+IZPpv3y9QfyKT39/MBJIWsUnTuvC8 +i0MlmHKvWqNbo6Ka7rA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMI0K-0000nG-ML; Wed, 08 Apr 2020 21:13:00 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMHz3-0007wT-MP; Wed, 08 Apr 2020 21:11:43 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 943BA297495 From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Subject: [PATCH 7/7] drm/mediatek: mtk_dsi: Create connector for bridges Date: Wed, 8 Apr 2020 23:11:20 +0200 Message-Id: <20200408211120.1407512-8-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200408211120.1407512-1-enric.balletbo@collabora.com> References: <20200408211120.1407512-1-enric.balletbo@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200408_141141_879087_D72515C3 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chun-Kuang Hu , drinkcat@chromium.org, Philipp Zabel , David Airlie , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, laurent.pinchart@ideasonboard.com, Daniel Vetter , hsinyi@chromium.org, matthias.bgg@gmail.com, Collabora Kernel ML , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use the drm_bridge_connector helper to create a connector for pipelines that use drm_bridge. This allows splitting connector operations across multiple bridges when necessary, instead of having the last bridge in the chain creating the connector and handling all connector operations internally. Signed-off-by: Enric Balletbo i Serra --- drivers/gpu/drm/mediatek/mtk_dsi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index f9706f306275..a36c86e174f4 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -184,6 +185,7 @@ struct mtk_dsi { struct drm_bridge bridge; struct drm_bridge *panel_bridge; struct drm_bridge *next_bridge; + struct drm_connector *connector; struct phy *phy; void __iomem *regs; @@ -983,10 +985,19 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) */ dsi->encoder.possible_crtcs = 1; - ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, 0); + ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret) goto err_cleanup_encoder; + dsi->connector = drm_bridge_connector_init(drm, &dsi->encoder); + if (IS_ERR(dsi->connector)) { + DRM_ERROR("Unable to create bridge connector\n"); + ret = PTR_ERR(dsi->connector); + goto err_cleanup_encoder; + } + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); + return 0; err_cleanup_encoder: @@ -1145,6 +1156,7 @@ static int mtk_dsi_probe(struct platform_device *pdev) dsi->bridge.funcs = &mtk_dsi_bridge_funcs; dsi->bridge.of_node = dev->of_node; + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; drm_bridge_add(&dsi->bridge);