[v2,23/35] video: stm32: ltdc: stop looking for the panel once found

Message ID 20261107143241.2236511-24-dario.binacchi@amarulasolutions.com
State New
Headers
Series Add Engicam MicroGEA-STM32MP257D-RMM board support |

Commit Message

Dario Binacchi Nov. 7, 2026, 2:32 p.m. UTC
stm32_ltdc_get_panel() looks for the panel on each port of the bridge,
without stopping once found, so the panel is only found if its port is
the last one in the devicetree. This is not always the case, e.g. when
the ports are added by a DT overlay.

Stop at the first port connected to a panel.

Fixes: 35be94614733 ("video: stm32: ltdc: properly search the first available panel")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v2:
- New patch

 drivers/video/stm32/stm32_ltdc.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.43.0
  

Comments

Yannick FERTRE Nov. 27, 2026, 10:30 a.m. UTC | #1
Hi Dario

thanks for the path.

Acked-by: Yannick Fertre <yannick.fertre@foss.st.com>
Tested-by: Yannick Fertre <yannick.fertre@foss.st.com>

Best regards

n 11/7/26 15:32, Dario Binacchi wrote:
> stm32_ltdc_get_panel() looks for the panel on each port of the bridge,
> without stopping once found, so the panel is only found if its port is
> the last one in the devicetree. This is not always the case, e.g. when
> the ports are added by a DT overlay.
>
> Stop at the first port connected to a panel.
>
> Fixes: 35be94614733 ("video: stm32: ltdc: properly search the first available panel")
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>
> Changes in v2:
> - New patch
>
>   drivers/video/stm32/stm32_ltdc.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
> index 7bd6724bc2a7..da580a78a5db 100644
> --- a/drivers/video/stm32/stm32_ltdc.c
> +++ b/drivers/video/stm32/stm32_ltdc.c
> @@ -571,6 +571,8 @@ static int stm32_ltdc_get_panel(struct udevice *dev, struct udevice **panel)
>   			continue;
>   
>   		ret = stm32_ltdc_get_remote_device(dev, ep_node, UCLASS_PANEL, panel);
> +		if (!ret && *panel)
> +			break;
>   	}
>   
>   	/* Sanity check, we can get out of the loop without having a clean ofnode */
  
Patrice CHOTARD Nov. 27, 2026, 1:17 p.m. UTC | #2
On 11/27/26 11:30, Yannick FERTRE wrote:
> Hi Dario
> 
> thanks for the path.
> 
> Acked-by: Yannick Fertre <yannick.fertre@foss.st.com>
> Tested-by: Yannick Fertre <yannick.fertre@foss.st.com>
> 
> Best regards
> 
> n 11/7/26 15:32, Dario Binacchi wrote:
>> stm32_ltdc_get_panel() looks for the panel on each port of the bridge,
>> without stopping once found, so the panel is only found if its port is
>> the last one in the devicetree. This is not always the case, e.g. when
>> the ports are added by a DT overlay.
>>
>> Stop at the first port connected to a panel.
>>
>> Fixes: 35be94614733 ("video: stm32: ltdc: properly search the first available panel")
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>> ---
>>
>> Changes in v2:
>> - New patch
>>
>>   drivers/video/stm32/stm32_ltdc.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
>> index 7bd6724bc2a7..da580a78a5db 100644
>> --- a/drivers/video/stm32/stm32_ltdc.c
>> +++ b/drivers/video/stm32/stm32_ltdc.c
>> @@ -571,6 +571,8 @@ static int stm32_ltdc_get_panel(struct udevice *dev, struct udevice **panel)
>>               continue;
>>             ret = stm32_ltdc_get_remote_device(dev, ep_node, UCLASS_PANEL, panel);
>> +        if (!ret && *panel)
>> +            break;
>>       }
>>         /* Sanity check, we can get out of the loop without having a clean ofnode */
Applied to u-boot-stm32/next

Thanks
Patrice
  
Patrice CHOTARD Nov. 27, 2026, 1:18 p.m. UTC | #3
On 11/27/26 14:17, Patrice CHOTARD wrote:
> 
> 
> On 11/27/26 11:30, Yannick FERTRE wrote:
>> Hi Dario
>>
>> thanks for the path.
>>
>> Acked-by: Yannick Fertre <yannick.fertre@foss.st.com>
>> Tested-by: Yannick Fertre <yannick.fertre@foss.st.com>
>>
>> Best regards
>>
>> n 11/7/26 15:32, Dario Binacchi wrote:
>>> stm32_ltdc_get_panel() looks for the panel on each port of the bridge,
>>> without stopping once found, so the panel is only found if its port is
>>> the last one in the devicetree. This is not always the case, e.g. when
>>> the ports are added by a DT overlay.
>>>
>>> Stop at the first port connected to a panel.
>>>
>>> Fixes: 35be94614733 ("video: stm32: ltdc: properly search the first available panel")
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>> ---
>>>
>>> Changes in v2:
>>> - New patch
>>>
>>>   drivers/video/stm32/stm32_ltdc.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
>>> index 7bd6724bc2a7..da580a78a5db 100644
>>> --- a/drivers/video/stm32/stm32_ltdc.c
>>> +++ b/drivers/video/stm32/stm32_ltdc.c
>>> @@ -571,6 +571,8 @@ static int stm32_ltdc_get_panel(struct udevice *dev, struct udevice **panel)
>>>               continue;
>>>             ret = stm32_ltdc_get_remote_device(dev, ep_node, UCLASS_PANEL, panel);
>>> +        if (!ret && *panel)
>>> +            break;
>>>       }
>>>         /* Sanity check, we can get out of the loop without having a clean ofnode */
> Applied to u-boot-stm32/next

Sorry i made an error, instead :

Applied to u-boot-stm32/main

Thanks
Patrice

> 
> Thanks
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32@st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
  

Patch

diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
index 7bd6724bc2a7..da580a78a5db 100644
--- a/drivers/video/stm32/stm32_ltdc.c
+++ b/drivers/video/stm32/stm32_ltdc.c
@@ -571,6 +571,8 @@  static int stm32_ltdc_get_panel(struct udevice *dev, struct udevice **panel)
 			continue;
 
 		ret = stm32_ltdc_get_remote_device(dev, ep_node, UCLASS_PANEL, panel);
+		if (!ret && *panel)
+			break;
 	}
 
 	/* Sanity check, we can get out of the loop without having a clean ofnode */