Re: [PATCH RFC v2 01/19] drm: of: move drm_of_find_panel_or_bridge() from drm_of.c to bridge/panel.c
From: Luca Ceresoli
Date: Thu Sep 03 2026 - 09:59:57 EST
Hi,
On Thu Sep 3, 2026 at 11:51 AM CEST, Maxime Ripard wrote:
> Hi,
>
> On Thu, Sep 03, 2026 at 10:11:04AM +0200, Luca Ceresoli wrote:
>> We want to move drm_panel.o from the main drm module to a new drm_panel
>> module, but there is one function in the drm module that calls into
>> drm_panel.c code:
>>
>> drm_of_find_panel_or_bridge() (in drm_of.c, drm module)
>> -> calls of_drm_find_panel (in drm_panel.c, would-be the new drm_panel module)
>>
>> Avoid this issue by moving drm_of_find_panel_or_bridge() to bridge/panel.c
>> (which is currently in the drm_kms_helper module).
>>
>> As a result drm_kms_helper will depend on the new drm_panel module, which
>> is fine because there is no dependency of drm_panel on drm_kms_helper.
>>
>> After this change, all drivers using drm_of_find_panel_or_bridge() will
>> have to select DRM_PANEL_BRIDGE (and DRM_PANEL, recursively). Add that for
>> affected drivers. While there, also add DRM_PANEL on drivers selecting
>> DRM_PANEL_BRIDGE.
>>
>> No functional changes, just moving code around.
>>
>> [AI used to add 'select DRM_PANEL[_BRIDGE]' for affected drivers]
>> Assisted-by: opencode:deepseek-v4-flash-0731
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>
>
> In the previous discussion, I suggested to move it to drm_panel.c
> because it's not really related to the panel_bridge stuff, like, at all.
> And both drm_panel.c and drm_bridge.c are in drm.ko at this point so you
> shouldn't have any issue there.
I had this other implementation done already, and I wanted to have patch 5
out ASAP so I sent as is.
I don't care much about where drm_of_find_panel_or_bridge() is moved and
the discussion about where it's more fitting, because it should just
disappear eventually anyway, hopefully soon.
I will try your idea in v3.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com