Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1375604ybk; Thu, 14 May 2020 07:30:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykIivS+Oh/lMvShrXYTe8+oN1ODqEC4eNBfTQiUz7mLIVt8LOyhgNZqHQK1U7ax9aXszG+ X-Received: by 2002:a50:c314:: with SMTP id a20mr3931278edb.352.1589466655817; Thu, 14 May 2020 07:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589466655; cv=none; d=google.com; s=arc-20160816; b=Ln3R+gi/nABF+msdF1rBC9uT6iEb2NSqtUb2pTlT7VdaRtD/GVtPAwFQu7ihBVoM9G 3xY2jHmrOoypDeOAud27h9+Een0aFlgl63X4aLbkmg4hsGbep5sdwejJ4zhsIqf9Lgqj TwZCREQo1tMKZlnhXuI8mlzVXH/D2B5ok9wqpwuzyVwOF1nk71LDpr13hvf7f5em2Pkl WEZkGOaxVc4dobNhlICYKe5sxHIPwjoSsuUMr8n3XF2vgg2bLc3NLHomxNW7zeWrSyGm e5qarl6A13hJUJnNtDL9BChAOMiZAELw+5YZRDTu4PfHdjwMd2ZAmJezu/WJg0BLy5Kd xw1w== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=erFMUh5+3eVqI93hfEyRoQgF/EJZe187slZs4Pz3Fvc=; b=N3ykxbm2ZRzVUc6VZFsoP01nuTi9bHs4fk71t15ZGtMn6svjGW3ABzSOELtoRYj8mN R8awob3WE8bBiVwCd9dsV4gZ+SYsa+BTRhB7zvYhjfV5q+EmVfgLtByjpjMrA/ucG9ZC k1Di160AUSaJ5YZ1h1gFvxwszMGTnp4UAmZ/1Gfx191LTOMWU1gRuoikXe0l8jc9yn3N ZUwUm8UvZnYHdV8Z1YvXw0k5EvAXkpfogVF40XmNTB/eisB4Dhx8EMchvNXnVhwLnRro aTyD3HaTesvD1+23i3OxkuQR1bU7X6FDqciMGKbqB5K66yTnSVHQwB7I2I4Au0eQagN9 zbSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JxDecQBn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si2057686eja.132.2020.05.14.07.30.31; Thu, 14 May 2020 07:30: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 header.i=@kernel.org header.s=default header.b=JxDecQBn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726937AbgENO2s (ORCPT + 99 others); Thu, 14 May 2020 10:28:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbgENO2r (ORCPT ); Thu, 14 May 2020 10:28:47 -0400 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CAB82078C for ; Thu, 14 May 2020 14:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589466526; bh=c9L1O1InlStlIGidxd6wkgttvIpBEDDoT/skiDV3RvQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JxDecQBn7l1dJvcoAMtJKzjbkyoPCFe3jN6GE9bIN4vNpmS0jZ4BL8QmgWPYGhjdx 98XZLTISx3rmSGgsqNb9oJHtZnynI6zR0DVGcAvfrbFtKT3rANG5o1pYzdwIFJnaVV 3fYXikXicKhyaywo187A9P+UdGinb8CG40vHH6cI= Received: by mail-ed1-f53.google.com with SMTP id g9so2527052edr.8 for ; Thu, 14 May 2020 07:28:46 -0700 (PDT) X-Gm-Message-State: AOAM533Tn3CP4+LAoWZjuPfY+fBAyCMBlsn+qAlXS7TM2Q16TbJ5OVjz XeM5+5/GVuEPoyOVjlyI/xYCLWCXKdChg/Tqsg== X-Received: by 2002:a50:ea87:: with SMTP id d7mr4038661edo.48.1589466524869; Thu, 14 May 2020 07:28:44 -0700 (PDT) MIME-Version: 1.0 References: <20200501152335.1805790-1-enric.balletbo@collabora.com> <20200501152335.1805790-8-enric.balletbo@collabora.com> In-Reply-To: From: Chun-Kuang Hu Date: Thu, 14 May 2020 22:28:33 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 7/7] drm/mediatek: mtk_dsi: Create connector for bridges To: Enric Balletbo Serra Cc: Enric Balletbo i Serra , linux-kernel , Collabora Kernel ML , Chun-Kuang Hu , Nicolas Boichat , Philipp Zabel , David Airlie , dri-devel , "moderated list:ARM/Mediatek SoC support" , Laurent Pinchart , Daniel Vetter , Hsin-Yi Wang , Matthias Brugger , Sam Ravnborg , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Enric: Enric Balletbo Serra =E6=96=BC 2020=E5=B9=B45=E6=9C= =8814=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=8812:41=E5=AF=AB=E9=81=93= =EF=BC=9A > > Hi Chun-Kuang, > > Missatge de Enric Balletbo i Serra del > dia dv., 1 de maig 2020 a les 17:25: > > > > 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 > > A gentle ping on this, I think that this one is the only one that > still needs a review in the series. This is what I reply in patch v3: I think the panel is wrapped into next_bridge here, if (panel) { dsi->next_bridge =3D devm_drm_panel_bridge_add(dev, panel); so the next_bridge is a panel_bridge, in its attach function panel_bridge_attach(), according to the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR, if not exist, it would create connector and attach connector to panel. I'm not sure this flag would exist or not, but for both case, it's strange. If exist, you create connector in this patch but no where to attach connector to panel. If not exist, the next_brige would create one connector and this brige would create another connector. I think in your case, mtk_dsi does not directly connect to a panel, so I need a exact explain. Or someone could test this on a directly-connect-panel platform. Regards, Chun-Kuang. > > Thanks, > Enric > > > --- > > > > 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/media= tek/mtk_dsi.c > > index 4f3bd095c1ee..471fcafdf348 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 =3D 1; > > > > - ret =3D drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, 0)= ; > > + ret =3D drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, > > + DRM_BRIDGE_ATTACH_NO_CONNECTOR); > > if (ret) > > goto err_cleanup_encoder; > > > > + dsi->connector =3D drm_bridge_connector_init(drm, &dsi->encoder= ); > > + if (IS_ERR(dsi->connector)) { > > + DRM_ERROR("Unable to create bridge connector\n"); > > + ret =3D PTR_ERR(dsi->connector); > > + goto err_cleanup_encoder; > > + } > > + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); > > + > > return 0; > > > > err_cleanup_encoder: > > -- > > 2.26.2 > > > > > > _______________________________________________ > > Linux-mediatek mailing list > > Linux-mediatek@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-mediatek