Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1741199ybz; Thu, 16 Apr 2020 14:49:56 -0700 (PDT) X-Google-Smtp-Source: APiQypIyQAvxsIx19WTqQosgni9N0zMMa1Zo9laaugB4HANkDEKu0eeKi+opVfgDYviASOOGWpY8 X-Received: by 2002:aa7:c0c3:: with SMTP id j3mr245621edp.304.1587073795991; Thu, 16 Apr 2020 14:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587073795; cv=none; d=google.com; s=arc-20160816; b=gksjLu41WA3NSd9WD+epZhFOAFfrQwhbKVlOPP8pfEwqObrZq2QfAcx6b1idsW40RN t1EOCEre37Ij2gEcg3jlJzPjf8cYZSHtbyX4A9eGiQ0WJmeaq5V0ca4at2TNPlk8epmR 9HtkAZyXfqYj9+pLCD51U0mHdDkz1k345IXQ8iCIhpDUQHz3DcC0+bmy3ok/cqh3aJq9 ac+azoisOIIzoqr8r+8pDlBAzeO7p53wmG24xB4fbhE9FviL8BnfeI5EMEfWUteqC3ot aiuS2g+emDvXsWPS+WMKA8Tr4PjwCs3z3IK+hPY/yfXCIjYP5283H+/muMeEAZYwZ58y qCBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZCbFOTawCFme9ApY+0VuDdb5wLnlUiIyLU2sfJ29mUc=; b=z7lImSTLz0sH+nK+sfWd4ZRfTDP7C59VOKd0fVHv5UvfGRq6v83uB+HjJ4llTxbomG Rl2E7dk8/jPs25SyGFlo+rJMwPYETOM8W4xHxnt2Iyk13gnmCyNcnE8NS6IjZ4k49bPY 6kyS1mCnELCgWLqOmorkDixM7+XUtPk7hIr+809thVO423TujTbg3mjBW0OQWymfb0Uj ohb9aUXPFTBEAh43HPxKvs/2CvmESvQ0DlCFgMOIcGpOEYpwOavkkdhA5zSJreElkvLq q4E8JqvNalznlE9x3oNxa9FvHdc9u9dgPxxys2RgMEy21vSj7jnl0ecx7sbUDv3BvbiO F3Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TSXdROCe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si13916668edr.548.2020.04.16.14.49.32; Thu, 16 Apr 2020 14:49:55 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=TSXdROCe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728408AbgDPVqM (ORCPT + 99 others); Thu, 16 Apr 2020 17:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727829AbgDPVqL (ORCPT ); Thu, 16 Apr 2020 17:46:11 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855FAC061A0C for ; Thu, 16 Apr 2020 14:46:11 -0700 (PDT) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C32E597D; Thu, 16 Apr 2020 23:46:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1587073570; bh=Wc8on2VFZc2Ti1oQLptvGuR0fEogjYjgir0yXNAH++0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TSXdROCed0cQIzGrDXt8uYy+lUSbuBXwrexS6RVjvk3JFessMHZb9sHBTYV0H3Wf3 MiUSJtgxAJNsKz4seBRDgwa6NpWXhOhETW3Jn0LEH5z26tOmC665Jo96UKEK6Ixa0p /v2LLyBiCEhfSYIYrV7yYEZOWLCzDOhNwkVa8mHM= Date: Fri, 17 Apr 2020 00:45:57 +0300 From: Laurent Pinchart To: Enric Balletbo i Serra Cc: linux-kernel@vger.kernel.org, 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: Re: [PATCH v2 7/7] drm/mediatek: mtk_dsi: Create connector for bridges Message-ID: <20200416214557.GC28162@pendragon.ideasonboard.com> References: <20200416155720.2360443-1-enric.balletbo@collabora.com> <20200416155720.2360443-8-enric.balletbo@collabora.com> <20200416173525.GQ4796@pendragon.ideasonboard.com> <20200416173615.GR4796@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Enric, On Thu, Apr 16, 2020 at 11:33:24PM +0200, Enric Balletbo i Serra wrote: > On 16/4/20 19:36, Laurent Pinchart wrote: > > On Thu, Apr 16, 2020 at 08:35:26PM +0300, Laurent Pinchart wrote: > >> On Thu, Apr 16, 2020 at 05:57:19PM +0200, Enric Balletbo i Serra wrote: > >>> 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. > >> > >> That's the right direction, but this should be done in the mtk display > >> controller driver core, not in here. I'm OK with the code being here as > >> an interim measure if needed to move forward, but that should then be > >> temporary only. > > It'd be nice if we can do this as an interim measure for now, so at least we > have the embedded display working. IIUC to move that to the display controller > driver core I should also convert/rework the mtk_dpi and mtk_hdmi drivers. This > is used for the external display on my device but to fully support this I'll > also need to rework the bridge chain logic to handle the multi-sink/multi-source > use case. This is something I plan to work on but I suspect won't be easy and > will trigger lots of discussions, and, of course, some time. > > So, if is fine I won't move this for now. That's totally fine with me, I just wanted to make sure you were aware that more work was needed :-) Thanks for all your efforts ! > > I forgot to mention that the drm_encoder should also move out of the > > bridge driver to the display controller driver. > > > >>> Signed-off-by: Enric Balletbo i Serra > >>> --- > >>> > >>> Changes in v2: None > >>> > >>> 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 44718fa3d1ca..2f8876c32864 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: > >>> @@ -1144,6 +1155,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; > >> > >> I think this line belongs to the patch that adds drm_bridge support to > >> this driver. > >> > >>> > >>> drm_bridge_add(&dsi->bridge); > >>> -- Regards, Laurent Pinchart