Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936234AbdCXOXC (ORCPT ); Fri, 24 Mar 2017 10:23:02 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33671 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936199AbdCXOWv (ORCPT ); Fri, 24 Mar 2017 10:22:51 -0400 Date: Fri, 24 Mar 2017 10:22:42 -0400 From: Sean Paul To: Rob Herring Cc: David Airlie , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Boris Brezillon , Archit Taneja , Jingoo Han , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , Stefan Agner , Alison Wang , Xinliang Liu , Rongrong Zou , Xinwei Kong , Chen Feng , Philipp Zabel , CK Hu , Matthias Brugger , Marek Vasut , Mark Yao , Heiko Stuebner , Maxime Ripard , Chen-Yu Tsai , Liviu Dudau , Mali DP Maintainers , Neil Armstrong , Carlo Caione , Kevin Hilman , Rob Clark , Jyri Sarha , Tomi Valkeinen , Eric Anholt , Russell King Subject: Re: [PATCH v3 4/5] drm: convert drivers to use drm_of_find_panel_or_bridge Message-ID: <20170324142242.svlpr2hzcodou2vz@art_vandelay> References: <20170322132608.17353-1-robh@kernel.org> <20170322132608.17353-5-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170322132608.17353-5-robh@kernel.org> User-Agent: NeoMutt/20170306-66-6ddb52-dirty (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4888 Lines: 137 On Wed, Mar 22, 2017 at 08:26:07AM -0500, Rob Herring wrote: > Similar to the previous commit, convert drivers open coding OF graph > parsing to use drm_of_find_panel_or_bridge instead. > > This changes some error messages to debug messages (in the graph core). > Graph connections are often "no connects" depending on the particular > board, so we want to avoid spurious messages. Plus the kernel is not a > DT validator. > > Signed-off-by: Rob Herring > Reviewed-by: Archit Taneja > --- > v3: > - rebase to v4.11-rc2 > - rework atmel to support 1 to N connections > > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 73 ++++++------------- > drivers/gpu/drm/bridge/nxp-ptn3460.c | 16 ++--- > drivers/gpu/drm/bridge/parade-ps8622.c | 16 ++--- > drivers/gpu/drm/bridge/tc358767.c | 27 +------ > drivers/gpu/drm/exynos/exynos_dp.c | 35 ++++----- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 39 +++------- > drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 27 ++----- > drivers/gpu/drm/imx/imx-ldb.c | 27 ++----- > drivers/gpu/drm/imx/parallel-display.c | 36 ++-------- > drivers/gpu/drm/mediatek/mtk_dsi.c | 23 ++---- > drivers/gpu/drm/mxsfb/mxsfb_out.c | 40 ++--------- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 26 ++----- > drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 +-- > drivers/gpu/drm/sun4i/sun4i_tcon.c | 90 ++---------------------- > 14 files changed, 92 insertions(+), 394 deletions(-) > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c > index c3651456c963..511d68e22452 100644 > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > > #include "fsl_dcu_drm_drv.h" > @@ -141,28 +142,6 @@ static int fsl_dcu_attach_panel(struct fsl_dcu_drm_device *fsl_dev, > return ret; > } > > -static int fsl_dcu_attach_endpoint(struct fsl_dcu_drm_device *fsl_dev, > - const struct of_endpoint *ep) > -{ > - struct drm_bridge *bridge; > - struct device_node *np; > - > - np = of_graph_get_remote_port_parent(ep->local_node); > - > - fsl_dev->connector.panel = of_drm_find_panel(np); > - if (fsl_dev->connector.panel) { > - of_node_put(np); > - return fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel); > - } > - > - bridge = of_drm_find_bridge(np); > - of_node_put(np); > - if (!bridge) > - return -ENODEV; > - > - return drm_bridge_attach(&fsl_dev->encoder, bridge, NULL); > -} > - > int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev) > { > struct of_endpoint ep; > @@ -179,14 +158,14 @@ int fsl_dcu_create_outputs(struct fsl_dcu_drm_device *fsl_dev) > return fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel); > } > > - ep_node = of_graph_get_next_endpoint(fsl_dev->np, NULL); > - if (!ep_node) > - return -ENODEV; > - > - ret = of_graph_parse_endpoint(ep_node, &ep); > - of_node_put(ep_node); > + ret = drm_of_find_panel_or_bridge(fsl_dev->np, 0, 0, &panel, &bridge); Hi Rob, Apologies for the delay, I've been dealing with overhead the past few days. I ran across this compile error when build testing your set. ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function ‘fsl_dcu_create_outputs’: ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:161:56: error: ‘panel’ undeclared (first use in this function) ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:161:56: note: each undeclared identifier is reported only once for each function it appears in ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:161:64: error: ‘bridge’ undeclared (first use in this function) ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:148:22: warning: unused variable ‘ep_node’ [-Wunused-variable] ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:147:21: warning: unused variable ‘ep’ [-Wunused-variable] ../drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:171:1: warning: control reaches end of non-void function [-Wreturn-type] make[5]: *** [drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.o] Error 1 make[4]: *** [drivers/gpu/drm/fsl-dcu] Error 2 make[4]: *** Waiting for unfinished jobs.... The defconfigs we use can be found here: https://cgit.freedesktop.org/drm/drm-tip/tree/?h=rerere-cache Sean > if (ret) > - return -ENODEV; > + return ret; > > - return fsl_dcu_attach_endpoint(fsl_dev, &ep); > + if (panel) { > + fsl_dev->connector.panel = panel; > + return fsl_dcu_attach_panel(fsl_dev, panel); > + } > + > + return drm_bridge_attach(&fsl_dev->encoder, bridge, NULL); > -- > 2.10.1 > -- Sean Paul, Software Engineer, Google / Chromium OS