From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH v4 2/3] drm/tegra: output: Support DRM bridges Date: Fri, 17 Apr 2020 22:30:18 +0300 Message-ID: <20200417193018.GI5861@pendragon.ideasonboard.com> References: <20200417175238.27154-1-digetx@gmail.com> <20200417175238.27154-3-digetx@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20200417175238.27154-3-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dmitry Osipenko Cc: Thierry Reding , Sam Ravnborg , dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org Hi Dmitry, Thank you for the patch. On Fri, Apr 17, 2020 at 08:52:37PM +0300, Dmitry Osipenko wrote: > Newer Tegra device-trees will specify a video output graph which involves > a bridge. This patch adds initial support for the DRM bridges to the > Tegra's DRM output. > > Signed-off-by: Dmitry Osipenko > --- > drivers/gpu/drm/tegra/drm.h | 2 ++ > drivers/gpu/drm/tegra/output.c | 13 ++++++++++++- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h > index 804869799305..cccd368b6752 100644 > --- a/drivers/gpu/drm/tegra/drm.h > +++ b/drivers/gpu/drm/tegra/drm.h > @@ -12,6 +12,7 @@ > #include > > #include > +#include You could add a forward declaration of struct drm_bridge instead, that can lower the compilation time a little bit. > #include > #include > #include > @@ -116,6 +117,7 @@ struct tegra_output { > struct device_node *of_node; > struct device *dev; > > + struct drm_bridge *bridge; > struct drm_panel *panel; > struct i2c_adapter *ddc; > const struct edid *edid; > diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c > index a6a711d54e88..ec0cd4a1ced1 100644 > --- a/drivers/gpu/drm/tegra/output.c > +++ b/drivers/gpu/drm/tegra/output.c > @@ -5,6 +5,7 @@ > */ > > #include > +#include > #include > #include > > @@ -92,13 +93,23 @@ static irqreturn_t hpd_irq(int irq, void *data) > > int tegra_output_probe(struct tegra_output *output) > { > - struct device_node *ddc, *panel; > + struct device_node *ddc, *panel, *port; > unsigned long flags; > int err, size; > > if (!output->of_node) > output->of_node = output->dev->of_node; > > + port = of_get_child_by_name(output->of_node, "port"); Do you need to check for the presence of a port node first ? Can you just check the return value of drm_of_find_panel_or_bridge(), and fall back to "nvidia,panel" if it returns -ENODEV ? > + if (port) { > + err = drm_of_find_panel_or_bridge(output->of_node, 0, 0, NULL, > + &output->bridge); > + of_node_put(port); > + > + if (err) > + return err; > + } > + > panel = of_parse_phandle(output->of_node, "nvidia,panel", 0); > if (panel) { > output->panel = of_drm_find_panel(panel); -- Regards, Laurent Pinchart