* [PATCH v5 0/2] drm/komeda: use the bridge connector
@ 2026-11-30 11:52 Luo Liu
2026-11-30 11:52 ` [PATCH v5 1/2] drm/komeda: Use " Luo Liu
2026-11-30 11:52 ` [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init() Luo Liu
0 siblings, 2 replies; 9+ messages in thread
From: Luo Liu @ 2026-11-30 11:52 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel
Cc: Ayan Halder, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Kory Maincent,
Luca Ceresoli, David Airlie, Simona Vetter, linux-kernel,
cix-kernel-upstream, Wuyi.Shen
Bridges following the new DRM bridge model no longer create a connector
themselves: the display driver has to attach them with
DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the whole
chain with drm_bridge_connector_init().
Convert komeda to that model, so it keeps working with bridges that have
moved to the new one. The bridges komeda binds to in mainline support
connector-less attach, so boards using them are unaffected.
drm_bridge_connector_init() creates the connector with
drmm_connector_init(), which does not allow a ->destroy hook, so the mode
configuration has to be released by DRM as well. The second patch
switches komeda to drmm_mode_config_init() and adapts the private object
cleanup to the new teardown order.
This series was previously posted together with komeda teardown fixes
and a tda998x fix. Those are independent changes, so they are sent as a
separate fixes series.
Changes in v5:
- Split the fixes out of the series, as they are merged through a
different tree. This series only contains the conversion to the bridge
connector model.
- Added the missing cover letter.
Luo Liu (2):
drm/komeda: Use the bridge connector
drm/komeda: Use drmm_mode_config_init()
drivers/gpu/drm/arm/display/Kconfig | 2 ++
.../gpu/drm/arm/display/komeda/komeda_crtc.c | 18 ++++++++--
.../gpu/drm/arm/display/komeda/komeda_kms.c | 36 +++++++++++--------
.../gpu/drm/arm/display/komeda/komeda_kms.h | 2 +-
.../arm/display/komeda/komeda_private_obj.c | 23 +++++++++---
5 files changed, 57 insertions(+), 24 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v5 1/2] drm/komeda: Use the bridge connector
2026-11-30 11:52 [PATCH v5 0/2] drm/komeda: use the bridge connector Luo Liu
@ 2026-11-30 11:52 ` Luo Liu
2026-11-30 17:30 ` Luca Ceresoli
2026-11-30 11:52 ` [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init() Luo Liu
1 sibling, 1 reply; 9+ messages in thread
From: Luo Liu @ 2026-11-30 11:52 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel
Cc: Ayan Halder, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Kory Maincent,
Luca Ceresoli, David Airlie, Simona Vetter, linux-kernel,
cix-kernel-upstream, Wuyi.Shen
Bridges following the new DRM bridge model no longer create a connector
themselves: the display driver has to attach them with
DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the whole
chain with drm_bridge_connector_init().
Convert komeda to that model, so it keeps working with bridges that
have moved to the new one. The bridges komeda binds to in mainline
support connector-less attach, so boards using them are unaffected.
Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
DRM_DISPLAY_HELPER, as the bridge connector is only visible when the
display helper is enabled.
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
---
drivers/gpu/drm/arm/display/Kconfig | 2 ++
.../gpu/drm/arm/display/komeda/komeda_crtc.c | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/Kconfig b/drivers/gpu/drm/arm/display/Kconfig
index 415c10a6374b..d88fdd3808be 100644
--- a/drivers/gpu/drm/arm/display/Kconfig
+++ b/drivers/gpu/drm/arm/display/Kconfig
@@ -6,6 +6,8 @@ config DRM_KOMEDA
select DRM_CLIENT_SELECTION
select DRM_KMS_HELPER
select DRM_GEM_DMA_HELPER
+ select DRM_DISPLAY_HELPER
+ select DRM_BRIDGE_CONNECTOR
select VIDEOMODE_HELPERS
help
Choose this option if you want to compile the ARM Komeda display
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 0fd069fc3386..3d5f06e085fa 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -15,6 +15,7 @@
#include <drm/drm_print.h>
#include <drm/drm_vblank.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_panel.h>
#include "komeda_dev.h"
@@ -617,6 +618,7 @@ static int komeda_attach_bridge(struct device *dev,
struct drm_encoder *encoder)
{
struct drm_device *drm = encoder->dev;
+ struct drm_connector *connector;
struct drm_bridge *bridge;
int err;
@@ -626,12 +628,22 @@ static int komeda_attach_bridge(struct device *dev,
return dev_err_probe(dev, PTR_ERR(bridge), "remote bridge not found for pipe: %s\n",
of_node_full_name(pipe->of_node));
- err = drm_bridge_attach(encoder, bridge, NULL, 0);
- if (err)
+ err = drm_bridge_attach(encoder, bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ if (err) {
drm_err(drm, "bridge_attach() failed for pipe: %s\n",
of_node_full_name(pipe->of_node));
+ return err;
+ }
- return err;
+ connector = drm_bridge_connector_init(drm, encoder);
+ if (IS_ERR(connector)) {
+ drm_err(drm, "bridge connector init failed for pipe: %s\n",
+ of_node_full_name(pipe->of_node));
+ return PTR_ERR(connector);
+ }
+
+ return 0;
}
static const struct drm_encoder_funcs komeda_encoder_funcs = {
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init()
2026-11-30 11:52 [PATCH v5 0/2] drm/komeda: use the bridge connector Luo Liu
2026-11-30 11:52 ` [PATCH v5 1/2] drm/komeda: Use " Luo Liu
@ 2026-11-30 11:52 ` Luo Liu
2026-11-30 17:30 ` Luca Ceresoli
1 sibling, 1 reply; 9+ messages in thread
From: Luo Liu @ 2026-11-30 11:52 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel
Cc: Ayan Halder, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Kory Maincent,
Luca Ceresoli, David Airlie, Simona Vetter, linux-kernel,
cix-kernel-upstream, Wuyi.Shen
drm_bridge_connector_init() creates the connector with
drmm_connector_init(), which has no ->destroy hook. An explicit
drm_mode_config_cleanup() drops the connector's last reference, so
drm_connector_free() calls a NULL ->destroy on the komeda_kms_attach()
error paths and on unbind.
Switch to drmm_mode_config_init() and drop the explicit cleanup calls.
The managed cleanup runs after the connector cleanup actions, so it
finds an empty connector list.
The mode configuration is now released after komeda_kms_detach()
returns, so the encoders' bridges are still private objects in
privobj_list when komeda_kms_cleanup_private_objs() runs and would be
finalized twice. Walk the pipelines instead, so each private object is
finalized once.
Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
---
.../gpu/drm/arm/display/komeda/komeda_kms.c | 36 +++++++++++--------
.../gpu/drm/arm/display/komeda/komeda_kms.h | 2 +-
.../arm/display/komeda/komeda_private_obj.c | 23 +++++++++---
3 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index faa8b041373a..37388d45b31f 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -253,12 +253,15 @@ static const struct drm_mode_config_funcs komeda_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-static void komeda_kms_mode_config_init(struct komeda_kms_dev *kms,
- struct komeda_dev *mdev)
+static int komeda_kms_mode_config_init(struct komeda_kms_dev *kms,
+ struct komeda_dev *mdev)
{
struct drm_mode_config *config = &kms->base.mode_config;
+ int err;
- drm_mode_config_init(&kms->base);
+ err = drmm_mode_config_init(&kms->base);
+ if (err)
+ return err;
komeda_kms_setup_crtcs(kms, mdev);
@@ -270,6 +273,8 @@ static void komeda_kms_mode_config_init(struct komeda_kms_dev *kms,
config->funcs = &komeda_mode_config_funcs;
config->helper_private = &komeda_mode_config_helpers;
+
+ return 0;
}
struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
@@ -287,27 +292,29 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
drm->dev_private = mdev;
- komeda_kms_mode_config_init(kms, mdev);
+ err = komeda_kms_mode_config_init(kms, mdev);
+ if (err)
+ return ERR_PTR(err);
err = komeda_kms_add_private_objs(kms, mdev);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
err = komeda_kms_add_planes(kms, mdev);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
err = drm_vblank_init(drm, kms->n_crtcs);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
err = komeda_kms_add_crtcs(kms, mdev);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
err = komeda_kms_add_wb_connectors(kms, mdev);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
drm_mode_config_reset(drm);
@@ -315,7 +322,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
komeda_kms_irq_handler, IRQF_SHARED,
drm->driver->name, drm);
if (err)
- goto cleanup_mode_config;
+ goto cleanup_private_objs;
drm_kms_helper_poll_init(drm);
@@ -327,9 +334,8 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
free_interrupts:
drm_kms_helper_poll_fini(drm);
-cleanup_mode_config:
- drm_mode_config_cleanup(drm);
- komeda_kms_cleanup_private_objs(kms);
+cleanup_private_objs:
+ komeda_kms_cleanup_private_objs(mdev);
drm->dev_private = NULL;
return ERR_PTR(err);
}
@@ -337,12 +343,12 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
void komeda_kms_detach(struct komeda_kms_dev *kms)
{
struct drm_device *drm = &kms->base;
+ struct komeda_dev *mdev = drm->dev_private;
drm_dev_unregister(drm);
drm_kms_helper_poll_fini(drm);
drm_atomic_helper_shutdown(drm);
- drm_mode_config_cleanup(drm);
- komeda_kms_cleanup_private_objs(kms);
+ komeda_kms_cleanup_private_objs(mdev);
drm->dev_private = NULL;
}
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
index 83e61c4080c2..6f1e6c1773f0 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
@@ -181,7 +181,7 @@ int komeda_kms_add_private_objs(struct komeda_kms_dev *kms,
struct komeda_dev *mdev);
int komeda_kms_add_wb_connectors(struct komeda_kms_dev *kms,
struct komeda_dev *mdev);
-void komeda_kms_cleanup_private_objs(struct komeda_kms_dev *kms);
+void komeda_kms_cleanup_private_objs(struct komeda_dev *mdev);
void komeda_crtc_handle_event(struct komeda_crtc *kcrtc,
struct komeda_events *evts);
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c
index 77b3f361091f..51be98ab570e 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c
@@ -502,11 +502,24 @@ int komeda_kms_add_private_objs(struct komeda_kms_dev *kms,
return 0;
}
-void komeda_kms_cleanup_private_objs(struct komeda_kms_dev *kms)
+void komeda_kms_cleanup_private_objs(struct komeda_dev *mdev)
{
- struct drm_mode_config *config = &kms->base.mode_config;
- struct drm_private_obj *obj, *next;
+ struct komeda_component *c;
+ struct komeda_pipeline *pipe;
+ unsigned long avail_comps;
+ int i, id;
+
+ for (i = 0; i < mdev->n_pipelines; i++) {
+ pipe = mdev->pipelines[i];
- list_for_each_entry_safe(obj, next, &config->privobj_list, head)
- drm_atomic_private_obj_fini(obj);
+ if (pipe->obj.funcs)
+ drm_atomic_private_obj_fini(&pipe->obj);
+
+ avail_comps = pipe->avail_comps;
+ for_each_set_bit(id, &avail_comps, 32) {
+ c = komeda_pipeline_get_component(pipe, id);
+ if (c && c->obj.funcs)
+ drm_atomic_private_obj_fini(&c->obj);
+ }
+ }
}
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v5 1/2] drm/komeda: Use the bridge connector
2026-11-30 11:52 ` [PATCH v5 1/2] drm/komeda: Use " Luo Liu
@ 2026-11-30 17:30 ` Luca Ceresoli
2026-12-01 2:12 ` 回复: " Luo Liu
0 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2026-11-30 17:30 UTC (permalink / raw)
To: Luo Liu
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, Luca Ceresoli, David Airlie,
Simona Vetter, linux-kernel, cix-kernel-upstream, Wuyi.Shen
Hello Luo,
> Bridges following the new DRM bridge model no longer create a connector
> themselves: the display driver has to attach them with
> DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the whole
> chain with drm_bridge_connector_init().
>
> Convert komeda to that model, so it keeps working with bridges that
> have moved to the new one. The bridges komeda binds to in mainline
> support connector-less attach, so boards using them are unaffected.
You say all those bridges support connector-less attach. But I only found
one such bridge bound in mainline dts files, that's the tda998x, and v4
patch 4 (which you are correctly sending separately now) is "tda998x: fix
DRM_BRIDGE_ATTACH_NO_CONNECTOR support". So does this patch depend on the
tda998x fix patch?
> Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
> DRM_DISPLAY_HELPER, as the bridge connector is only visible when the
> display helper is enabled.
>
> Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
...
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> @@ -15,6 +15,7 @@
> #include <drm/drm_print.h>
> #include <drm/drm_vblank.h>
> #include <drm/drm_bridge.h>
> +#include <drm/drm_bridge_connector.h>
> #include <drm/drm_panel.h>
>
> #include "komeda_dev.h"
> @@ -617,6 +618,7 @@ static int komeda_attach_bridge(struct device *dev,
> struct drm_encoder *encoder)
> {
> struct drm_device *drm = encoder->dev;
> + struct drm_connector *connector;
> struct drm_bridge *bridge;
> int err;
>
> @@ -626,12 +628,22 @@ static int komeda_attach_bridge(struct device *dev,
> return dev_err_probe(dev, PTR_ERR(bridge), "remote bridge not found for pipe: %s\n",
> of_node_full_name(pipe->of_node));
>
> - err = drm_bridge_attach(encoder, bridge, NULL, 0);
> - if (err)
> + err = drm_bridge_attach(encoder, bridge, NULL,
> + DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> + if (err) {
> drm_err(drm, "bridge_attach() failed for pipe: %s\n",
> of_node_full_name(pipe->of_node));
> + return err;
> + }
Please add a patch to switch to dev_err_probe() before this one, in the
same series. As I see this function is only called by the probe function,
through a fairly long call chain.
> + connector = drm_bridge_connector_init(drm, encoder);
> + if (IS_ERR(connector)) {
> + drm_err(drm, "bridge connector init failed for pipe: %s\n",
> + of_node_full_name(pipe->of_node));
> + return PTR_ERR(connector);
> + }
Here too, use dev_err_probe().
Otherwise looks good.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init()
2026-11-30 11:52 ` [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init() Luo Liu
@ 2026-11-30 17:30 ` Luca Ceresoli
2026-12-01 2:29 ` 回复: " Luo Liu
0 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2026-11-30 17:30 UTC (permalink / raw)
To: Luo Liu
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, Luca Ceresoli, David Airlie,
Simona Vetter, linux-kernel, cix-kernel-upstream, Wuyi.Shen
> drm_bridge_connector_init() creates the connector with
> drmm_connector_init(), which does not allow a ->destroy hook and registers
> its own cleanup action instead. Calling drm_mode_config_cleanup()
> explicitly drops the connector's last reference, so drm_connector_free()
> ends up calling a NULL ->destroy pointer. That happens on the
> komeda_kms_attach() error paths, and on unbind as soon as no other
> component holds a connector reference.
>
> Let DRM release the mode configuration: switch to drmm_mode_config_init()
> and drop the explicit drm_mode_config_cleanup() calls. The managed cleanup
> is registered before the connectors are created, so it runs after the
> connector cleanup actions and finds an empty connector list.
>
> The mode configuration teardown now happens after komeda_kms_detach() has
> returned, so komeda can no longer rely on drm_mode_config_cleanup()
> detaching the encoders' bridges before komeda_kms_cleanup_private_objs()
> walks mode_config.privobj_list - the bridges are private objects there as
> well, and finalizing them a second time when the encoders are cleaned up
> would corrupt the list and free their state twice. Since the komeda
> private objects belong to the pipeline components, finalize them by
> walking the pipelines instead of the shared list.
>
> Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
Based on your description, it looks like patch 1 breaks something and this
patch fixes it. Shouldn't the two patches be swapped, with this one first
as a preparation step before switching to the bridge connector?
Also, this patch does not apply due to a trivial conflict. Please ensure
you rebase on top of drm-misc/drm-misc-next before sending feature patches.
Otherwise looks OK.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* 回复: [PATCH v5 1/2] drm/komeda: Use the bridge connector
2026-11-30 17:30 ` Luca Ceresoli
@ 2026-12-01 2:12 ` Luo Liu
2026-12-01 8:29 ` Luca Ceresoli
0 siblings, 1 reply; 9+ messages in thread
From: Luo Liu @ 2026-12-01 2:12 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, David Airlie, Simona Vetter,
linux-kernel, cix-kernel-upstream,
Wuyi Shen (沈武义)
Hello Luca,
Thank you very much for your review and suggestions.
> -----邮件原件-----
> 发件人: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 发送时间: 2026年12月1日 1:30
> 收件人: Luo Liu <Luo.Liu@cixtech.com>
> 抄送: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime
> Ripard <mripard@kernel.org>; Thomas Zimmermann
> <tzimmermann@suse.de>; Liviu Dudau <liviu.dudau@arm.com>; Russell King
> <linux@armlinux.org.uk>; dri-devel@lists.freedesktop.org; Ayan Halder
> <Ayan.Halder@arm.com>; Andrzej Hajda <andrzej.hajda@intel.com>; Neil
> Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>;
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>; Jonas Karlman
> <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Kory
> Maincent <kory.maincent@bootlin.com>; Luca Ceresoli
> <luca.ceresoli@bootlin.com>; David Airlie <airlied@gmail.com>; Simona Vetter
> <simona@ffwll.ch>; linux-kernel@vger.kernel.org; cix-kernel-upstream
> <cix-kernel-upstream@cixtech.com>; Wuyi Shen (沈武义)
> <Wuyi.Shen@cixtech.com>
> 主题: Re: [PATCH v5 1/2] drm/komeda: Use the bridge connector
>
> [Some people who received this message don't often get email from
> luca.ceresoli@bootlin.com. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
>
> EXTERNAL EMAIL
>
> Hello Luo,
>
> > Bridges following the new DRM bridge model no longer create a
> > connector
> > themselves: the display driver has to attach them with
> > DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the
> whole
> > chain with drm_bridge_connector_init().
> >
> > Convert komeda to that model, so it keeps working with bridges that
> > have moved to the new one. The bridges komeda binds to in mainline
> > support connector-less attach, so boards using them are unaffected.
>
> You say all those bridges support connector-less attach. But I only found one such
> bridge bound in mainline dts files, that's the tda998x, and v4 patch 4 (which you
> are correctly sending separately now) is "tda998x: fix
> DRM_BRIDGE_ATTACH_NO_CONNECTOR support". So does this patch depend
> on the tda998x fix patch?
>
komeda is the DPU, the upstream end of the display chain; our DP
controller, which is being upstreamed on the new DRM bridge model, and
the tda998x HDMI transmitter are both downstream of it. komeda therefore
has to be converted first, and that is what this series does.
You are right that the Morello SDP board also needs the tda998x fix.
That fix is independent of this conversion; I will post it as a separate tda998x patch.
> > Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
> > DRM_DISPLAY_HELPER, as the bridge connector is only visible when the
> > display helper is enabled.
> >
> > Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
>
> ...
>
> > --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> > @@ -15,6 +15,7 @@
> > #include <drm/drm_print.h>
> > #include <drm/drm_vblank.h>
> > #include <drm/drm_bridge.h>
> > +#include <drm/drm_bridge_connector.h>
> > #include <drm/drm_panel.h>
> >
> > #include "komeda_dev.h"
> > @@ -617,6 +618,7 @@ static int komeda_attach_bridge(struct device *dev,
> > struct drm_encoder *encoder) {
> > struct drm_device *drm = encoder->dev;
> > + struct drm_connector *connector;
> > struct drm_bridge *bridge;
> > int err;
> >
> > @@ -626,12 +628,22 @@ static int komeda_attach_bridge(struct device *dev,
> > return dev_err_probe(dev, PTR_ERR(bridge), "remote
> bridge not found for pipe: %s\n",
> >
> of_node_full_name(pipe->of_node));
> >
> > - err = drm_bridge_attach(encoder, bridge, NULL, 0);
> > - if (err)
> > + err = drm_bridge_attach(encoder, bridge, NULL,
> > +
> DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> > + if (err) {
> > drm_err(drm, "bridge_attach() failed for pipe: %s\n",
> > of_node_full_name(pipe->of_node));
> > + return err;
> > + }
>
> Please add a patch to switch to dev_err_probe() before this one, in the same
> series. As I see this function is only called by the probe function, through a fairly
> long call chain.
>
> > + connector = drm_bridge_connector_init(drm, encoder);
> > + if (IS_ERR(connector)) {
> > + drm_err(drm, "bridge connector init failed for pipe: %s\n",
> > + of_node_full_name(pipe->of_node));
> > + return PTR_ERR(connector);
> > + }
>
> Here too, use dev_err_probe().
>
> Otherwise looks good.
Thanks a lot for the review. That is a very good suggestion.
Since this series is about the conversion to the new DRM bridge model,
and to keep the conversion patch aligned with the versions already
reviewed, would it be better to add the dev_err_probe() conversion as a
separate patch at the end of the series instead of before it? I will of
course use dev_err_probe() in the new error paths this series adds.
Best regards,
Luo
>
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* 回复: [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init()
2026-11-30 17:30 ` Luca Ceresoli
@ 2026-12-01 2:29 ` Luo Liu
0 siblings, 0 replies; 9+ messages in thread
From: Luo Liu @ 2026-12-01 2:29 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, David Airlie, Simona Vetter,
linux-kernel, cix-kernel-upstream,
Wuyi Shen (沈武义)
Hello Luca,
Thank you very much for your review and suggestions.
> -----邮件原件-----
> 发件人: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 发送时间: 2026年12月1日 1:30
> 收件人: Luo Liu <Luo.Liu@cixtech.com>
> 抄送: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime
> Ripard <mripard@kernel.org>; Thomas Zimmermann
> <tzimmermann@suse.de>; Liviu Dudau <liviu.dudau@arm.com>; Russell King
> <linux@armlinux.org.uk>; dri-devel@lists.freedesktop.org; Ayan Halder
> <Ayan.Halder@arm.com>; Andrzej Hajda <andrzej.hajda@intel.com>; Neil
> Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>;
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>; Jonas Karlman
> <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Kory
> Maincent <kory.maincent@bootlin.com>; Luca Ceresoli
> <luca.ceresoli@bootlin.com>; David Airlie <airlied@gmail.com>; Simona Vetter
> <simona@ffwll.ch>; linux-kernel@vger.kernel.org; cix-kernel-upstream
> <cix-kernel-upstream@cixtech.com>; Wuyi Shen (沈武义)
> <Wuyi.Shen@cixtech.com>
> 主题: Re: [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init()
>
> [Some people who received this message don't often get email from
> luca.ceresoli@bootlin.com. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
>
> EXTERNAL EMAIL
>
> > drm_bridge_connector_init() creates the connector with
> > drmm_connector_init(), which does not allow a ->destroy hook and
> > registers its own cleanup action instead. Calling
> > drm_mode_config_cleanup() explicitly drops the connector's last
> > reference, so drm_connector_free() ends up calling a NULL ->destroy
> > pointer. That happens on the
> > komeda_kms_attach() error paths, and on unbind as soon as no other
> > component holds a connector reference.
> >
> > Let DRM release the mode configuration: switch to
> > drmm_mode_config_init() and drop the explicit
> > drm_mode_config_cleanup() calls. The managed cleanup is registered
> > before the connectors are created, so it runs after the connector cleanup
> actions and finds an empty connector list.
> >
> > The mode configuration teardown now happens after komeda_kms_detach()
> > has returned, so komeda can no longer rely on
> > drm_mode_config_cleanup() detaching the encoders' bridges before
> > komeda_kms_cleanup_private_objs() walks mode_config.privobj_list - the
> > bridges are private objects there as well, and finalizing them a
> > second time when the encoders are cleaned up would corrupt the list
> > and free their state twice. Since the komeda private objects belong to
> > the pipeline components, finalize them by walking the pipelines instead of the
> shared list.
> >
> > Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
>
> Based on your description, it looks like patch 1 breaks something and this patch
> fixes it. Shouldn't the two patches be swapped, with this one first as a
> preparation step before switching to the bridge connector?
>
> Also, this patch does not apply due to a trivial conflict. Please ensure you rebase
> on top of drm-misc/drm-misc-next before sending feature patches.
>
> Otherwise looks OK.
Sorry for the conflict, I will rebase on drm-misc/drm-misc-next, and I will also swap the first two patches as
you suggested. Patch 2 will be reworded as a preparation for the connector switch, so it no longer reads as a
fix for a problem it introduces.
Best regards,
Luo
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 回复: [PATCH v5 1/2] drm/komeda: Use the bridge connector
2026-12-01 2:12 ` 回复: " Luo Liu
@ 2026-12-01 8:29 ` Luca Ceresoli
2026-12-01 8:41 ` 回复: " Luo Liu
0 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2026-12-01 8:29 UTC (permalink / raw)
To: Luo Liu, Luca Ceresoli
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, David Airlie, Simona Vetter,
linux-kernel, cix-kernel-upstream,
Wuyi Shen (沈武义)
Hello Luo,
On Tue Dec 1, 2026 at 3:12 AM CET, Luo Liu wrote:
>> > Bridges following the new DRM bridge model no longer create a
>> > connector
>> > themselves: the display driver has to attach them with
>> > DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the
>> whole
>> > chain with drm_bridge_connector_init().
>> >
>> > Convert komeda to that model, so it keeps working with bridges that
>> > have moved to the new one. The bridges komeda binds to in mainline
>> > support connector-less attach, so boards using them are unaffected.
>>
>> You say all those bridges support connector-less attach. But I only found one such
>> bridge bound in mainline dts files, that's the tda998x, and v4 patch 4 (which you
>> are correctly sending separately now) is "tda998x: fix
>> DRM_BRIDGE_ATTACH_NO_CONNECTOR support". So does this patch depend
>> on the tda998x fix patch?
>>
>
> komeda is the DPU, the upstream end of the display chain; our DP
> controller, which is being upstreamed on the new DRM bridge model, and
> the tda998x HDMI transmitter are both downstream of it. komeda therefore
> has to be converted first, and that is what this series does.
>
> You are right that the Morello SDP board also needs the tda998x fix.
> That fix is independent of this conversion; I will post it as a separate tda998x patch.
Not sure I'm convinced, but as you are sending the fix separately it should
land earlier (through drm-misc-fixes), so no problem.
>> > Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
>> > DRM_DISPLAY_HELPER, as the bridge connector is only visible when the
>> > display helper is enabled.
>> >
>> > Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
>>
>> ...
>> > + if (err) {
>> > drm_err(drm, "bridge_attach() failed for pipe: %s\n",
>> > of_node_full_name(pipe->of_node));
>> > + return err;
>> > + }
>>
>> Please add a patch to switch to dev_err_probe() before this one, in the same
>> series. As I see this function is only called by the probe function, through a fairly
>> long call chain.
>>
>> > + connector = drm_bridge_connector_init(drm, encoder);
>> > + if (IS_ERR(connector)) {
>> > + drm_err(drm, "bridge connector init failed for pipe: %s\n",
>> > + of_node_full_name(pipe->of_node));
>> > + return PTR_ERR(connector);
>> > + }
>>
>> Here too, use dev_err_probe().
>>
>> Otherwise looks good.
>
>
> Thanks a lot for the review. That is a very good suggestion.
>
> Since this series is about the conversion to the new DRM bridge model,
> and to keep the conversion patch aligned with the versions already
> reviewed, would it be better to add the dev_err_probe() conversion as a
> separate patch at the end of the series instead of before it? I will of
> course use dev_err_probe() in the new error paths this series adds.
What you propose would possibly make sense for a very complex patch, where
the improvements you're asked to do would change it significantly and so
require a lot of time to reviewe again.
But this is a simple patch, it won't take long to review, especially if you
send it in a few days so reviewers still have it in mind.
So, please, let's not add code that is known to not follow the best
guidelines with the committment to fix it later. Just send a new iteration
with an initial patch to switch the existing drm_err to dev_err_probe, and
then edit this patch to use dev_err_prove in the first place. I'll be glad
to add my R-by to such a series.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* 回复: 回复: [PATCH v5 1/2] drm/komeda: Use the bridge connector
2026-12-01 8:29 ` Luca Ceresoli
@ 2026-12-01 8:41 ` Luo Liu
0 siblings, 0 replies; 9+ messages in thread
From: Luo Liu @ 2026-12-01 8:41 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Liviu Dudau,
Russell King, dri-devel, Ayan Halder, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Kory Maincent, David Airlie, Simona Vetter,
linux-kernel, cix-kernel-upstream,
Wuyi Shen (沈武义)
Hello Luca,
Thank you very much for your review and suggestions.
> -----邮件原件-----
> 发件人: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 发送时间: 2026年12月1日 16:29
> 收件人: Luo Liu <Luo.Liu@cixtech.com>; Luca Ceresoli
> <luca.ceresoli@bootlin.com>
> 抄送: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime
> Ripard <mripard@kernel.org>; Thomas Zimmermann
> <tzimmermann@suse.de>; Liviu Dudau <liviu.dudau@arm.com>; Russell King
> <linux@armlinux.org.uk>; dri-devel@lists.freedesktop.org; Ayan Halder
> <Ayan.Halder@arm.com>; Andrzej Hajda <andrzej.hajda@intel.com>; Neil
> Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>;
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>; Jonas Karlman
> <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Kory
> Maincent <kory.maincent@bootlin.com>; David Airlie <airlied@gmail.com>;
> Simona Vetter <simona@ffwll.ch>; linux-kernel@vger.kernel.org;
> cix-kernel-upstream <cix-kernel-upstream@cixtech.com>; Wuyi Shen (沈武义)
> <wuyi.shen@cixtech.com>
> 主题: Re: 回复: [PATCH v5 1/2] drm/komeda: Use the bridge connector
>
> EXTERNAL EMAIL
>
> Hello Luo,
>
> On Tue Dec 1, 2026 at 3:12 AM CET, Luo Liu wrote:
>
> >> > Bridges following the new DRM bridge model no longer create a
> >> > connector
> >> > themselves: the display driver has to attach them with
> >> > DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for
> the
> >> whole
> >> > chain with drm_bridge_connector_init().
> >> >
> >> > Convert komeda to that model, so it keeps working with bridges that
> >> > have moved to the new one. The bridges komeda binds to in mainline
> >> > support connector-less attach, so boards using them are unaffected.
> >>
> >> You say all those bridges support connector-less attach. But I only
> >> found one such bridge bound in mainline dts files, that's the
> >> tda998x, and v4 patch 4 (which you are correctly sending separately
> >> now) is "tda998x: fix DRM_BRIDGE_ATTACH_NO_CONNECTOR support". So
> >> does this patch depend on the tda998x fix patch?
> >>
> >
> > komeda is the DPU, the upstream end of the display chain; our DP
> > controller, which is being upstreamed on the new DRM bridge model, and
> > the tda998x HDMI transmitter are both downstream of it. komeda
> > therefore has to be converted first, and that is what this series does.
> >
> > You are right that the Morello SDP board also needs the tda998x fix.
> > That fix is independent of this conversion; I will post it as a separate tda998x
> patch.
>
> Not sure I'm convinced, but as you are sending the fix separately it should land
> earlier (through drm-misc-fixes), so no problem.
>
> >> > Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
> >> > DRM_DISPLAY_HELPER, as the bridge connector is only visible when
> >> > the display helper is enabled.
> >> >
> >> > Signed-off-by: Luo Liu <Luo.Liu@cixtech.com>
> >>
> >> ...
>
> >> > + if (err) {
> >> > drm_err(drm, "bridge_attach() failed for pipe: %s\n",
> >> > of_node_full_name(pipe->of_node));
> >> > + return err;
> >> > + }
> >>
> >> Please add a patch to switch to dev_err_probe() before this one, in
> >> the same series. As I see this function is only called by the probe
> >> function, through a fairly long call chain.
> >>
> >> > + connector = drm_bridge_connector_init(drm, encoder);
> >> > + if (IS_ERR(connector)) {
> >> > + drm_err(drm, "bridge connector init failed for
> pipe: %s\n",
> >> > + of_node_full_name(pipe->of_node));
> >> > + return PTR_ERR(connector);
> >> > + }
> >>
> >> Here too, use dev_err_probe().
> >>
> >> Otherwise looks good.
> >
> >
> > Thanks a lot for the review. That is a very good suggestion.
> >
> > Since this series is about the conversion to the new DRM bridge model,
> > and to keep the conversion patch aligned with the versions already
> > reviewed, would it be better to add the dev_err_probe() conversion as
> > a separate patch at the end of the series instead of before it? I will
> > of course use dev_err_probe() in the new error paths this series adds.
>
> What you propose would possibly make sense for a very complex patch, where
> the improvements you're asked to do would change it significantly and so
> require a lot of time to reviewe again.
>
> But this is a simple patch, it won't take long to review, especially if you send it in
> a few days so reviewers still have it in mind.
>
> So, please, let's not add code that is known to not follow the best guidelines with
> the committment to fix it later. Just send a new iteration with an initial patch to
> switch the existing drm_err to dev_err_probe, and then edit this patch to use
> dev_err_prove in the first place. I'll be glad to add my R-by to such a series.
>
Thanks, that makes sense. I'll rework the series so that the first patch
converts the existing error messages to dev_err_probe(), and this patch
uses dev_err_probe() from the start in the new error paths.
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-12-01 8:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 11:52 [PATCH v5 0/2] drm/komeda: use the bridge connector Luo Liu
2026-11-30 11:52 ` [PATCH v5 1/2] drm/komeda: Use " Luo Liu
2026-11-30 17:30 ` Luca Ceresoli
2026-12-01 2:12 ` 回复: " Luo Liu
2026-12-01 8:29 ` Luca Ceresoli
2026-12-01 8:41 ` 回复: " Luo Liu
2026-11-30 11:52 ` [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init() Luo Liu
2026-11-30 17:30 ` Luca Ceresoli
2026-12-01 2:29 ` 回复: " Luo Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®