Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3427603ybt; Sat, 4 Jul 2020 17:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsCbVm3iIGQEwzLUWUZgIHWeMp01ERS3r8vl3q2PSl5vRLU9kHEOux0Oh5gBtdcwUmvlBy X-Received: by 2002:aa7:d802:: with SMTP id v2mr40534383edq.77.1593908224614; Sat, 04 Jul 2020 17:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593908224; cv=none; d=google.com; s=arc-20160816; b=E5bfNgmRbrL0HTZI6NmhevdbjGSY3wcXCkCjJEBgsbB3jfDJbGtPzFAyeEBg4PYttA ZgjqPg7pTp059k4wQPLNp22GqpOk3Ucay40qQ8lrREdilKbtkQaCeNhJOAlPTvhZl/nq cOq4zMJPIdUyMc29HgasTuLN6ZVj+DqTKVClRUSZxDFAmn1CywFK4Q+cXJNKYi+82Kue kgnstYDywTW+WGTJ4URK5+omcNxfhaZ8laK0UJBh8IZ6cqS8UJAAOohFDtEFzypp8elQ 7rwp/ayI/56pfq9Z4UJkLtonsZE7yPvLwaYK6+tHWyY5QKCE1XwQvSb4uAWmK5iAdihl W2kw== 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=ExcuIFZO2wPL1mMhWzPkLzzarrngktO8+RTnKZAwJjQ=; b=wjUKqzPkYCmRwdxLDEtDwLifH3ElSYb73fmEuzBuYBlRyvBnatK0eyUYKeqR/O5zwS nsWcw+/BO/pjd6hz2i3oJ7+AkNrkIECADS8aSdleBFhoWVS62Z/CBXpZSDISg3jQ3vRd QN1Zk8ppe5yTvvpcWXXKkpIaDxkfBHpEjy0pHpetFq+vIQg77DotF9N55mFC7GC3d9KQ zKXmAWN1i519tzuQ9g+BPh+dodPZw4byDIv0WS6eBhwqWPVsM+42R+qO6OTa8JtORWYW MmhIvBjbpG3qqHqw4kq/cPbIpgijLlTFep4UE7ucY8UB63fQBphXlNmhk7H4Xa3TwRU7 uOAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Fo/T8nV8"; 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 d14si9899210eje.95.2020.07.04.17.16.40; Sat, 04 Jul 2020 17:17:04 -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="Fo/T8nV8"; 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 S1728010AbgGEAPf (ORCPT + 99 others); Sat, 4 Jul 2020 20:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:51834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbgGEAPf (ORCPT ); Sat, 4 Jul 2020 20:15:35 -0400 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.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 4327A208D5 for ; Sun, 5 Jul 2020 00:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593908134; bh=iH3aDb4sdbfsSHuXjwPQYPJDHIzy2wXOVaJjcjHJR7g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Fo/T8nV8UTUf3nPFZcibQZ67/VzukqzyFnAcDMStbL5s7VdtB5HV5cZ6Qj6U4Wbrx 0PXAfaa611CB5ksiokKPx83nI5/emE1xVDTgqmmY76bzRtjyclvLJdLq6axogE0qmN 8Dl5YoLtQStEYxfv2PWmvSgHsQ/ii7Mta8rH98EI= Received: by mail-ej1-f53.google.com with SMTP id n26so24788042ejx.0 for ; Sat, 04 Jul 2020 17:15:34 -0700 (PDT) X-Gm-Message-State: AOAM5307gokFCyXVbyzuohq4kYolpld/4M5bs11bGAMtB6p2Q3tBjB47 bmaXNlUDs+2bq7TnFduvRWX7nODz4r5oECCKgg== X-Received: by 2002:a17:906:1e83:: with SMTP id e3mr23125845ejj.7.1593908132783; Sat, 04 Jul 2020 17:15:32 -0700 (PDT) MIME-Version: 1.0 References: <20200615203108.786083-1-enric.balletbo@collabora.com> <20200615203108.786083-8-enric.balletbo@collabora.com> In-Reply-To: <20200615203108.786083-8-enric.balletbo@collabora.com> From: Chun-Kuang Hu Date: Sun, 5 Jul 2020 08:15:21 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND PATCH v4 7/7] drm/mediatek: mtk_dsi: Create connector for bridges To: Enric Balletbo i Serra Cc: linux-kernel , Collabora Kernel ML , Matthias Brugger , Nicolas Boichat , Hsin-Yi Wang , Laurent Pinchart , Sam Ravnborg , Chun-Kuang Hu , Daniel Vetter , David Airlie , Philipp Zabel , DRI Development , Linux ARM , "moderated list:ARM/Mediatek SoC support" 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 i Serra =E6=96=BC 2020=E5=B9= =B46=E6=9C=8816=E6=97=A5 =E9=80=B1=E4=BA=8C =E4=B8=8A=E5=8D=884:31=E5=AF=AB= =E9=81=93=EF=BC=9A > > 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. Applied to mediatek-drm-next [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/= log/?h=3Dmediatek-drm-next Regards, Chun-Kuang. > > 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. (L= aurent 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/mediate= k/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 =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.27.0 >