[PATCH v3 12/19] drm/mcde: dsi: don't create a panel_bridge
Luca Ceresoli
luca.ceresoli at bootlin.com
Thu Sep 24 00:01:18 PDT 2026
Hi Linus, Maxime,
On Tue Sep 22, 2026 at 9:09 AM CEST, Maxime Ripard wrote:
> 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 <luca.ceresoli at bootlin.com>
[...]
>> @@ -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?
I had the same thought while writing the patch, but I chose to be
conservative.
Linus, unless you have more info I'm going to apply the patch as
is. Removing this special case would be welcome as a later patch.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the Linux-rockchip
mailing list