Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1026695ybb; Wed, 8 Apr 2020 14:58:22 -0700 (PDT) X-Google-Smtp-Source: APiQypKi8vs5NYYPehtEQbnL2j/oa5xhdiEjq2tP3gXID5XTBbDyNL7BDJ8XD6rF7q/hj4Kninu4 X-Received: by 2002:a05:6830:22c3:: with SMTP id q3mr7824201otc.152.1586383102059; Wed, 08 Apr 2020 14:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586383102; cv=none; d=google.com; s=arc-20160816; b=XLNjau2vnzOVl7p9WOrhOXwmef698C+G1EafJcQkNW9khYAKl3ejlRThgeLF37Mnnq XiFIUJ8ZK71aIouJlnB3lrWMDRa9/gTlskn/qD9vyLQL5i5lgW3MjxJG0qwIfUox+zh+ QHL7cDX1F0wts7Zas0YhY6oXMN4G2BkcPetnfFrzK2JXMiT0OgoFX3Wy01jWvipRMlv7 L7LmhphT0eHxDsQnXeYRUx3IXFcFr9I7Y0ZV2xtfINiE3Zgl0qI1UPDRQZscymUprtLZ vedQNcpWekHtCA75pMJZNrNtM9SBYJTOJt5KcvrZHFreFVdzD0Nyyrs0KO07sLH0tb3T 6kUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=47P61ti5HbjFpIO6LXTK0I3Iri8AhaAWjskPIOWa+4Q=; b=HVmf+YcpBk46wJy5vxvDoCdBeT9WxxGgkv2I/klB3yVJc+0DWTzvlUGzZOpifXlMSn DdCoDVM88omqDhPPSHp26Z17vE95OF77ONtqDgKu1fV0ggw49J1GMSO566Skinu9gl7e onVItHb+9cRs2JPjbpmrVVWodDerlesNhOUOpPieMpIQWGCNk+s62KYC2sCNsdz481/8 cF+8cRkShoMD6N9IxW0PFXtRAq6i8rX4RkJZWiu8APMzkhUNLxmQxk9fueLCFXAdw5hd u45WLvgbRTPBeMoscNk+hQrY/GqyB+91AoXlO80kOnRzOP+VjaN5g83aHAS1ibht0W1g JYHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k30si2950450ool.81.2020.04.08.14.58.09; Wed, 08 Apr 2020 14:58:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730190AbgDHVLq (ORCPT + 99 others); Wed, 8 Apr 2020 17:11:46 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57400 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730109AbgDHVLl (ORCPT ); Wed, 8 Apr 2020 17:11:41 -0400 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 Cc: laurent.pinchart@ideasonboard.com, Collabora Kernel ML , matthias.bgg@gmail.com, drinkcat@chromium.org, hsinyi@chromium.org, Chun-Kuang Hu , Daniel Vetter , David Airlie , Philipp Zabel , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.25.1