[PATCH v1 1/3] drm/stm: ltdc: Add bridge support

Eric Anholt eric at anholt.net
Thu May 18 18:31:20 UTC 2017


Philippe CORNU <philippe.cornu at st.com> writes:

> Add the bridge support, used by DSI host and HDMI/LVDS bridges.
>
> Signed-off-by: Philippe CORNU <philippe.cornu at st.com>

> @@ -987,19 +1024,36 @@ static struct drm_panel *ltdc_get_panel(struct drm_device *ddev)
>  
>  		port = of_graph_get_remote_port_parent(entity);
>  		if (port) {
> +			struct drm_bridge *bridge;
> +			struct drm_panel *panel;
> +
> +			bridge = of_drm_find_bridge(port);
>  			panel = of_drm_find_panel(port);
> -			of_node_put(port);
> +			if (!bridge && !panel) {
> +				of_node_put(entity);
> +				return -EPROBE_DEFER;
> +			}
> +
> +			if (bridge) {
> +				if (!ldev->bridge) {
> +					ldev->bridge = bridge;
> +					DRM_INFO("remote bridge %s\n",
> +						 port->full_name);
> +				}
> +			}
> +
>  			if (panel) {
> -				DRM_DEBUG_DRIVER("remote panel %s\n",
> +				if (!ldev->panel) {
> +					ldev->panel = panel;
> +					DRM_INFO("remote panel %s\n",
>  						 port->full_name);
> -			} else {
> -				DRM_DEBUG_DRIVER("panel missing\n");
> -				of_node_put(entity);
> +				}
>  			}
> +			of_node_put(port);

Is it possible to use drm_of_find_panel_or_bridge() instead?  I don't
think it makes sense to have both a bridge and a panel for the same
node, does it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170518/55a135d8/attachment.sig>


More information about the dri-devel mailing list