Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1941389ybt; Mon, 15 Jun 2020 13:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8f2pQxCo7nIc502fQq0SP0gZi2+RsOiYfOBJVC17OfpLyI7+z11NBsxcDUH5IDB2L+OWL X-Received: by 2002:a50:fd19:: with SMTP id i25mr25136724eds.248.1592253224022; Mon, 15 Jun 2020 13:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592253224; cv=none; d=google.com; s=arc-20160816; b=Eq8pOg2CPLJ3ry2G7JEFeDDtbyLfahJmLqDc13CUgHrbPQfchBzvlNlpgarxnBrsan L5Suv1g7r2/dZ678rWPtBV9itM+Sfu2nOZvg3reHyu33bdiekFAagdsKZ9jRqY+iHXKH R9Amqrfa542nuChkQ0kMrHgG41cifqsFUm+fmpSkh3oR+s4ZBWUlekLw890vvmZ6r9XB FZxTLLiwzltOKcOXakcd9Z2/s5QVoCXoQ6c4O9VoD5kRTAT8wWoBUUsP5077f7j3DGTC GKwo0EskIy4/EE4UokiF9ZSLbbgaAC+rM3jWem+eVwwDUzT1KWjSZ046++uywzJbxv/t PVFA== 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=AO8ZOlAnHWptKRtWtcMmiGwwfC0h4jQ/txS0+YUALtE=; b=gZbh47fmXKsz8+okKJNa13WGT7Ygzf/52YamZC7rw7PvFm5U5R/8bRbjz+OabkRBOP VxRGRwrhYBmcBQhcoUCpXpmARxdXUIj57Us4jWDjVioxaxufuQGYzkBzqIu3LiIpvlHn LYyudX3MGCEV1WJZfUu3KgMYWgbSWWBUkdpFzaJiVZwAH0EZXCJz/X3QRJk9zmNYMalC k3UpHyzB4h32Vud5/gJu0Q2/57gS+ogkmNu6Kx5R609yIQRK6ibMzo3MxTU28evMz59d 16pOi8PIVvJX803IpKDgPZWyMV1dxhCsW2RsF1aupHN3aj5LqQxxY/DCWZuw5m51WEKp Xuzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h5si8402272edr.201.2020.06.15.13.33.22; Mon, 15 Jun 2020 13:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731411AbgFOUb3 (ORCPT + 99 others); Mon, 15 Jun 2020 16:31:29 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37200 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731490AbgFOUb1 (ORCPT ); Mon, 15 Jun 2020 16:31:27 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 3673F2A2CF6 From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org, Collabora Kernel ML Cc: matthias.bgg@gmail.com, drinkcat@chromium.org, hsinyi@chromium.org, laurent.pinchart@ideasonboard.com, Sam Ravnborg , 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: [RESEND PATCH v4 7/7] drm/mediatek: mtk_dsi: Create connector for bridges Date: Mon, 15 Jun 2020 22:31:08 +0200 Message-Id: <20200615203108.786083-8-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615203108.786083-1-enric.balletbo@collabora.com> References: <20200615203108.786083-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 Acked-by: Sam Ravnborg --- Changes in v4: None Changes in v3: - Move the bridge.type line to the patch that adds drm_bridge support. (Laurent Pinchart) Changes in v2: None drivers/gpu/drm/mediatek/mtk_dsi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 4f3bd095c1eee..471fcafdf3488 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 @@ -183,6 +184,7 @@ struct mtk_dsi { struct drm_encoder encoder; struct drm_bridge bridge; struct drm_bridge *next_bridge; + struct drm_connector *connector; struct phy *phy; void __iomem *regs; @@ -977,10 +979,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: -- 2.27.0