| Message ID | 20220111183152.494923-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBZE266HAMGQEOP6PE6Y@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EADCF3F1D5 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jan 2022 19:33:18 +0100 (CET) Received: by mail-pj1-f69.google.com with SMTP id k2-20020a17090a658200b001b399622095sf163957pjj.9 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jan 2022 10:33:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1641925988; cv=pass; d=google.com; s=arc-20160816; b=QATC00Eeko+K7UQ8dAbV1NJKo0YBtbEAcaIoVZHZSDiZLEXIRBJ6RrOTsMhTE+SGX4 kvuUZuB3dGAK3VqUkAuK5x0cqNCsn7sKviUJps+HhJl9z+nHQXY4xKAnTcr7z9+pXngm rNkZdBET+3UrgKr2PykJ54FnTmU4Q/2LIGr/FKdF7CUFsXFDPFz7NAc4rBhDlbfyESvB F8S6BElBG67vc1rByLt+IySFkT81oDNYdqCp4rKhF0NvjWf+etO7k+TTSW939nzVUJyP PrvxBfPAtwg/ywhJdkCBv33b0vqmMeF6RKxgUTVokkYc+ub/jJXfAijURegM0BylEiGo MFOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xA2hfheQhDYKzSJQ/CvpH4xXjR5YtLkQx+HLjHzj/Uw=; b=eCFGu8/r2Ro/tAt0aG5RHWpVrOQ9HBhAHq+ALXlIqEwrRtK+c+zclwCI71ZpwzpUW4 K073uevQfyQQujmme1rQ9aqPrxvH/86nf+KuGUhOC1DniXnxOscnCWhizMr8WyFOAFi1 Gu26iGjwi/a7zExARTKouJHu2s5/8O/NrnVhw+Onp3kXv0JapVptBcUHZnXGomzKlNvX 7HaLQCeCxKZ5WSdT9YP89FvMFTVxE3qPEO63VAJV0UKYy014MvHLhSlceWKGnAJiR09Z Lm0AtdcjZxo+K9v7i8xt33/WGYBXcvn6ZeiQNWrXkNOv07EaPI15G87Hvu5qV5QzCB9R eDfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YjPJV/f/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=xA2hfheQhDYKzSJQ/CvpH4xXjR5YtLkQx+HLjHzj/Uw=; b=UMDno1iwhjmk5g1EbyZ7r3obk0E7t5j6dCeBbu7TriOH2t87+TSLn4GHtYUwPBGA+C Ufrv8uQltn3ZZfaFRdIF7nUK15NsLp1/HvL5T6hNEJlLefO4e1bS7EBZDVHbhBxlg52f J5h/P4eW0J5lrrZyrOimWQdbyquejG/gxRg8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=xA2hfheQhDYKzSJQ/CvpH4xXjR5YtLkQx+HLjHzj/Uw=; b=GLpBhTKksdO2BQDMYZaLKvE4k7YlMiPgY2QiqqCzGcRPR3cVch4bFpwzBmi5BdwxW/ KMOQBDt9F9/+1+cEHpT2PfaMWVQy4xGIkS1yOlMqFLqODE9YO6StJ65NDIa5oi939piu 5jKnic9KCw9lAIlQflbkCo+b0Qnqr5vPy6WTOCGexM9CgNdYc9wMUA3Dk22AbuZqE9fw 8a5iIPmgGjAOmLwUk81LNynPdD71LL+9XJ4MZ9LFvokLs+npgjCrd9ZE/7jeBb90Eg2m kydCiEnrARRMfbPJZKkhLNSqf8sM3JfsGmKx2+osHngMdP8dD0XsyeQUIcbcxkFbjk9a 31YA== X-Gm-Message-State: AOAM530+hdJK55AtsImalWq6k9t0SEQDEe56uqlen+shU6hKf0utC39l 1XhKr3fVgzq4JkKsCSZRAgruthSC X-Google-Smtp-Source: ABdhPJwiI2HO1oSKasNxHqv/d1gvNydkqCLA2zqJyqq8GEcIjnoKZTx+LIFIcvHajg7s7RduEy2+SQ== X-Received: by 2002:a63:9549:: with SMTP id t9mr5151283pgn.107.1641925988308; Tue, 11 Jan 2022 10:33:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:9209:: with SMTP id o9ls5598610pgd.0.gmail; Tue, 11 Jan 2022 10:33:07 -0800 (PST) X-Received: by 2002:a63:2cd2:: with SMTP id s201mr441702pgs.53.1641925987564; Tue, 11 Jan 2022 10:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641925987; cv=none; d=google.com; s=arc-20160816; b=0Tg3DZnmH2rnOC1c13W5ikMwh6KqC5vqAY0mODS+Vf6U09u8Q4j7dPPoI15ABxPD+o /CWwUfdIrwDpzcV6zVFaQPD9GShI3UyeW44ejjmAegnYHzLxgwovFaWb6aL6pqGj4xDs ArG5pi9V6M8jjjb13R+lMAWglnpGC+GT9POPVhSrEYjn+y9bwmOx9DjrvtSGx3ypo/Nu h84+DmCU8lk1MH4IYL9bHJmzWsD9av0q2J9YDzWdpsQZ/Op9qHFE+qdvCZ8kts8OVyBU FmY6Oalr+CSNYSceZ354en7UIe49G5QVRBuetoA8BIP+Hn2t77afHYjy02zZPzlDXy4c ObbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=FanoeZhQY7FxJ7xchmDO1CUnX/wmanXy7A07snqKYas=; b=XUghmYUqguL2NMWloeA/BxHTV1Thys5A2c55i18ZHwZ7qVrRrcM7I03emBQfVbEnK2 4DxrFMVyRagz+GjQcKfHj/jOqquXg/ZWXOwRnS+OQn3jShrKdFujt2SfQZPNTWmQ3+P4 CMD8ufrZBXGiSJTlR8dy6b1gquBJKFQfiDr3KLfyn/3QC3sVm3qx0xEblBLYB32EEgIn nUsToz64GBqo1JQ3vzUhqNKbkdd5z+so04yLeOhSX5qxSEBKULmbRUJHaIXTV26bW24A BH06mx7U6ubK35qIxb2PI//jNREaLR7Tjq5l/sPda8M6GHtoioMjQxAaKwYUvTY1dKE/ Mjvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YjPJV/f/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id o10sor4269670plk.131.2022.01.11.10.33.06 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 11 Jan 2022 10:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:230f:b0:149:f2fe:edaf with SMTP id d15-20020a170903230f00b00149f2feedafmr5754411plh.149.1641925985719; Tue, 11 Jan 2022 10:33:05 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:3a09:a842:9ff2:6831]) by smtp.gmail.com with ESMTPSA id h15sm4067850pfc.89.2022.01.11.10.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 10:33:05 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Linus Walleij <linus.walleij@linaro.org>, Andrzej Hajda <andrzej.hajda@intel.com>, Marek Szyprowski <m.szyprowski@samsung.com> Cc: devicetree@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v3] drm: of: Lookup if child node has panel or bridge Date: Wed, 12 Jan 2022 00:01:52 +0530 Message-Id: <20220111183152.494923-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YjPJV/f/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
[v3] drm: of: Lookup if child node has panel or bridge
|
|
Commit Message
Jagan Teki
Jan. 11, 2022, 6:31 p.m. UTC
Some OF graphs don't require 'port' or 'ports' to represent the
downstream panel or bridge; instead it simply adds a child node
on a given parent node.
drm_of_find_panel_or_bridge can lookup panel or bridge for a given
node based on the OF graph port and endpoint and it fails to use
if the given node has a child panel or bridge.
This patch add support to lookup that given node has child panel
or bridge however that child node is neither a 'port' nor a 'ports'
node.
Example OF graph representation of DSI host, which has 'port'
but not has 'ports' and has child panel node.
dsi {
compatible = "allwinner,sun6i-a31-mipi-dsi";
#address-cells = <1>;
#size-cells = <0>;
port {
dsi_in_tcon0: endpoint {
remote-endpoint = <tcon0_out_dsi>;
};
panel@0 {
reg = <0>;
};
};
Example OF graph representation of DSI host, which has 'ports'
but not has 'port' and has child panel node.
dsi {
compatible = "samsung,exynos5433-mipi-dsi";
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi_to_mic: endpoint {
remote-endpoint = <&mic_to_dsi>;
};
};
};
panel@0 {
reg = <0>;
};
};
Example OF graph representation of DSI host, which has neither
a 'port' nor a 'ports' but has child panel node.
dsi0 {
compatible = "ste,mcde-dsi";
#address-cells = <1>;
#size-cells = <0>;
panel@0 {
reg = <0>;
};
};
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v3:
- updated based on other usecase where 'ports' used along with child
Changes for v2:
- drop of helper
https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/
- support 'port' alone OF graph
- updated comments
- added simple code
drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
Comments
On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: > Some OF graphs don't require 'port' or 'ports' to represent the > downstream panel or bridge; instead it simply adds a child node > on a given parent node. All bindings using OF graph nodes require either port or ports. DSI Host however don't have to use the OF graph, and that's what you're talking about. > drm_of_find_panel_or_bridge can lookup panel or bridge for a given > node based on the OF graph port and endpoint and it fails to use > if the given node has a child panel or bridge. > > This patch add support to lookup that given node has child panel > or bridge however that child node is neither a 'port' nor a 'ports' > node. > > Example OF graph representation of DSI host, which has 'port' > but not has 'ports' and has child panel node. > > dsi { > compatible = "allwinner,sun6i-a31-mipi-dsi"; > #address-cells = <1>; > #size-cells = <0>; > > port { > dsi_in_tcon0: endpoint { > remote-endpoint = <tcon0_out_dsi>; > }; > > panel@0 { > reg = <0>; > }; > }; > > Example OF graph representation of DSI host, which has 'ports' > but not has 'port' and has child panel node. > > dsi { > compatible = "samsung,exynos5433-mipi-dsi"; > #address-cells = <1>; > #size-cells = <0>; > > ports { > #address-cells = <1>; > #size-cells = <0>; > > port@0 { > reg = <0>; > > dsi_to_mic: endpoint { > remote-endpoint = <&mic_to_dsi>; > }; > }; > }; > > panel@0 { > reg = <0>; > }; > }; I can't see how that one makes sense. The endpoint seems to have a single output, yet you also have a panel under it which is also an output? You should have at least the virtual channel of that endpoint somewhere to differentiate data between the panel and whatever is connected on the other side of that endpoint. > Example OF graph representation of DSI host, which has neither > a 'port' nor a 'ports' but has child panel node. > > dsi0 { > compatible = "ste,mcde-dsi"; > #address-cells = <1>; > #size-cells = <0>; > > panel@0 { > reg = <0>; > }; > }; > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > Changes for v3: > - updated based on other usecase where 'ports' used along with child > Changes for v2: > - drop of helper > https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/ > - support 'port' alone OF graph > - updated comments > - added simple code > > drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > index 59d368ea006b..aeddd39b8df6 100644 > --- a/drivers/gpu/drm/drm_of.c > +++ b/drivers/gpu/drm/drm_of.c > @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, > if (panel) > *panel = NULL; > > + /** > + * Some OF graphs don't require 'port' or 'ports' to represent the > + * downstream panel or bridge; instead it simply adds a child node > + * on a given parent node. All OF graphs require either port or ports. DSI hosts can just have a child node. Maxime
On Wed, Jan 12, 2022 at 3:33 PM Maxime Ripard <maxime@cerno.tech> wrote: > > On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: > > Some OF graphs don't require 'port' or 'ports' to represent the > > downstream panel or bridge; instead it simply adds a child node > > on a given parent node. > > All bindings using OF graph nodes require either port or ports. > > DSI Host however don't have to use the OF graph, and that's what you're > talking about. Yes, right now I can see DSI but this change is generic to any OF graph. > > > drm_of_find_panel_or_bridge can lookup panel or bridge for a given > > node based on the OF graph port and endpoint and it fails to use > > if the given node has a child panel or bridge. > > > > This patch add support to lookup that given node has child panel > > or bridge however that child node is neither a 'port' nor a 'ports' > > node. > > > > Example OF graph representation of DSI host, which has 'port' > > but not has 'ports' and has child panel node. > > > > dsi { > > compatible = "allwinner,sun6i-a31-mipi-dsi"; > > #address-cells = <1>; > > #size-cells = <0>; > > > > port { > > dsi_in_tcon0: endpoint { > > remote-endpoint = <tcon0_out_dsi>; > > }; > > > > panel@0 { > > reg = <0>; > > }; > > }; > > > > Example OF graph representation of DSI host, which has 'ports' > > but not has 'port' and has child panel node. > > > > dsi { > > compatible = "samsung,exynos5433-mipi-dsi"; > > #address-cells = <1>; > > #size-cells = <0>; > > > > ports { > > #address-cells = <1>; > > #size-cells = <0>; > > > > port@0 { > > reg = <0>; > > > > dsi_to_mic: endpoint { > > remote-endpoint = <&mic_to_dsi>; > > }; > > }; > > }; > > > > panel@0 { > > reg = <0>; > > }; > > }; > > I can't see how that one makes sense. The endpoint seems to have a > single output, yet you also have a panel under it which is also an > output? You should have at least the virtual channel of that endpoint > somewhere to differentiate data between the panel and whatever is > connected on the other side of that endpoint. Same that I understood so far (based on v2 change), However we have exynos5433 has this pipeline and Andrzej mentioned it is valid pipeline on other thread. May be Andrzej, can give more conclusive evidence for it. > > > Example OF graph representation of DSI host, which has neither > > a 'port' nor a 'ports' but has child panel node. > > > > dsi0 { > > compatible = "ste,mcde-dsi"; > > #address-cells = <1>; > > #size-cells = <0>; > > > > panel@0 { > > reg = <0>; > > }; > > }; > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > Changes for v3: > > - updated based on other usecase where 'ports' used along with child > > Changes for v2: > > - drop of helper > > https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/ > > - support 'port' alone OF graph > > - updated comments > > - added simple code > > > > drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++ > > 1 file changed, 18 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > > index 59d368ea006b..aeddd39b8df6 100644 > > --- a/drivers/gpu/drm/drm_of.c > > +++ b/drivers/gpu/drm/drm_of.c > > @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, > > if (panel) > > *panel = NULL; > > > > + /** > > + * Some OF graphs don't require 'port' or 'ports' to represent the > > + * downstream panel or bridge; instead it simply adds a child node > > + * on a given parent node. > > All OF graphs require either port or ports. DSI hosts can just have a > child node. As commented above, it can be DSI or any host which has child nodes and are looking to find panel/bridge. Thanks, Jagan.
On 12.01.2022 11:14, Jagan Teki wrote: > On Wed, Jan 12, 2022 at 3:33 PM Maxime Ripard <maxime@cerno.tech> wrote: >> On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: >>> Some OF graphs don't require 'port' or 'ports' to represent the >>> downstream panel or bridge; instead it simply adds a child node >>> on a given parent node. >> All bindings using OF graph nodes require either port or ports. >> >> DSI Host however don't have to use the OF graph, and that's what you're >> talking about. > Yes, right now I can see DSI but this change is generic to any OF graph. > >>> drm_of_find_panel_or_bridge can lookup panel or bridge for a given >>> node based on the OF graph port and endpoint and it fails to use >>> if the given node has a child panel or bridge. >>> >>> This patch add support to lookup that given node has child panel >>> or bridge however that child node is neither a 'port' nor a 'ports' >>> node. >>> >>> Example OF graph representation of DSI host, which has 'port' >>> but not has 'ports' and has child panel node. >>> >>> dsi { >>> compatible = "allwinner,sun6i-a31-mipi-dsi"; >>> #address-cells = <1>; >>> #size-cells = <0>; >>> >>> port { >>> dsi_in_tcon0: endpoint { >>> remote-endpoint = <tcon0_out_dsi>; >>> }; >>> >>> panel@0 { >>> reg = <0>; >>> }; >>> }; >>> >>> Example OF graph representation of DSI host, which has 'ports' >>> but not has 'port' and has child panel node. >>> >>> dsi { >>> compatible = "samsung,exynos5433-mipi-dsi"; >>> #address-cells = <1>; >>> #size-cells = <0>; >>> >>> ports { >>> #address-cells = <1>; >>> #size-cells = <0>; >>> >>> port@0 { >>> reg = <0>; >>> >>> dsi_to_mic: endpoint { >>> remote-endpoint = <&mic_to_dsi>; >>> }; >>> }; >>> }; >>> >>> panel@0 { >>> reg = <0>; >>> }; >>> }; >> I can't see how that one makes sense. The endpoint seems to have a >> single output, yet you also have a panel under it which is also an >> output? You should have at least the virtual channel of that endpoint >> somewhere to differentiate data between the panel and whatever is >> connected on the other side of that endpoint. > Same that I understood so far (based on v2 change), However we have > exynos5433 has this pipeline and Andrzej mentioned it is valid > pipeline on other thread. > > May be Andrzej, can give more conclusive evidence for it. Hmm, this is DSI bridge (or encoder), which has one input (connected to mic, described by port 0) and one output (connected to DSI panel described by child relationship). It looks for me quite natural. Regards Andrzej > >>> Example OF graph representation of DSI host, which has neither >>> a 'port' nor a 'ports' but has child panel node. >>> >>> dsi0 { >>> compatible = "ste,mcde-dsi"; >>> #address-cells = <1>; >>> #size-cells = <0>; >>> >>> panel@0 { >>> reg = <0>; >>> }; >>> }; >>> >>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> >>> --- >>> Changes for v3: >>> - updated based on other usecase where 'ports' used along with child >>> Changes for v2: >>> - drop of helper >>> https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/ >>> - support 'port' alone OF graph >>> - updated comments >>> - added simple code >>> >>> drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++ >>> 1 file changed, 18 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c >>> index 59d368ea006b..aeddd39b8df6 100644 >>> --- a/drivers/gpu/drm/drm_of.c >>> +++ b/drivers/gpu/drm/drm_of.c >>> @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, >>> if (panel) >>> *panel = NULL; >>> >>> + /** >>> + * Some OF graphs don't require 'port' or 'ports' to represent the >>> + * downstream panel or bridge; instead it simply adds a child node >>> + * on a given parent node. >> All OF graphs require either port or ports. DSI hosts can just have a >> child node. > As commented above, it can be DSI or any host which has child nodes > and are looking to find panel/bridge. > > Thanks, > Jagan.
On Wed, Jan 12, 2022 at 03:44:00PM +0530, Jagan Teki wrote: > On Wed, Jan 12, 2022 at 3:33 PM Maxime Ripard <maxime@cerno.tech> wrote: > > > > On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: > > > Some OF graphs don't require 'port' or 'ports' to represent the > > > downstream panel or bridge; instead it simply adds a child node > > > on a given parent node. > > > > All bindings using OF graph nodes require either port or ports. > > > > DSI Host however don't have to use the OF graph, and that's what you're > > talking about. > > Yes, right now I can see DSI but this change is generic to any OF graph. Not really? Generic to all users of drm_of_find_panel_or_bridge sure, but DSI is the only use case where we could have bridges or panels that would be child of the user. > > > drm_of_find_panel_or_bridge can lookup panel or bridge for a given > > > node based on the OF graph port and endpoint and it fails to use > > > if the given node has a child panel or bridge. > > > > > > This patch add support to lookup that given node has child panel > > > or bridge however that child node is neither a 'port' nor a 'ports' > > > node. > > > > > > Example OF graph representation of DSI host, which has 'port' > > > but not has 'ports' and has child panel node. > > > > > > dsi { > > > compatible = "allwinner,sun6i-a31-mipi-dsi"; > > > #address-cells = <1>; > > > #size-cells = <0>; > > > > > > port { > > > dsi_in_tcon0: endpoint { > > > remote-endpoint = <tcon0_out_dsi>; > > > }; > > > > > > panel@0 { > > > reg = <0>; > > > }; > > > }; > > > > > > Example OF graph representation of DSI host, which has 'ports' > > > but not has 'port' and has child panel node. > > > > > > dsi { > > > compatible = "samsung,exynos5433-mipi-dsi"; > > > #address-cells = <1>; > > > #size-cells = <0>; > > > > > > ports { > > > #address-cells = <1>; > > > #size-cells = <0>; > > > > > > port@0 { > > > reg = <0>; > > > > > > dsi_to_mic: endpoint { > > > remote-endpoint = <&mic_to_dsi>; > > > }; > > > }; > > > }; > > > > > > panel@0 { > > > reg = <0>; > > > }; > > > }; > > > > I can't see how that one makes sense. The endpoint seems to have a > > single output, yet you also have a panel under it which is also an > > output? You should have at least the virtual channel of that endpoint > > somewhere to differentiate data between the panel and whatever is > > connected on the other side of that endpoint. > > Same that I understood so far (based on v2 change), However we have > exynos5433 has this pipeline and Andrzej mentioned it is valid > pipeline on other thread. > > May be Andrzej, can give more conclusive evidence for it. > > > > > > Example OF graph representation of DSI host, which has neither > > > a 'port' nor a 'ports' but has child panel node. > > > > > > dsi0 { > > > compatible = "ste,mcde-dsi"; > > > #address-cells = <1>; > > > #size-cells = <0>; > > > > > > panel@0 { > > > reg = <0>; > > > }; > > > }; > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > --- > > > Changes for v3: > > > - updated based on other usecase where 'ports' used along with child > > > Changes for v2: > > > - drop of helper > > > https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/ > > > - support 'port' alone OF graph > > > - updated comments > > > - added simple code > > > > > > drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++ > > > 1 file changed, 18 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > > > index 59d368ea006b..aeddd39b8df6 100644 > > > --- a/drivers/gpu/drm/drm_of.c > > > +++ b/drivers/gpu/drm/drm_of.c > > > @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, > > > if (panel) > > > *panel = NULL; > > > > > > + /** > > > + * Some OF graphs don't require 'port' or 'ports' to represent the > > > + * downstream panel or bridge; instead it simply adds a child node > > > + * on a given parent node. > > > > All OF graphs require either port or ports. DSI hosts can just have a > > child node. > > As commented above, it can be DSI or any host which has child nodes > and are looking to find panel/bridge. DSI is the only case in this situation, but ok. It still has nothing to do with OF graph. All bindings using OF graph will require either port or ports, and the DSI binding doesn't mandate to use OF graph. So the comment above is misleading at best. Maxime
On Wed, Jan 12, 2022 at 12:45:23PM +0100, Andrzej Hajda wrote: > > On 12.01.2022 11:14, Jagan Teki wrote: > > On Wed, Jan 12, 2022 at 3:33 PM Maxime Ripard <maxime@cerno.tech> wrote: > > > On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: > > > > Some OF graphs don't require 'port' or 'ports' to represent the > > > > downstream panel or bridge; instead it simply adds a child node > > > > on a given parent node. > > > All bindings using OF graph nodes require either port or ports. > > > > > > DSI Host however don't have to use the OF graph, and that's what you're > > > talking about. > > Yes, right now I can see DSI but this change is generic to any OF graph. > > > > > > drm_of_find_panel_or_bridge can lookup panel or bridge for a given > > > > node based on the OF graph port and endpoint and it fails to use > > > > if the given node has a child panel or bridge. > > > > > > > > This patch add support to lookup that given node has child panel > > > > or bridge however that child node is neither a 'port' nor a 'ports' > > > > node. > > > > > > > > Example OF graph representation of DSI host, which has 'port' > > > > but not has 'ports' and has child panel node. > > > > > > > > dsi { > > > > compatible = "allwinner,sun6i-a31-mipi-dsi"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > port { > > > > dsi_in_tcon0: endpoint { > > > > remote-endpoint = <tcon0_out_dsi>; > > > > }; > > > > > > > > panel@0 { > > > > reg = <0>; > > > > }; > > > > }; > > > > > > > > Example OF graph representation of DSI host, which has 'ports' > > > > but not has 'port' and has child panel node. > > > > > > > > dsi { > > > > compatible = "samsung,exynos5433-mipi-dsi"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > ports { > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > port@0 { > > > > reg = <0>; > > > > > > > > dsi_to_mic: endpoint { > > > > remote-endpoint = <&mic_to_dsi>; > > > > }; > > > > }; > > > > }; > > > > > > > > panel@0 { > > > > reg = <0>; > > > > }; > > > > }; > > > I can't see how that one makes sense. The endpoint seems to have a > > > single output, yet you also have a panel under it which is also an > > > output? You should have at least the virtual channel of that endpoint > > > somewhere to differentiate data between the panel and whatever is > > > connected on the other side of that endpoint. > > Same that I understood so far (based on v2 change), However we have > > exynos5433 has this pipeline and Andrzej mentioned it is valid > > pipeline on other thread. > > > > May be Andrzej, can give more conclusive evidence for it. > > > Hmm, this is DSI bridge (or encoder), which has one input (connected to mic, > described by port 0) and one output (connected to DSI panel described by > child relationship). > > It looks for me quite natural. Yeah, the dsi_to_mic feels weird if DSI is the receiver here, but it makes sense, thanks Maxime
On Wed, Jan 12, 2022 at 6:37 PM Maxime Ripard <maxime@cerno.tech> wrote: > > On Wed, Jan 12, 2022 at 03:44:00PM +0530, Jagan Teki wrote: > > On Wed, Jan 12, 2022 at 3:33 PM Maxime Ripard <maxime@cerno.tech> wrote: > > > > > > On Wed, Jan 12, 2022 at 12:01:52AM +0530, Jagan Teki wrote: > > > > Some OF graphs don't require 'port' or 'ports' to represent the > > > > downstream panel or bridge; instead it simply adds a child node > > > > on a given parent node. > > > > > > All bindings using OF graph nodes require either port or ports. > > > > > > DSI Host however don't have to use the OF graph, and that's what you're > > > talking about. > > > > Yes, right now I can see DSI but this change is generic to any OF graph. > > Not really? Generic to all users of drm_of_find_panel_or_bridge sure, > but DSI is the only use case where we could have bridges or panels that > would be child of the user. > > > > > drm_of_find_panel_or_bridge can lookup panel or bridge for a given > > > > node based on the OF graph port and endpoint and it fails to use > > > > if the given node has a child panel or bridge. > > > > > > > > This patch add support to lookup that given node has child panel > > > > or bridge however that child node is neither a 'port' nor a 'ports' > > > > node. > > > > > > > > Example OF graph representation of DSI host, which has 'port' > > > > but not has 'ports' and has child panel node. > > > > > > > > dsi { > > > > compatible = "allwinner,sun6i-a31-mipi-dsi"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > port { > > > > dsi_in_tcon0: endpoint { > > > > remote-endpoint = <tcon0_out_dsi>; > > > > }; > > > > > > > > panel@0 { > > > > reg = <0>; > > > > }; > > > > }; > > > > > > > > Example OF graph representation of DSI host, which has 'ports' > > > > but not has 'port' and has child panel node. > > > > > > > > dsi { > > > > compatible = "samsung,exynos5433-mipi-dsi"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > ports { > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > port@0 { > > > > reg = <0>; > > > > > > > > dsi_to_mic: endpoint { > > > > remote-endpoint = <&mic_to_dsi>; > > > > }; > > > > }; > > > > }; > > > > > > > > panel@0 { > > > > reg = <0>; > > > > }; > > > > }; > > > > > > I can't see how that one makes sense. The endpoint seems to have a > > > single output, yet you also have a panel under it which is also an > > > output? You should have at least the virtual channel of that endpoint > > > somewhere to differentiate data between the panel and whatever is > > > connected on the other side of that endpoint. > > > > Same that I understood so far (based on v2 change), However we have > > exynos5433 has this pipeline and Andrzej mentioned it is valid > > pipeline on other thread. > > > > May be Andrzej, can give more conclusive evidence for it. > > > > > > > > > Example OF graph representation of DSI host, which has neither > > > > a 'port' nor a 'ports' but has child panel node. > > > > > > > > dsi0 { > > > > compatible = "ste,mcde-dsi"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > panel@0 { > > > > reg = <0>; > > > > }; > > > > }; > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > --- > > > > Changes for v3: > > > > - updated based on other usecase where 'ports' used along with child > > > > Changes for v2: > > > > - drop of helper > > > > https://patchwork.kernel.org/project/dri-devel/cover/20211207054747.461029-1-jagan@amarulasolutions.com/ > > > > - support 'port' alone OF graph > > > > - updated comments > > > > - added simple code > > > > > > > > drivers/gpu/drm/drm_of.c | 18 ++++++++++++++++++ > > > > 1 file changed, 18 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > > > > index 59d368ea006b..aeddd39b8df6 100644 > > > > --- a/drivers/gpu/drm/drm_of.c > > > > +++ b/drivers/gpu/drm/drm_of.c > > > > @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, > > > > if (panel) > > > > *panel = NULL; > > > > > > > > + /** > > > > + * Some OF graphs don't require 'port' or 'ports' to represent the > > > > + * downstream panel or bridge; instead it simply adds a child node > > > > + * on a given parent node. > > > > > > All OF graphs require either port or ports. DSI hosts can just have a > > > child node. > > > > As commented above, it can be DSI or any host which has child nodes > > and are looking to find panel/bridge. > > DSI is the only case in this situation, but ok. It still has nothing to > do with OF graph. All bindings using OF graph will require either port > or ports, and the DSI binding doesn't mandate to use OF graph. So the > comment above is misleading at best. Okay. How about this updated comment? /** * All bindings using OF graph will require either 'port' or 'ports' * to represent the downstream panel or bridge however the DSI binding * doesn't mandate to use OF graph; instead it simply adds a panel or * bridge in child node. * * Lookup that child node for a given parent however that child is * neither a 'port' nor a 'ports' node. */ Thanks, Jagan.
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 59d368ea006b..aeddd39b8df6 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -249,6 +249,22 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, if (panel) *panel = NULL; + /** + * Some OF graphs don't require 'port' or 'ports' to represent the + * downstream panel or bridge; instead it simply adds a child node + * on a given parent node. + * + * Lookup that child node for a given parent however that child is + * neither a 'port' nor a 'ports' node. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; + } + /* * of_graph_get_remote_node() produces a noisy error message if port * node isn't found and the absence of the port is a legit case here, @@ -259,6 +275,8 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, return -ENODEV; remote = of_graph_get_remote_node(np, port, endpoint); + +of_find_panel_or_bridge: if (!remote) return -ENODEV;