lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190802080821.GG5008@pendragon.ideasonboard.com>
Date:   Fri, 2 Aug 2019 11:08:21 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Fabrizio Castro <fabrizio.castro@...renesas.com>
Cc:     Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
        Jacopo Mondi <jacopo+renesas@...ndi.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, linux-renesas-soc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Simon Horman <horms@...ge.net.au>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Chris Paterson <Chris.Paterson2@...esas.com>,
        Biju Das <biju.das@...renesas.com>
Subject: Re: [PATCH/RFC 06/12] drm: rcar-du: lvds: Do not look at ports for
 identifying bridges

Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:03AM +0100, Fabrizio Castro wrote:
> We may be connected to a dual LVDS display, therefore checking
> if node != remote_input for identifying bridges is not going to
> work anymore.
> We could try to match the ports on the remote end to the LVDS
> encoders, however the companion LVDS encoder instance doesn't
> hold a reference to the primary LVDS encoder instance.
> We know we could be connected to either a bridge, or a panel,
> therefore look through the registered bridges and panels, until
> we have a match.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@...renesas.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_lvds.c | 29 +++--------------------------
>  1 file changed, 3 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index c306fab..2d54ae5 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -711,10 +711,7 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds)
>  static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
>  {
>  	struct device_node *local_output = NULL;
> -	struct device_node *remote_input = NULL;
>  	struct device_node *remote = NULL;
> -	struct device_node *node;
> -	bool is_bridge = false;
>  	int ret = 0;
>  
>  	local_output = of_graph_get_endpoint_by_regs(lvds->dev->of_node, 1, 0);
> @@ -742,27 +739,8 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
>  		goto done;
>  	}
>  
> -	remote_input = of_graph_get_remote_endpoint(local_output);
> -
> -	for_each_endpoint_of_node(remote, node) {
> -		if (node != remote_input) {
> -			/*
> -			 * We've found one endpoint other than the input, this
> -			 * must be a bridge.
> -			 */
> -			is_bridge = true;
> -			of_node_put(node);
> -			break;
> -		}
> -	}
> -
> -	if (is_bridge) {
> -		lvds->next_bridge = of_drm_find_bridge(remote);
> -		if (!lvds->next_bridge) {
> -			ret = -EPROBE_DEFER;
> -			goto done;
> -		}
> -
> +	lvds->next_bridge = of_drm_find_bridge(remote);

How about using drm_of_find_panel_or_bridge() ?

> +	if (lvds->next_bridge) {
>  		if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK)
>  			lvds->dual_link = lvds->next_bridge->timings
>  					? lvds->next_bridge->timings->dual_link
> @@ -770,7 +748,7 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
>  	} else {
>  		lvds->panel = of_drm_find_panel(remote);
>  		if (IS_ERR(lvds->panel)) {
> -			ret = PTR_ERR(lvds->panel);
> +			ret = -EPROBE_DEFER;
>  			goto done;
>  		}
>  	}
> @@ -784,7 +762,6 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
>  
>  done:
>  	of_node_put(local_output);
> -	of_node_put(remote_input);
>  	of_node_put(remote);
>  
>  	switch (ret) {

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ