[PATCH v13 02/18] drm: bridge: panel: Support nodrm case for drmm_panel_bridge_add

Maxime Ripard maxime at cerno.tech
Mon Feb 27 04:11:49 PST 2023


On Mon, Feb 27, 2023 at 05:09:09PM +0530, Jagan Teki wrote:
> drmm_panel_bridge_add DRM-managed action helper is useful for the bridge
> which automatically removes the bridge when drm pointer is cleaned.
> 
> Supporting the same on non-component bridges like host DSI bridge requires
> a drm pointer which is indeed available only when a panel-bridge is found.
> 
> For these use cases, the caller would call the drmm_panel_bridge_add by
> passing NULL to drm pointer.
> 
> So, assign the bridge->dev to drm pointer for those cases.
> 
> Cc: Maxime Ripard <mripard at kernel.org>
> Cc: Laurent Pinchart <Laurent.pinchart at ideasonboard.com>
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> ---
> Changes for v13:
> - new patch
> 
> Note: use case on 
> "[PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper"
> 
>  drivers/gpu/drm/bridge/panel.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index d4b112911a99..45a0c6671000 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -402,6 +402,13 @@ struct drm_bridge *drmm_panel_bridge_add(struct drm_device *drm,
>  	if (IS_ERR(bridge))
>  		return bridge;
>  
> +	/*
> +	 * For non-component bridges, like host DSI bridge the DRM pointer
> +	 * can be available only when a panel-bridge is found.
> +	 */
> +	if (!drm)
> +		drm = bridge->dev;
> +

Why can't the caller use bridge->dev?

Also, where did the devm_drm_of_dsi_get_bridge go? I thought you were
going to convert it to a drm-managed version?

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230227/0f60b605/attachment-0001.sig>


More information about the linux-arm-kernel mailing list