Re: [PATCH 01/41] drm/display: bridge-connector: attach the encoder to the created connector

From: Dmitry Baryshkov

Date: Tue Apr 21 2026 - 07:21:42 EST


On Tue, Apr 21, 2026 at 01:08:20PM +0200, Luca Ceresoli wrote:
> Hi Dmitry,
>
> On Sat Apr 18, 2026 at 1:18 AM CEST, Dmitry Baryshkov wrote:
> > On Fri, Apr 17, 2026 at 11:57:49AM +0200, Luca Ceresoli wrote:
> >> Currently all users of the bridge-connector must call
> >> drm_connector_attach_encoder() immediately after a successful
> >> drm_bridge_connector_init().
> >>
> >> This is an unnecessary burden for users. Move the call to the end of
> >> drm_bridge_connector_init() so all callers can be simplified.
> >>
> >> Signed-off-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>
> >> ---
> >> drivers/gpu/drm/display/drm_bridge_connector.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> >> index 39cc18f78eda..bba8327fe3f7 100644
> >> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> >> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> >> @@ -1055,6 +1055,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> >> IS_ENABLED(CONFIG_DRM_DISPLAY_HDCP_HELPER))
> >> drm_connector_attach_content_protection_property(connector, true);
> >>
> >> + ret = drm_connector_attach_encoder(connector, encoder);
> >
> > I'd explicitly document that the connector is created and attached.
>
> Sure!
>
> I'd reword a bit the description, as I can't find a way to append the new
> info without making it all become awkward:
>
> /**
> * drm_bridge_connector_init - Initialise a connector for a chain of bridges
> * @drm: the DRM device
> * @encoder: the encoder where the bridge chain starts
> *
> - * Allocate, initialise and register a &drm_bridge_connector with the @drm
> - * device. The connector is associated with a chain of bridges that starts at
> + * Create a new &drm_bridge_connector for the @drm device. The connector is
> + * allocated, initialised, registered with the @drm device and and attached
> + * to @encoder.
> + *
> + * The connector is associated with a chain of bridges that starts at
> * the @encoder. All bridges in the chain shall report bridge operation flags
> * (&drm_bridge->ops) and bridge output type (&drm_bridge->type), and none of
> * them may create a DRM connector directly.
> *
> * Returns a pointer to the new connector on success, or a negative error
> * pointer otherwise.
> */
>
> Does it look fine?

Yes, thanks!

>
> > With that in place:
> >
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
>
> Thanks!
>
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

--
With best wishes
Dmitry