[PATCH v3 19/19] drm/bridge: analogix_dp: don't create a panel_bridge
Damon Ding
damon.ding at rock-chips.com
Sun Sep 20 23:34:57 PDT 2026
On 9/21/2026 11:07 AM, Damon Ding wrote:
> Hi Luca,
>
> On 9/16/2026 9:45 PM, 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_get_bridge_by_endpoint().
>>
>> As of_drm_get_bridge_by_endpoint() returns a refcounted bridge, take care
>> of putting the bridge reference. This is not easily done in the remove
>> path
>> due to the different probe paths of the user drivers, so add a devm
>> action
>> to ensure the reference is put only when it was taken.
>>
>> Assisted-by: opencode:deepseek-v4-flash-0731
>> Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
>> ---
>> drivers/gpu/drm/bridge/analogix/Kconfig | 1 -
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 40 ++++++++++++
>> +---------
>> drivers/gpu/drm/exynos/exynos_dp.c | 36 +
>> +-----------------
>> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 9 -----
>> include/drm/bridge/analogix_dp.h | 1 -
>> 5 files changed, 25 insertions(+), 62 deletions(-)
>>
[snip]
>> @@ -488,14 +487,6 @@ static void rockchip_dp_remove(struct
>> platform_device *pdev)
>> {
>> struct rockchip_dp_device *dp = platform_get_drvdata(pdev);
The above unused &rockchip_dp_device could be also remved.
>> - /*
>> - * Release the probe-time reference from of_drm_find_panel(). If
>> bind
>> - * ran, the panel_bridge holds a second reference that devm cleanup
>> - * will release when the bridge is destroyed after remove() returns.
>> - */
>> - if (dp->plat_data.panel)
>> - drm_panel_put(dp->plat_data.panel);
>> -
>> component_del(&pdev->dev, &rockchip_dp_component_ops);
>> }
>> diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/
>> analogix_dp.h
>> index 0e0b87abee59..6033137b651e 100644
>> --- a/include/drm/bridge/analogix_dp.h
>> +++ b/include/drm/bridge/analogix_dp.h
>> @@ -35,7 +35,6 @@ static inline bool analogix_dp_is_rockchip(enum
>> analogix_dp_devtype type)
>> struct analogix_dp_plat_data {
>> enum analogix_dp_devtype dev_type;
>> - struct drm_panel *panel;
>> struct drm_bridge *next_bridge;
>> struct drm_encoder *encoder;
>> struct drm_connector *connector;
>>
>
> I apply this patch series with the related one[0], and the eDP work well
> on my RK3576 board.
>
> Tested-by: Damon Ding <damon.ding at rock-chips.com>
>
> In my patch series for Analogix DP HPD support, Heiko also pointed out
> that devm_drm_of_get_bridge()(deprecated now) can be used to get the
> panel bridge directly, and the redundant &analogix_dp_plat_data.panel
> can be removed[1]. Since your patch series already contains these
> optimizations, I will rebase my patch series on top of yours for
> subsequent updates.
>
> Reviewed-by: Damon Ding <damon.ding at rock-chips.com>
>
> [0] https://lore.kernel.org/all/20260915-drm-bridge-drm_panel-cleanup-
> v4-0-30401d9406f3 at bootlin.com/
> [1] https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
>
Best regards,
Damon
More information about the linux-arm-kernel
mailing list