On Wed, Sep 16, 2026 at 03:45:36PM +0200, Luca Ceresoli wrote:
> Now a panel_bridge is automatically created for every drm_panel and the
> panel-bridge API is just a deprecated wrapper to access it.
> 
> Update and simplify the code by just getting a reference to the
> already-existing bridge using of_drm_find_and_get_bridge().
> 
> Also keep the "connected to non-panel bridge (unsupported)\n" error logic
> by using the drm_bridge_is_panel() function.
> 
> Signed-off-by: Luca Ceresoli <[email protected]>
> ---
>  drivers/gpu/drm/mcde/Kconfig    |  1 -
>  drivers/gpu/drm/mcde/mcde_dsi.c | 41 
> +++++++++--------------------------------
>  2 files changed, 9 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mcde/Kconfig b/drivers/gpu/drm/mcde/Kconfig
> index 6ebfb930cbfa..81e7d3796c06 100644
> --- a/drivers/gpu/drm/mcde/Kconfig
> +++ b/drivers/gpu/drm/mcde/Kconfig
> @@ -10,7 +10,6 @@ config DRM_MCDE
>       select DRM_MIPI_DSI
>       select DRM_BRIDGE
>       select DRM_PANEL
> -     select DRM_PANEL_BRIDGE
>       select DRM_KMS_HELPER
>       select DRM_GEM_DMA_HELPER
>       help
> diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
> index 77cf253a2152..daac8d67913d 100644
> --- a/drivers/gpu/drm/mcde/mcde_dsi.c
> +++ b/drivers/gpu/drm/mcde/mcde_dsi.c
> @@ -37,7 +37,6 @@ struct mcde_dsi {
>       struct device *dev;
>       struct mcde *mcde;
>       struct drm_bridge bridge;
> -     struct drm_panel *panel;
>       struct mipi_dsi_host dsi_host;
>       struct mipi_dsi_device *mdsi;
>       const struct drm_display_mode *mode;
> @@ -1074,7 +1073,6 @@ static int mcde_dsi_bind(struct device *dev, struct 
> device *master,
>       struct drm_device *drm = data;
>       struct mcde *mcde = to_mcde(drm);
>       struct mcde_dsi *d = dev_get_drvdata(dev);
> -     struct drm_panel *panel = NULL;
>       struct drm_bridge *bridge __free(drm_bridge_put) = NULL;
>  
>       if (!of_get_available_child_count(dev->of_node)) {
> @@ -1102,40 +1100,21 @@ static int mcde_dsi_bind(struct device *dev, struct 
> device *master,
>  
>       /* Look for a panel as a child to this node */
>       for_each_available_child_of_node_scoped(dev->of_node, child) {
> -             panel = of_drm_find_panel(child);
> -             if (IS_ERR(panel)) {
> -                     dev_err(dev, "failed to find panel try bridge (%ld)\n",
> -                             PTR_ERR(panel));
> -                     panel = NULL;
> -
> -                     bridge = of_drm_find_and_get_bridge(child);
> -                     if (!bridge) {
> -                             dev_err(dev, "failed to find bridge\n");
> -                             return -EINVAL;
> -                     }
> +             bridge = of_drm_find_and_get_bridge(child);
> +             if (!bridge) {
> +                     dev_err(dev, "failed to find bridge\n");
> +                     return -EINVAL;
>               }
>  
> -             if (panel || bridge)
> -                     break;
> +             break;
>       }
> -     if (panel) {
> -             bridge = drm_panel_bridge_add_typed(panel,
> -                                                 DRM_MODE_CONNECTOR_DSI);
> -             drm_panel_put(panel);
> -             if (IS_ERR(bridge)) {
> -                     dev_err(dev, "error adding panel bridge\n");
> -                     return PTR_ERR(bridge);
> -             }
> -             drm_bridge_get(bridge);
> -             dev_info(dev, "connected to panel\n");
> -             d->panel = panel;
> -     } else if (bridge) {
> +     if (!bridge) {
> +             dev_err(dev, "no bridge\n");
> +             return -ENODEV;
> +     } else if (!drm_bridge_is_panel(bridge)) {
>               /* TODO: AV8100 HDMI encoder goes here for example */
>               dev_info(dev, "connected to non-panel bridge (unsupported)\n");
>               return -ENODEV;

I wonder if we still need that branch. Every panel is a bridge now, and
it looks like we don't have any specific panel handling in this driver,
so I guess it supports bridges already?

Linus, do you know why this condition was here in the first place?

Maxime

Attachment: signature.asc
Description: PGP signature

Reply via email to