* Claude review: drm/bridge: analogix_dp: Apply panel_bridge helper
2026-02-10 9:10 ` [PATCH v9 15/15] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2026-02-11 6:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-02-11 6:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Summary:** Wraps panels as bridges using devm_drm_panel_bridge_add().
```c
+ if (dp->plat_data->panel) {
+ dp->plat_data->next_bridge = devm_drm_panel_bridge_add(dp->dev,
+ dp->plat_data->panel);
+ if (IS_ERR(dp->plat_data->next_bridge)) {
+ ret = PTR_ERR(bridge);
+ goto err_unregister_aux;
+ }
+ }
```
**CRITICAL BUG:**
```c
ret = PTR_ERR(bridge);
```
Should be:
```c
ret = PTR_ERR(dp->plat_data->next_bridge);
```
This returns the wrong error value!
**Other changes reviewed:**
- Removes explicit panel prepare/enable/disable calls (now handled by panel_bridge)
- Removes `analogix_dp_bridge_get_modes()` (panel_bridge provides this)
- Changes bridge->ops from conditional to always `DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT`
**Verdict:** **NEEDS REVISION** - Fix the PTR_ERR bug.
---
## SUMMARY OF ISSUES
**Critical:**
1. PATCH 15: Wrong variable in PTR_ERR() - returns error value of wrong pointer
2. PATCH 7: Modifying display_info in atomic_check violates atomic principles
**Minor:**
1. PATCH 1: Typo in commit message ("attachmenet")
2. PATCH 2: Verify author attribution change is intentional
**Recommendations:**
- Fix the critical bug in PATCH 15
- Reconsider the approach in PATCH 7 for color format handling
- Otherwise, this is a well-structured refactoring series
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Apply panel_bridge helper
2026-03-19 7:47 ` [PATCH v11 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2026-03-21 18:35 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 18:35 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Converts the panel to a panel_bridge, eliminating all direct `drm_panel_*` calls from the analogix_dp core. This is the final cleanup.
**BUG**: In the error path for `devm_drm_panel_bridge_add()`:
```c
dp->plat_data->next_bridge = devm_drm_panel_bridge_add(dp->dev,
dp->plat_data->panel);
if (IS_ERR(dp->plat_data->next_bridge)) {
ret = PTR_ERR(bridge); // <-- BUG: should be PTR_ERR(dp->plat_data->next_bridge)
goto err_unregister_aux;
}
```
`bridge` is `&dp->bridge` which is a valid pointer at this point, so `PTR_ERR(bridge)` will return a garbage/wrong error code. This should be `PTR_ERR(dp->plat_data->next_bridge)`.
**Note on mbox ordering**: Patches 14-17 were sent as a separate sub-thread (different Message-Id base `20260319074744.1965918`), likely a resend to fix something. The logical ordering in the cover letter is respected but the mbox has some patches arriving out of numerical order (e.g., 10 before 08, 13 before 09). This is cosmetic but may confuse tooling.
---
**Summary**: The series is well-structured and mostly correct. The one real bug is the `PTR_ERR(bridge)` vs `PTR_ERR(dp->plat_data->next_bridge)` in patch 17 which must be fixed before merging.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
@ 2026-04-09 6:52 Damon Ding
2026-04-09 6:52 ` [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
` (14 more replies)
0 siblings, 15 replies; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
PATCH 1 is to add a new parameter to store the point of next bridge.
PATCH 2 is to make legacy bridge driver more universal.
PATCH 3-10 are preparations for apply drm_bridge_connector helper.
PATCH 11 is to apply the drm_bridge_connector helper.
PATCH 12-14 are to move the panel/bridge parsing to the Analogix side.
PATCH 15 is to attach the next bridge on Analogix side uniformly.
PATCH 16-17 are to apply the panel_bridge helper.
Damon Ding (17):
drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge
drm/bridge: Move legacy bridge driver out of imx directory for
multi-platform use
drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector
drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the
display-timings node
drm/bridge: analogix_dp: Remove redundant
&analogix_dp_plat_data.skip_connector
drm/bridge: analogix_dp: Move the color format check to
.atomic_check() for Rockchip platforms
drm/bridge: analogix_dp: Remove unused
&analogix_dp_plat_data.get_modes()
drm/bridge: analogix_dp: Remove unused struct drm_connector* for
&analogix_dp_plat_data.attach()
drm/bridge: analogix_dp: Pass struct drm_atomic_state* for
analogix_dp_bridge_mode_set()
drm/bridge: analogix_dp: Apply drm_bridge_connector helper
drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe()
drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe()
drm/exynos: exynos_dp: Apply analogix_dp_finish_probe()
drm/bridge: analogix_dp: Attach the next bridge in
analogix_dp_bridge_attach()
drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing
in analogix_dp_unbind()
drm/bridge: analogix_dp: Apply panel_bridge helper
drivers/gpu/drm/bridge/Kconfig | 10 +
drivers/gpu/drm/bridge/Makefile | 1 +
drivers/gpu/drm/bridge/analogix/Kconfig | 1 +
.../drm/bridge/analogix/analogix_dp_core.c | 236 +++++++++---------
.../drm/bridge/analogix/analogix_dp_core.h | 1 -
drivers/gpu/drm/bridge/imx/Kconfig | 10 -
drivers/gpu/drm/bridge/imx/Makefile | 1 -
.../gpu/drm/bridge/imx/imx-legacy-bridge.c | 91 -------
.../gpu/drm/bridge/of-display-mode-bridge.c | 93 +++++++
drivers/gpu/drm/exynos/Kconfig | 2 +
drivers/gpu/drm/exynos/exynos_dp.c | 110 ++------
drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 5 +-
drivers/gpu/drm/rockchip/Kconfig | 1 +
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 67 +----
include/drm/bridge/analogix_dp.h | 8 +-
include/drm/bridge/imx.h | 17 --
include/drm/bridge/of-display-mode-bridge.h | 17 ++
19 files changed, 295 insertions(+), 386 deletions(-)
delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
create mode 100644 drivers/gpu/drm/bridge/of-display-mode-bridge.c
delete mode 100644 include/drm/bridge/imx.h
create mode 100644 include/drm/bridge/of-display-mode-bridge.h
---
Changes in v2:
- Update Exynos DP driver synchronously.
- Move the panel/bridge parsing to the Analogix side.
Changes in v3:
- Rebase for the existing devm_drm_bridge_alloc() applying commit.
- Fix the typographical error of panel/bridge check in exynos_dp_bind().
- Squash all commits related to skip_connector deletion in both Exynos and
Analogix code into one.
- Apply panel_bridge helper to make the codes more concise.
- Fix the handing of bridge in analogix_dp_bridge_get_modes().
- Remove unnecessary parameter struct drm_connector* for callback
&analogix_dp_plat_data.attach().
- In order to decouple the connector driver and the bridge driver, move
the bridge connector initilization to the Rockchip and Exynos sides.
Changes in v4:
- Rebase for the applied &drm_bridge_funcs.detect() modification commit.
- Rename analogix_dp_find_panel_or_bridge() to analogix_dp_finish_probe().
- Drop the drmm_encoder_init() modification commit.
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
Changes in v5:
- Add legacy bridge to parse the display-timings node under the dp node
for Exynos side.
- Move color format check to &drm_connector_helper_funcs.atomic_check()
in order to get rid of &analogix_dp_plat_data.get_modes().
- Remove unused callback &analogix_dp_plat_data.get_modes().
- Distinguish the &drm_bridge->ops of Analogix bridge based on whether
the downstream device is a panel, a bridge or neither.
- Select DRM_DISPLAY_DP_AUX_BUS for DRM_ANALOGIX_DP, and remove it for
ROCKCHIP_ANALOGIX_DP.
- Apply rockchip_dp_attach() to support the next bridge attachment for
the Rockchip side.
- Move next_bridge attachment from Analogix side to Rockchip/Exynos sides.
Changes in v6:
- Move legacy bridge driver out of imx directory for multi-platform use.
- Apply DRM legacy bridge to parse display timings intead of implementing
the same codes only for Exynos DP.
- Ensure last bridge determines EDID/modes detection capabilities in DRM
bridge_connector driver.
- Remove unnecessary drm_bridge_get_modes() in
analogix_dp_bridge_get_modes().
- Simplify analogix_dp_bridge_edid_read().
- If the next is a bridge, set DRM_BRIDGE_OP_DETECT and return
connector_status_connected in analogix_dp_bridge_detect().
- Set flag DRM_BRIDGE_ATTACH_NO_CONNECTOR for bridge attachment while
binding. Meanwhile, make DRM_BRIDGE_ATTACH_NO_CONNECTOR unsuppported
in analogix_dp_bridge_attach().
- Move the next bridge attachment to the Analogix side rather than
scattered on Rockchip and Exynos sides.
- Remove the unnecessary analogix_dp_bridge_get_modes().
- Squash [PATCH v5 15/17] into [PATCH v5 17/17].
- Fix the &drm_bridge->ops to DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT.
Changes in v7:
- As Luca suggested, simplify the code and related comment for bridge_connector
modifications. Additionally, move the commit related to bridge_connector to
the top of this patch series.
- Rename legacy-bridge driver to of-display-mode-bridge driver.
- Remove unnecessary API drm_bridge_is_legacy() and apply a temporary flag
&exynos_dp_device.has_of_bridge instead, which will be removed finally.
- Remove exynos_dp_legacy_bridge_init() and inline API
devm_drm_of_display_mode_bridge().
Changes in v8:
- Adapt the related modifications to the newest bridge_connector driver.
Changes in v9:
- Fix the Kconfig help text for CONFIG_DRM_OF_DISPLAY_MODE_BRIDGE.
- Add Tested-by tag from Heiko.
Changes in v10:
- Fix to use dev_err_probe() in newly added API analogix_dp_finish_probe().
- Expaned commit message for [PATCH v9 9/15] and [PATCH v9 10/15].
- Split [PATCH v9 9/15] into serval smaller commits.
- Add Reviewed-by tags from Luca.
Changes in v11:
- Merge [PATCH v10 12/18] into [PATCH v10 11/18].
- Fix the bridge flag to 'flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR' in
[PATCH v10 11/18].
- Add Reviewed-by tags from Luca.
Changes in v12:
- Restore accidentally removed DRM_BRIDGE_CONNECTOR Kconfig in v10.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag as discussed in
https://lore.kernel.org/all/571cc85a-3310-4b56-a3ef-3aab698192f6@rock-chips.com/
- Rebase [PATCH v12 2/17] after commit 02df94d98ff8 ("drm/imx: parallel-display:
add DRM_DISPLAY_HELPER for DRM_IMX_PARALLEL_DISPLAY")
- Rebase [PATCH v12 7/17] and [PATCH v12 11/17] after commit 01962a191242
("drm/rockchip: analogix: Convert to drm_output_color_format")
--
2.34.1
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
` (13 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
In order to move the panel/bridge parsing and attachmenet to the
Analogix side, add component struct drm_bridge *next_bridge to
platform data struct analogix_dp_plat_data.
The movement makes sense because the panel/bridge should logically
be positioned behind the Analogix bridge in the display pipeline.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge
Changes in v9:
- Add Reviewed-by and Tested-by tags.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
include/drm/bridge/analogix_dp.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index cf17646c1310..582357c20640 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -27,6 +27,7 @@ static inline bool 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;
bool skip_connector;
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2026-04-09 6:52 ` [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
` (12 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
As suggested by Dmitry, the DRM legacy bridge driver can be pulled
out of imx/ subdir for multi-platform use. The driver is also renamed
to make it more generic and suitable for platforms other than i.MX.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v7:
- Rename legacy-bridge to of-display-mode-bridge.
- Remove unnecessary API drm_bridge_is_legacy().
Changes in v9:
- Fix the Kconfig help text.
- Add Tested-by tag.
Changes in v10:
- Add Reviewed-by tag.
Changes in v13:
- Rebase after commit 02df94d98ff8 ("drm/imx: parallel-display: add
DRM_DISPLAY_HELPER for DRM_IMX_PARALLEL_DISPLAY")
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/bridge/Kconfig | 10 ++
drivers/gpu/drm/bridge/Makefile | 1 +
drivers/gpu/drm/bridge/imx/Kconfig | 10 --
drivers/gpu/drm/bridge/imx/Makefile | 1 -
.../gpu/drm/bridge/imx/imx-legacy-bridge.c | 91 ------------------
.../gpu/drm/bridge/of-display-mode-bridge.c | 93 +++++++++++++++++++
drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 5 +-
include/drm/bridge/imx.h | 17 ----
include/drm/bridge/of-display-mode-bridge.h | 17 ++++
11 files changed, 129 insertions(+), 126 deletions(-)
delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
create mode 100644 drivers/gpu/drm/bridge/of-display-mode-bridge.c
delete mode 100644 include/drm/bridge/imx.h
create mode 100644 include/drm/bridge/of-display-mode-bridge.h
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index c3209b0f4678..f81b566c82a1 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -262,6 +262,16 @@ config DRM_NXP_PTN3460
help
NXP PTN3460 eDP-LVDS bridge chip driver.
+config DRM_OF_DISPLAY_MODE_BRIDGE
+ tristate
+ depends on DRM_BRIDGE && OF
+ help
+ This is a DRM bridge implementation that uses of_get_drm_display_mode
+ to acquire display mode.
+
+ It exists for compatibility with legacy display mode parsing, in order
+ to conform to the panel-bridge framework.
+
config DRM_PARADE_PS8622
tristate "Parade eDP/LVDS bridge"
depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index beab5b695a6e..15cc821d85b7 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
+obj-$(CONFIG_DRM_OF_DISPLAY_MODE_BRIDGE) += of-display-mode-bridge.o
obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index b9028a5e5a06..8877b9789868 100644
--- a/drivers/gpu/drm/bridge/imx/Kconfig
+++ b/drivers/gpu/drm/bridge/imx/Kconfig
@@ -3,16 +3,6 @@ if ARCH_MXC || COMPILE_TEST
config DRM_IMX_LDB_HELPER
tristate
-config DRM_IMX_LEGACY_BRIDGE
- tristate
- depends on DRM_IMX
- help
- This is a DRM bridge implementation for the DRM i.MX IPUv3 driver,
- that uses of_get_drm_display_mode to acquire display mode.
-
- Newer designs should not use this bridge and should use proper panel
- driver instead.
-
config DRM_IMX8MP_DW_HDMI_BRIDGE
tristate "Freescale i.MX8MP HDMI-TX bridge support"
depends on OF
diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile
index 8d01fda25451..69d9f9abbe36 100644
--- a/drivers/gpu/drm/bridge/imx/Makefile
+++ b/drivers/gpu/drm/bridge/imx/Makefile
@@ -1,5 +1,4 @@
obj-$(CONFIG_DRM_IMX_LDB_HELPER) += imx-ldb-helper.o
-obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) += imx-legacy-bridge.o
obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) += imx8mp-hdmi-tx.o
obj-$(CONFIG_DRM_IMX8MP_HDMI_PAI) += imx8mp-hdmi-pai.o
obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) += imx8mp-hdmi-pvi.o
diff --git a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c b/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
deleted file mode 100644
index 0e31d5000e7c..000000000000
--- a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Freescale i.MX drm driver
- *
- * bridge driver for legacy DT bindings, utilizing display-timings node
- */
-
-#include <linux/export.h>
-
-#include <drm/drm_bridge.h>
-#include <drm/drm_modes.h>
-#include <drm/drm_probe_helper.h>
-#include <drm/bridge/imx.h>
-
-#include <video/of_display_timing.h>
-#include <video/of_videomode.h>
-
-struct imx_legacy_bridge {
- struct drm_bridge base;
-
- struct drm_display_mode mode;
- u32 bus_flags;
-};
-
-#define to_imx_legacy_bridge(bridge) container_of(bridge, struct imx_legacy_bridge, base)
-
-static int imx_legacy_bridge_attach(struct drm_bridge *bridge,
- struct drm_encoder *encoder,
- enum drm_bridge_attach_flags flags)
-{
- if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
- return -EINVAL;
-
- return 0;
-}
-
-static int imx_legacy_bridge_get_modes(struct drm_bridge *bridge,
- struct drm_connector *connector)
-{
- struct imx_legacy_bridge *imx_bridge = to_imx_legacy_bridge(bridge);
- int ret;
-
- ret = drm_connector_helper_get_modes_fixed(connector, &imx_bridge->mode);
- if (ret)
- return ret;
-
- connector->display_info.bus_flags = imx_bridge->bus_flags;
-
- return 0;
-}
-
-struct drm_bridge_funcs imx_legacy_bridge_funcs = {
- .attach = imx_legacy_bridge_attach,
- .get_modes = imx_legacy_bridge_get_modes,
-};
-
-struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
- struct device_node *np,
- int type)
-{
- struct imx_legacy_bridge *imx_bridge;
- int ret;
-
- imx_bridge = devm_drm_bridge_alloc(dev, struct imx_legacy_bridge,
- base, &imx_legacy_bridge_funcs);
- if (IS_ERR(imx_bridge))
- return ERR_CAST(imx_bridge);
-
- ret = of_get_drm_display_mode(np,
- &imx_bridge->mode,
- &imx_bridge->bus_flags,
- OF_USE_NATIVE_MODE);
- if (ret)
- return ERR_PTR(ret);
-
- imx_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
-
- imx_bridge->base.of_node = np;
- imx_bridge->base.ops = DRM_BRIDGE_OP_MODES;
- imx_bridge->base.type = type;
-
- ret = devm_drm_bridge_add(dev, &imx_bridge->base);
- if (ret)
- return ERR_PTR(ret);
-
- return &imx_bridge->base;
-}
-EXPORT_SYMBOL_GPL(devm_imx_drm_legacy_bridge);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Freescale i.MX DRM bridge driver for legacy DT bindings");
diff --git a/drivers/gpu/drm/bridge/of-display-mode-bridge.c b/drivers/gpu/drm/bridge/of-display-mode-bridge.c
new file mode 100644
index 000000000000..cb15713f3a79
--- /dev/null
+++ b/drivers/gpu/drm/bridge/of-display-mode-bridge.c
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ *
+ * bridge driver for legacy DT bindings, utilizing display-timings node
+ *
+ * Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+ */
+
+#include <linux/export.h>
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/bridge/of-display-mode-bridge.h>
+
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+
+struct of_display_mode_bridge {
+ struct drm_bridge base;
+
+ struct drm_display_mode mode;
+ u32 bus_flags;
+};
+
+#define to_of_display_mode_bridge(bridge) container_of(bridge, struct of_display_mode_bridge, base)
+
+static int of_display_mode_bridge_attach(struct drm_bridge *bridge,
+ struct drm_encoder *encoder,
+ enum drm_bridge_attach_flags flags)
+{
+ if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+ return -EINVAL;
+
+ return 0;
+}
+
+static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge,
+ struct drm_connector *connector)
+{
+ struct of_display_mode_bridge *of_bridge = to_of_display_mode_bridge(bridge);
+ int ret;
+
+ ret = drm_connector_helper_get_modes_fixed(connector, &of_bridge->mode);
+ if (ret)
+ return ret;
+
+ connector->display_info.bus_flags = of_bridge->bus_flags;
+
+ return 0;
+}
+
+struct drm_bridge_funcs of_display_mode_bridge_funcs = {
+ .attach = of_display_mode_bridge_attach,
+ .get_modes = of_display_mode_bridge_get_modes,
+};
+
+struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev,
+ struct device_node *np,
+ int type)
+{
+ struct of_display_mode_bridge *of_bridge;
+ int ret;
+
+ of_bridge = devm_drm_bridge_alloc(dev, struct of_display_mode_bridge,
+ base, &of_display_mode_bridge_funcs);
+ if (IS_ERR(of_bridge))
+ return ERR_CAST(of_bridge);
+
+ ret = of_get_drm_display_mode(np,
+ &of_bridge->mode,
+ &of_bridge->bus_flags,
+ OF_USE_NATIVE_MODE);
+ if (ret)
+ return ERR_PTR(ret);
+
+ of_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
+
+ of_bridge->base.of_node = np;
+ of_bridge->base.ops = DRM_BRIDGE_OP_MODES;
+ of_bridge->base.type = type;
+
+ ret = devm_drm_bridge_add(dev, &of_bridge->base);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return &of_bridge->base;
+}
+EXPORT_SYMBOL_GPL(devm_drm_of_display_mode_bridge);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("DRM bridge driver for legacy DT bindings");
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index b2240998df4f..351dc65913eb 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -16,7 +16,7 @@ config DRM_IMX_PARALLEL_DISPLAY
select DRM_BRIDGE
select DRM_BRIDGE_CONNECTOR
select DRM_DISPLAY_HELPER
- select DRM_IMX_LEGACY_BRIDGE
+ select DRM_OF_DISPLAY_MODE_BRIDGE
select DRM_PANEL_BRIDGE
select VIDEOMODE_HELPERS
@@ -37,7 +37,7 @@ config DRM_IMX_LDB
select DRM_BRIDGE
select DRM_BRIDGE_CONNECTOR
select DRM_PANEL_BRIDGE
- select DRM_IMX_LEGACY_BRIDGE
+ select DRM_OF_DISPLAY_MODE_BRIDGE
help
Choose this to enable the internal LVDS Display Bridge (LDB)
found on i.MX53 and i.MX6 processors.
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index 626d410d9150..730caf883e83 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -28,7 +28,7 @@
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
-#include <drm/bridge/imx.h>
+#include <drm/bridge/of-display-mode-bridge.h>
#include "imx-drm.h"
@@ -605,8 +605,8 @@ static int imx_ldb_probe(struct platform_device *pdev)
* checking the bus_format property.
*/
if (!channel->bridge) {
- channel->bridge = devm_imx_drm_legacy_bridge(dev, child,
- DRM_MODE_CONNECTOR_LVDS);
+ channel->bridge = devm_drm_of_display_mode_bridge(dev, child,
+ DRM_MODE_CONNECTOR_LVDS);
if (IS_ERR(channel->bridge)) {
ret = PTR_ERR(channel->bridge);
goto free_child;
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index a356f0b764cb..6c505becb31d 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -19,7 +19,7 @@
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
-#include <drm/bridge/imx.h>
+#include <drm/bridge/of-display-mode-bridge.h>
#include "imx-drm.h"
@@ -242,7 +242,8 @@ static int imx_pd_probe(struct platform_device *pdev)
/* port@1 is the output port */
imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
if (imxpd->next_bridge == ERR_PTR(-ENODEV))
- imxpd->next_bridge = devm_imx_drm_legacy_bridge(dev, np, DRM_MODE_CONNECTOR_DPI);
+ imxpd->next_bridge = devm_drm_of_display_mode_bridge(dev, np,
+ DRM_MODE_CONNECTOR_DPI);
if (IS_ERR(imxpd->next_bridge)) {
ret = PTR_ERR(imxpd->next_bridge);
return ret;
diff --git a/include/drm/bridge/imx.h b/include/drm/bridge/imx.h
deleted file mode 100644
index b93f719fe0e7..000000000000
--- a/include/drm/bridge/imx.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2012 Sascha Hauer, Pengutronix
- */
-
-#ifndef DRM_IMX_BRIDGE_H
-#define DRM_IMX_BRIDGE_H
-
-struct device;
-struct device_node;
-struct drm_bridge;
-
-struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
- struct device_node *np,
- int type);
-
-#endif
diff --git a/include/drm/bridge/of-display-mode-bridge.h b/include/drm/bridge/of-display-mode-bridge.h
new file mode 100644
index 000000000000..89fcfedf68d8
--- /dev/null
+++ b/include/drm/bridge/of-display-mode-bridge.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ */
+
+#ifndef DRM_OF_DISPLAY_MODE_BRIDGE_H
+#define DRM_OF_DISPLAY_MODE_BRIDGE_H
+
+struct device;
+struct device_node;
+struct drm_bridge;
+
+struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev,
+ struct device_node *np,
+ int type);
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2026-04-09 6:52 ` [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
2026-04-09 6:52 ` [PATCH v13 02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
` (11 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Use &analogix_dp_plat_data.bridge instead of &exynos_dp_device.ptn_bridge
directly.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v3:
- Fix the typographical error for &dp->plat_data.bridge.
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
Changes in v9:
- Add Reviewed-by and Tested-by tags.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/exynos/exynos_dp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 5bcf41e0bd04..f469ac5b3c2a 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -36,7 +36,6 @@
struct exynos_dp_device {
struct drm_encoder encoder;
struct drm_connector *connector;
- struct drm_bridge *ptn_bridge;
struct drm_device *drm_dev;
struct device *dev;
@@ -106,8 +105,8 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
dp->connector = connector;
/* Pre-empt DP connector creation if there's a bridge */
- if (dp->ptn_bridge) {
- ret = drm_bridge_attach(&dp->encoder, dp->ptn_bridge, bridge,
+ if (plat_data->next_bridge) {
+ ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge,
0);
if (ret)
return ret;
@@ -155,7 +154,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)
dp->drm_dev = drm_dev;
- if (!dp->plat_data.panel && !dp->ptn_bridge) {
+ if (!dp->plat_data.panel && !dp->plat_data.next_bridge) {
ret = exynos_dp_dt_parse_panel(dp);
if (ret)
return ret;
@@ -232,6 +231,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
/* The remote port can be either a panel or a bridge */
dp->plat_data.panel = panel;
+ dp->plat_data.next_bridge = bridge;
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
@@ -239,8 +239,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->plat_data.get_modes = exynos_dp_get_modes;
dp->plat_data.skip_connector = !!bridge;
- dp->ptn_bridge = bridge;
-
out:
dp->adp = analogix_dp_probe(dev, &dp->plat_data);
if (IS_ERR(dp->adp))
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (2 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node Damon Ding
` (10 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
The &exynos_dp_device.connector is assigned in exynos_dp_bridge_attach()
but never used. It should make sense to remove it.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v5:
- Fix the 'drm/bridge' to 'drm/exynos' in commit message.
Changes in v9:
- Add Reviewed-by and Tested-by tags.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/exynos/exynos_dp.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index f469ac5b3c2a..e20513164032 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -35,7 +35,6 @@
struct exynos_dp_device {
struct drm_encoder encoder;
- struct drm_connector *connector;
struct drm_device *drm_dev;
struct device *dev;
@@ -102,8 +101,6 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
struct exynos_dp_device *dp = to_dp(plat_data);
int ret;
- dp->connector = connector;
-
/* Pre-empt DP connector creation if there's a bridge */
if (plat_data->next_bridge) {
ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge,
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (3 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
` (9 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
If there is neither a panel nor a bridge, the display timing can be
parsed from the display-timings node under the dp node.
In order to get rid of &analogix_dp_plat_data.get_modes() and make
the codes more consistent, apply DRM of-display-mode-bridge to parse
display timings.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v6:
- Apply DRM legacy bridge to parse display timings instead of
implementing the same codes only for Exynos DP.
Changes in v7:
- Use temporary flag &exynos_dp_device.has_of_bridge, which will be
removed in the following patch, instead of applying API
drm_bridge_is_legacy().
- Remove exynos_dp_legacy_bridge_init() and inline API
devm_drm_of_display_mode_bridge().
Changes in v9:
- Add Tested-by tag.
Changes in v10:
- Add Reviewed-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/exynos/Kconfig | 1 +
drivers/gpu/drm/exynos/exynos_dp.c | 66 ++++++++----------------------
2 files changed, 17 insertions(+), 50 deletions(-)
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 0d13828e7d9e..380d9a8ce259 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -72,6 +72,7 @@ config DRM_EXYNOS_DP
select DRM_ANALOGIX_DP
select DRM_DISPLAY_DP_HELPER
default DRM_EXYNOS
+ select DRM_OF_DISPLAY_MODE_BRIDGE
select DRM_PANEL
help
This enables support for DP device.
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index e20513164032..ac16138a22fe 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -19,6 +19,7 @@
#include <video/videomode.h>
#include <drm/bridge/analogix_dp.h>
+#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_crtc.h>
@@ -38,9 +39,10 @@ struct exynos_dp_device {
struct drm_device *drm_dev;
struct device *dev;
- struct videomode vm;
struct analogix_dp_device *adp;
struct analogix_dp_plat_data plat_data;
+
+ bool has_of_bridge;
};
static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
@@ -67,44 +69,20 @@ static int exynos_dp_poweroff(struct analogix_dp_plat_data *plat_data)
return exynos_dp_crtc_clock_enable(plat_data, false);
}
-static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,
- struct drm_connector *connector)
-{
- struct exynos_dp_device *dp = to_dp(plat_data);
- struct drm_display_mode *mode;
-
- if (dp->plat_data.panel)
- return 0;
-
- mode = drm_mode_create(connector->dev);
- if (!mode) {
- DRM_DEV_ERROR(dp->dev,
- "failed to create a new display mode.\n");
- return 0;
- }
-
- drm_display_mode_from_videomode(&dp->vm, mode);
- connector->display_info.width_mm = mode->width_mm;
- connector->display_info.height_mm = mode->height_mm;
-
- mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
- drm_mode_set_name(mode);
- drm_mode_probed_add(connector, mode);
-
- return 1;
-}
-
static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
struct drm_bridge *bridge,
struct drm_connector *connector)
{
struct exynos_dp_device *dp = to_dp(plat_data);
+ enum drm_bridge_attach_flags flags = 0;
int ret;
/* Pre-empt DP connector creation if there's a bridge */
if (plat_data->next_bridge) {
- ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge,
- 0);
+ if (dp->has_of_bridge)
+ flags = DRM_BRIDGE_ATTACH_NO_CONNECTOR;
+
+ ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge, flags);
if (ret)
return ret;
}
@@ -129,19 +107,6 @@ static const struct drm_encoder_helper_funcs exynos_dp_encoder_helper_funcs = {
.disable = exynos_dp_nop,
};
-static int exynos_dp_dt_parse_panel(struct exynos_dp_device *dp)
-{
- int ret;
-
- ret = of_get_videomode(dp->dev->of_node, &dp->vm, OF_USE_NATIVE_MODE);
- if (ret) {
- DRM_DEV_ERROR(dp->dev,
- "failed: of_get_videomode() : %d\n", ret);
- return ret;
- }
- return 0;
-}
-
static int exynos_dp_bind(struct device *dev, struct device *master, void *data)
{
struct exynos_dp_device *dp = dev_get_drvdata(dev);
@@ -151,12 +116,6 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)
dp->drm_dev = drm_dev;
- if (!dp->plat_data.panel && !dp->plat_data.next_bridge) {
- ret = exynos_dp_dt_parse_panel(dp);
- if (ret)
- return ret;
- }
-
drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_TMDS);
drm_encoder_helper_add(encoder, &exynos_dp_encoder_helper_funcs);
@@ -223,6 +182,14 @@ static int exynos_dp_probe(struct platform_device *pdev)
}
ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, &bridge);
+ if (ret == -ENODEV) {
+ dp->plat_data.next_bridge = devm_drm_of_display_mode_bridge(dp->dev,
+ dp->dev->of_node,
+ DRM_MODE_CONNECTOR_eDP);
+ ret = IS_ERR(dp->plat_data.next_bridge) ? PTR_ERR(dp->plat_data.next_bridge) : 0;
+ if (!ret)
+ dp->has_of_bridge = true;
+ }
if (ret)
return ret;
@@ -233,7 +200,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
dp->plat_data.attach = exynos_dp_bridge_attach;
- dp->plat_data.get_modes = exynos_dp_get_modes;
dp->plat_data.skip_connector = !!bridge;
out:
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (4 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
` (8 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
The &analogix_dp_plat_data.skip_connector related check can be replaced
by &analogix_dp_plat_data.bridge.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v3:
- Squash the Exynos side commit and the Analogix side commit together.
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
Changes in v9:
- Add Tested-by tag.
Changes in v10:
- Add Reviewed-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
drivers/gpu/drm/exynos/exynos_dp.c | 1 -
include/drm/bridge/analogix_dp.h | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 8dee5f2fbde5..88fb863fed78 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -959,7 +959,7 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (!dp->plat_data->skip_connector) {
+ if (!dp->plat_data->next_bridge) {
connector = &dp->connector;
connector->polled = DRM_CONNECTOR_POLL_HPD;
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index ac16138a22fe..1eeb0b15f99a 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -200,7 +200,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
dp->plat_data.attach = exynos_dp_bridge_attach;
- dp->plat_data.skip_connector = !!bridge;
out:
dp->adp = analogix_dp_probe(dev, &dp->plat_data);
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 582357c20640..f06da105d8f2 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -30,7 +30,6 @@ struct analogix_dp_plat_data {
struct drm_bridge *next_bridge;
struct drm_encoder *encoder;
struct drm_connector *connector;
- bool skip_connector;
int (*power_on)(struct analogix_dp_plat_data *);
int (*power_off)(struct analogix_dp_plat_data *);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (5 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
` (7 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
For Rockchip platforms, the YUV color formats are currently unsupported.
This compatibility check was previously implemented in
&analogix_dp_plat_data.get_modes().
Moving color format check to &drm_connector_helper_funcs.atomic_check()
would get rid of &analogix_dp_plat_data.get_modes() and be more
reasonable than before.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v9:
- Add Tested-by tag.
Changes in v13:
- Rebase after commit 01962a191242 ("drm/rockchip: analogix: Convert to
drm_output_color_format")
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++++
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 18 ------------------
2 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 88fb863fed78..c05cf100f17e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -894,8 +894,19 @@ static int analogix_dp_atomic_check(struct drm_connector *connector,
struct drm_atomic_state *state)
{
struct analogix_dp_device *dp = to_dp(connector);
+ struct drm_display_info *di = &connector->display_info;
struct drm_connector_state *conn_state;
struct drm_crtc_state *crtc_state;
+ u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
+
+ if (is_rockchip(dp->plat_data->dev_type)) {
+ if ((di->color_formats & mask)) {
+ DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
+ di->color_formats &= ~mask;
+ di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
+ di->bpc = 8;
+ }
+ }
conn_state = drm_atomic_get_new_connector_state(state, connector);
if (WARN_ON(!conn_state))
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 387fb6259edd..48206a7b767f 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -166,23 +166,6 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
return 0;
}
-static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
- struct drm_connector *connector)
-{
- struct drm_display_info *di = &connector->display_info;
- /* VOP couldn't output YUV video format for eDP rightly */
- u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
-
- if ((di->color_formats & mask)) {
- DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
- di->color_formats &= ~mask;
- di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
- di->bpc = 8;
- }
-
- return 0;
-}
-
static bool
rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
@@ -483,7 +466,6 @@ static int rockchip_dp_probe(struct platform_device *pdev)
dp->plat_data.dev_type = dp->data->chip_type;
dp->plat_data.power_on = rockchip_dp_poweron;
dp->plat_data.power_off = rockchip_dp_powerdown;
- dp->plat_data.get_modes = rockchip_dp_get_modes;
ret = rockchip_dp_of_probe(dp);
if (ret < 0)
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes()
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (6 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach() Damon Ding
` (6 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
The callback &analogix_dp_plat_data.get_modes() is not implemented
by either Rockchip side or Exynos side.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v9:
- Add Tested-by tag.
Changes in v10:
- Add Reviewed-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 ---
include/drm/bridge/analogix_dp.h | 2 --
2 files changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index c05cf100f17e..09b8b5e4fa23 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -875,9 +875,6 @@ static int analogix_dp_get_modes(struct drm_connector *connector)
}
}
- if (dp->plat_data->get_modes)
- num_modes += dp->plat_data->get_modes(dp->plat_data, connector);
-
return num_modes;
}
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index f06da105d8f2..3301392eda5f 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -35,8 +35,6 @@ struct analogix_dp_plat_data {
int (*power_off)(struct analogix_dp_plat_data *);
int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *,
struct drm_connector *);
- int (*get_modes)(struct analogix_dp_plat_data *,
- struct drm_connector *);
};
int analogix_dp_resume(struct analogix_dp_device *dp);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach()
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (7 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
` (5 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
For both Rockchip and Exynos sides, the struct drm_connector* is
never used in callback &analogix_dp_plat_data.attach(). After
applying drm_bridge_connector helper, this parameter will no longer
be used at all.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v11:
- Add Reviewed-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
drivers/gpu/drm/exynos/exynos_dp.c | 3 +--
include/drm/bridge/analogix_dp.h | 3 +--
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 09b8b5e4fa23..840c1963e60e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -991,7 +991,7 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
* point after plat attached.
*/
if (dp->plat_data->attach) {
- ret = dp->plat_data->attach(dp->plat_data, bridge, connector);
+ ret = dp->plat_data->attach(dp->plat_data, bridge);
if (ret) {
DRM_ERROR("Failed at platform attach func\n");
return ret;
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 1eeb0b15f99a..71a00ee97782 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -70,8 +70,7 @@ static int exynos_dp_poweroff(struct analogix_dp_plat_data *plat_data)
}
static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
- struct drm_bridge *bridge,
- struct drm_connector *connector)
+ struct drm_bridge *bridge)
{
struct exynos_dp_device *dp = to_dp(plat_data);
enum drm_bridge_attach_flags flags = 0;
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 3301392eda5f..3428ffff24c5 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -33,8 +33,7 @@ struct analogix_dp_plat_data {
int (*power_on)(struct analogix_dp_plat_data *);
int (*power_off)(struct analogix_dp_plat_data *);
- int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *,
- struct drm_connector *);
+ int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *);
};
int analogix_dp_resume(struct analogix_dp_device *dp);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set()
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (8 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach() Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-09 21:02 ` Dmitry Baryshkov
` (2 more replies)
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
` (4 subsequent siblings)
14 siblings, 3 replies; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
To avoid using &analogix_dp_device.connector for compatibility
with the bridge connector framework, get &drm_connector from
&drm_atomic_state instead.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 840c1963e60e..84b994cce900 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1095,14 +1095,21 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
}
static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
+ struct drm_atomic_state *state,
const struct drm_display_mode *mode)
{
struct analogix_dp_device *dp = to_dp(bridge);
- struct drm_display_info *display_info = &dp->connector.display_info;
struct video_info *video = &dp->video_info;
struct device_node *dp_node = dp->dev->of_node;
+ struct drm_connector *connector;
+ struct drm_display_info *display_info;
int vic;
+ connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
+ if (!connector)
+ return;
+ display_info = &connector->display_info;
+
/* Input video interlaces & hsync pol & vsync pol */
video->interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC);
@@ -1186,7 +1193,7 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,
new_crtc_state = drm_atomic_get_new_crtc_state(old_state, crtc);
if (!new_crtc_state)
return;
- analogix_dp_bridge_mode_set(bridge, &new_crtc_state->adjusted_mode);
+ analogix_dp_bridge_mode_set(bridge, old_state, &new_crtc_state->adjusted_mode);
old_crtc_state = drm_atomic_get_old_crtc_state(old_state, crtc);
/* Not a full enable, just disable PSR and continue */
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (9 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-09 21:06 ` Dmitry Baryshkov
` (2 more replies)
2026-04-09 6:52 ` [PATCH v13 12/17] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
` (3 subsequent siblings)
14 siblings, 3 replies; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Initialize bridge_connector for both Rockchip and Exynos encoder sides.
Then, make DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory for Analogix bridge
side, as the private &drm_connector is no longer created.
The previous &drm_connector_funcs and &drm_connector_helper_funcs APIs
are replaced by the corresponding &drm_bridge_funcs APIs:
analogix_dp_atomic_check() -> analogix_dp_bridge_atomic_check()
analogix_dp_detect() -> analogix_dp_bridge_detect()
analogix_dp_get_modes() -> analogix_dp_bridge_get_modes()
analogix_dp_bridge_edid_read()
Additionally, the compatibilities of Analogix DP bridge based on whether
the next bridge is a 'panel'. If it is, OP_MODES and OP_DETECT are
supported; If not (the next bridge is a 'monitor' or a bridge chip),
OP_EDID and OP_DETECT are supported.
The devm_drm_bridge_add() is placed in analogix_dp_bind() instead of
analogix_dp_probe(), because the type of next bridge (the panel, monitor
or bridge chip) can only be determined after the probe process has fully
completed.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v2:
- For &drm_bridge.ops, remove DRM_BRIDGE_OP_HPD and add
DRM_BRIDGE_OP_EDID.
- Add analogix_dp_bridge_edid_read().
- Move &analogix_dp_plat_data.skip_connector deletion to the previous
patches.
Changes in v3:
- Rebase with the new devm_drm_bridge_alloc() related commit
48f05c3b4b70 ("drm/bridge: analogix_dp: Use devm_drm_bridge_alloc()
API").
- Expand the commit message.
- Call drm_bridge_get_modes() in analogix_dp_bridge_get_modes() if the
bridge is available.
- Remove unnecessary parameter struct drm_connector* for callback
&analogix_dp_plat_data.attach.
- In order to decouple the connector driver and the bridge driver, move
the bridge connector initilization to the Rockchip and Exynos sides.
Changes in v4:
- Expand analogix_dp_bridge_detect() parameters to &drm_bridge and
&drm_connector.
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
Changes in v5:
- Set the flag fo drm_bridge_attach() to DRM_BRIDGE_ATTACH_NO_CONNECTOR
for next bridge attachment of Exynos side.
- Distinguish the &drm_bridge->ops of Analogix bridge based on whether
the downstream device is a panel, a bridge or neither.
- Remove the calls to &analogix_dp_plat_data.get_modes().
Changes in v6:
- Select DRM_BRIDGE_CONNECTOR for both Rockchip and Exynos sides.
- Remove unnecessary drm_bridge_get_modes() in
analogix_dp_bridge_get_modes().
- Simplify analogix_dp_bridge_edid_read().
- If the next is a bridge, set DRM_BRIDGE_OP_DETECT and return
connector_status_connected in analogix_dp_bridge_detect().
- Set flag DRM_BRIDGE_ATTACH_NO_CONNECTOR for bridge attachment while
binding. Meanwhile, make DRM_BRIDGE_ATTACH_NO_CONNECTOR unsuppported
in analogix_dp_bridge_attach().
- Simplify the check of bridge capabilities.
Changes in v7:
- Remove temporary flag &exynos_dp_device.has_of_bridge.
Changes in v9
- Add Tested-by tag.
Changes in v10:
- Split this commit into serval smaller ones.
- Simplify the commit message.
Changes in v11:
- Move the removal of &analogix_dp_device.connector to this commit.
- In exynos_dp_bridge_attach(), set the bridge flag to 'flags |
DRM_BRIDGE_ATTACH_NO_CONNECTOR' instead of fixed
'DRM_BRIDGE_ATTACH_NO_CONNECTOR' for extensibility.
Changes in v12:
- Restore accidentally removed DRM_BRIDGE_CONNECTOR Kconfig in v10.
Changes in v13:
- Rebase after commit 01962a191242 ("drm/rockchip: analogix: Convert
to drm_output_color_format")
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 135 +++++++-----------
.../drm/bridge/analogix/analogix_dp_core.h | 1 -
drivers/gpu/drm/exynos/Kconfig | 1 +
drivers/gpu/drm/exynos/exynos_dp.c | 25 ++--
drivers/gpu/drm/rockchip/Kconfig | 1 +
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 11 +-
6 files changed, 78 insertions(+), 96 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 84b994cce900..4c0192733085 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -856,44 +856,32 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)
return analogix_dp_send_psr_spd(dp, &psr_vsc, true);
}
-static int analogix_dp_get_modes(struct drm_connector *connector)
+static int analogix_dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
- const struct drm_edid *drm_edid;
+ struct analogix_dp_device *dp = to_dp(bridge);
int num_modes = 0;
- if (dp->plat_data->panel) {
+ if (dp->plat_data->panel)
num_modes += drm_panel_get_modes(dp->plat_data->panel, connector);
- } else {
- drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc);
-
- drm_edid_connector_update(&dp->connector, drm_edid);
-
- if (drm_edid) {
- num_modes += drm_edid_connector_add_modes(&dp->connector);
- drm_edid_free(drm_edid);
- }
- }
return num_modes;
}
-static struct drm_encoder *
-analogix_dp_best_encoder(struct drm_connector *connector)
+static const struct drm_edid *analogix_dp_bridge_edid_read(struct drm_bridge *bridge,
+ struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
+ struct analogix_dp_device *dp = to_dp(bridge);
- return dp->encoder;
+ return drm_edid_read_ddc(connector, &dp->aux.ddc);
}
-
-static int analogix_dp_atomic_check(struct drm_connector *connector,
- struct drm_atomic_state *state)
+static int analogix_dp_bridge_atomic_check(struct drm_bridge *bridge,
+ struct drm_bridge_state *bridge_state,
+ struct drm_crtc_state *crtc_state,
+ struct drm_connector_state *conn_state)
{
- struct analogix_dp_device *dp = to_dp(connector);
- struct drm_display_info *di = &connector->display_info;
- struct drm_connector_state *conn_state;
- struct drm_crtc_state *crtc_state;
+ struct analogix_dp_device *dp = to_dp(bridge);
+ struct drm_display_info *di = &conn_state->connector->display_info;
u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
if (is_rockchip(dp->plat_data->dev_type)) {
@@ -905,38 +893,21 @@ static int analogix_dp_atomic_check(struct drm_connector *connector,
}
}
- conn_state = drm_atomic_get_new_connector_state(state, connector);
- if (WARN_ON(!conn_state))
- return -ENODEV;
-
conn_state->self_refresh_aware = true;
- if (!conn_state->crtc)
- return 0;
-
- crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
- if (!crtc_state)
- return 0;
-
if (crtc_state->self_refresh_active && !dp->psr_supported)
return -EINVAL;
return 0;
}
-static const struct drm_connector_helper_funcs analogix_dp_connector_helper_funcs = {
- .get_modes = analogix_dp_get_modes,
- .best_encoder = analogix_dp_best_encoder,
- .atomic_check = analogix_dp_atomic_check,
-};
-
static enum drm_connector_status
-analogix_dp_detect(struct drm_connector *connector, bool force)
+analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
+ struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->plat_data->panel)
+ if (dp->plat_data->panel || dp->plat_data->next_bridge)
return connector_status_connected;
if (!analogix_dp_detect_hpd(dp))
@@ -945,51 +916,18 @@ analogix_dp_detect(struct drm_connector *connector, bool force)
return status;
}
-static const struct drm_connector_funcs analogix_dp_connector_funcs = {
- .fill_modes = drm_helper_probe_single_connector_modes,
- .detect = analogix_dp_detect,
- .destroy = drm_connector_cleanup,
- .reset = drm_atomic_helper_connector_reset,
- .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
- .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
-};
-
static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
{
struct analogix_dp_device *dp = to_dp(bridge);
- struct drm_connector *connector = NULL;
int ret = 0;
- if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
- DRM_ERROR("Fix bridge driver to make connector optional!");
+ if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+ DRM_ERROR("Unsupported connector creation\n");
return -EINVAL;
}
- if (!dp->plat_data->next_bridge) {
- connector = &dp->connector;
- connector->polled = DRM_CONNECTOR_POLL_HPD;
-
- ret = drm_connector_init(dp->drm_dev, connector,
- &analogix_dp_connector_funcs,
- DRM_MODE_CONNECTOR_eDP);
- if (ret) {
- DRM_ERROR("Failed to initialize connector with drm\n");
- return ret;
- }
-
- drm_connector_helper_add(connector,
- &analogix_dp_connector_helper_funcs);
- drm_connector_attach_encoder(connector, encoder);
- }
-
- /*
- * NOTE: the connector registration is implemented in analogix
- * platform driver, that to say connector would be exist after
- * plat_data->attch return, that's why we record the connector
- * point after plat attached.
- */
if (dp->plat_data->attach) {
ret = dp->plat_data->attach(dp->plat_data, bridge);
if (ret) {
@@ -1309,7 +1247,11 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_enable = analogix_dp_bridge_atomic_enable,
.atomic_disable = analogix_dp_bridge_atomic_disable,
.atomic_post_disable = analogix_dp_bridge_atomic_post_disable,
+ .atomic_check = analogix_dp_bridge_atomic_check,
.attach = analogix_dp_bridge_attach,
+ .get_modes = analogix_dp_bridge_get_modes,
+ .edid_read = analogix_dp_bridge_edid_read,
+ .detect = analogix_dp_bridge_detect,
};
static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
@@ -1539,6 +1481,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_resume);
int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
{
+ struct drm_bridge *bridge = &dp->bridge;
int ret;
dp->drm_dev = drm_dev;
@@ -1552,7 +1495,18 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
return ret;
}
- ret = drm_bridge_attach(dp->encoder, &dp->bridge, NULL, 0);
+ if (dp->plat_data->panel)
+ bridge->ops = DRM_BRIDGE_OP_MODES | DRM_BRIDGE_OP_DETECT;
+ else
+ bridge->ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
+
+ bridge->of_node = dp->dev->of_node;
+ bridge->type = DRM_MODE_CONNECTOR_eDP;
+ ret = devm_drm_bridge_add(dp->dev, &dp->bridge);
+ if (ret)
+ goto err_unregister_aux;
+
+ ret = drm_bridge_attach(dp->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
DRM_ERROR("failed to create bridge (%d)\n", ret);
goto err_unregister_aux;
@@ -1570,7 +1524,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
analogix_dp_bridge_disable(&dp->bridge);
- dp->connector.funcs->destroy(&dp->connector);
drm_panel_unprepare(dp->plat_data->panel);
@@ -1580,7 +1533,8 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind);
int analogix_dp_start_crc(struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
+ struct analogix_dp_device *dp;
+ struct drm_bridge *bridge;
if (!connector->state->crtc) {
DRM_ERROR("Connector %s doesn't currently have a CRTC.\n",
@@ -1588,13 +1542,26 @@ int analogix_dp_start_crc(struct drm_connector *connector)
return -EINVAL;
}
+ bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
+ if (bridge->type != DRM_MODE_CONNECTOR_eDP)
+ return -EINVAL;
+
+ dp = to_dp(bridge);
+
return drm_dp_start_crc(&dp->aux, connector->state->crtc);
}
EXPORT_SYMBOL_GPL(analogix_dp_start_crc);
int analogix_dp_stop_crc(struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
+ struct analogix_dp_device *dp;
+ struct drm_bridge *bridge;
+
+ bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
+ if (bridge->type != DRM_MODE_CONNECTOR_eDP)
+ return -EINVAL;
+
+ dp = to_dp(bridge);
return drm_dp_stop_crc(&dp->aux);
}
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 91b215c6a0cf..17347448c6b0 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -154,7 +154,6 @@ struct analogix_dp_device {
struct drm_encoder *encoder;
struct device *dev;
struct drm_device *drm_dev;
- struct drm_connector connector;
struct drm_bridge bridge;
struct drm_dp_aux aux;
struct clk *clock;
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 380d9a8ce259..38bf070866f6 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -70,6 +70,7 @@ config DRM_EXYNOS_DP
bool "Exynos specific extensions for Analogix DP driver"
depends on DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON
select DRM_ANALOGIX_DP
+ select DRM_BRIDGE_CONNECTOR
select DRM_DISPLAY_DP_HELPER
default DRM_EXYNOS
select DRM_OF_DISPLAY_MODE_BRIDGE
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 71a00ee97782..b2597fafd73d 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -22,6 +22,7 @@
#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_crtc.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
@@ -41,8 +42,6 @@ struct exynos_dp_device {
struct analogix_dp_device *adp;
struct analogix_dp_plat_data plat_data;
-
- bool has_of_bridge;
};
static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
@@ -78,10 +77,8 @@ static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
/* Pre-empt DP connector creation if there's a bridge */
if (plat_data->next_bridge) {
- if (dp->has_of_bridge)
- flags = DRM_BRIDGE_ATTACH_NO_CONNECTOR;
-
- ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge, flags);
+ ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge,
+ flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ret;
}
@@ -111,6 +108,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)
struct exynos_dp_device *dp = dev_get_drvdata(dev);
struct drm_encoder *encoder = &dp->encoder;
struct drm_device *drm_dev = data;
+ struct drm_connector *connector;
int ret;
dp->drm_dev = drm_dev;
@@ -126,10 +124,19 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)
dp->plat_data.encoder = encoder;
ret = analogix_dp_bind(dp->adp, dp->drm_dev);
- if (ret)
+ if (ret) {
dp->encoder.funcs->destroy(&dp->encoder);
+ return ret;
+ }
+
+ connector = drm_bridge_connector_init(dp->drm_dev, dp->plat_data.encoder);
+ if (IS_ERR(connector)) {
+ ret = PTR_ERR(connector);
+ dev_err(dp->dev, "Failed to initialize bridge_connector\n");
+ return ret;
+ }
- return ret;
+ return drm_connector_attach_encoder(connector, dp->plat_data.encoder);
}
static void exynos_dp_unbind(struct device *dev, struct device *master,
@@ -186,8 +193,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->dev->of_node,
DRM_MODE_CONNECTOR_eDP);
ret = IS_ERR(dp->plat_data.next_bridge) ? PTR_ERR(dp->plat_data.next_bridge) : 0;
- if (!ret)
- dp->has_of_bridge = true;
}
if (ret)
return ret;
diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index 1479b8c4ed40..e7f49fe845ea 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -46,6 +46,7 @@ config ROCKCHIP_VOP2
config ROCKCHIP_ANALOGIX_DP
bool "Rockchip specific extensions for Analogix DP driver"
depends on ROCKCHIP_VOP
+ select DRM_BRIDGE_CONNECTOR
select DRM_DISPLAY_HELPER
select DRM_DISPLAY_DP_HELPER
help
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 48206a7b767f..99e739f4f583 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -25,6 +25,7 @@
#include <drm/display/drm_dp_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/bridge/analogix_dp.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
@@ -369,6 +370,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
{
struct rockchip_dp_device *dp = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
+ struct drm_connector *connector;
int ret;
dp->drm_dev = drm_dev;
@@ -388,7 +390,14 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
if (ret)
goto err_cleanup_encoder;
- return 0;
+ connector = drm_bridge_connector_init(dp->drm_dev, dp->plat_data.encoder);
+ if (IS_ERR(connector)) {
+ ret = PTR_ERR(connector);
+ dev_err(dp->dev, "Failed to initialize bridge_connector\n");
+ goto err_cleanup_encoder;
+ }
+
+ return drm_connector_attach_encoder(connector, dp->plat_data.encoder);
err_cleanup_encoder:
dp->encoder.encoder.funcs->destroy(&dp->encoder.encoder);
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 12/17] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe()
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (10 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
@ 2026-04-09 6:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
` (2 subsequent siblings)
14 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 6:52 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Since the panel/bridge should logically be positioned behind the
Analogix bridge in the display pipeline, it makes sense to handle
the panel/bridge parsing on the Analogix side. Therefore, we add
a new API analogix_dp_finish_probe(), which combines the panel/bridge
parsing with component addition, to do it.
In order to process component binding right after the probe completes,
the &analogix_dp_plat_data.ops is newly added to pass &component_ops,
for which the &dp_aux_ep_device_with_data.done_probing() of DP AUX bus
only supports passing &drm_dp_aux.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
- Remame API analogix_dp_find_panel_or_bridge() to
analogix_dp_finish_probe().
Changes in v5:
- Select DRM_DISPLAY_DP_AUX_BUS for DRM_ANALOGIX_DP.
Changes in v9:
- Add Tested-by tag.
Changes in v10:
- Fix to use dev_err_probe() in analogix_dp_finish_probe().
- Expand the commit message.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/Kconfig | 1 +
.../drm/bridge/analogix/analogix_dp_core.c | 46 +++++++++++++++++++
include/drm/bridge/analogix_dp.h | 2 +
3 files changed, 49 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig
index 03dc7ffe824a..8a6136cd675f 100644
--- a/drivers/gpu/drm/bridge/analogix/Kconfig
+++ b/drivers/gpu/drm/bridge/analogix/Kconfig
@@ -29,6 +29,7 @@ config DRM_ANALOGIX_ANX78XX
config DRM_ANALOGIX_DP
tristate
depends on DRM
+ select DRM_DISPLAY_DP_AUX_BUS
config DRM_ANALOGIX_ANX7625
tristate "Analogix Anx7625 MIPI to DP interface support"
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 4c0192733085..17d078b836e3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -20,12 +20,14 @@
#include <linux/platform_device.h>
#include <drm/bridge/analogix_dp.h>
+#include <drm/display/drm_dp_aux_bus.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_crtc.h>
#include <drm/drm_device.h>
#include <drm/drm_edid.h>
+#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
@@ -1581,6 +1583,50 @@ struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp)
}
EXPORT_SYMBOL_GPL(analogix_dp_get_aux);
+static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
+{
+ struct analogix_dp_device *dp = to_dp(aux);
+ struct analogix_dp_plat_data *plat_data = dp->plat_data;
+ int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
+ int ret;
+
+ /*
+ * If drm_of_find_panel_or_bridge() returns -ENODEV, there may be no valid panel
+ * or bridge nodes. The driver should go on for the driver-free bridge or the DP
+ * mode applications.
+ */
+ ret = drm_of_find_panel_or_bridge(dp->dev->of_node, port, 0,
+ &plat_data->panel, &plat_data->next_bridge);
+ if (ret && ret != -ENODEV)
+ return ret;
+
+ return component_add(dp->dev, plat_data->ops);
+}
+
+int analogix_dp_finish_probe(struct analogix_dp_device *dp)
+{
+ int ret;
+
+ ret = devm_of_dp_aux_populate_bus(&dp->aux, analogix_dp_aux_done_probing);
+ if (ret) {
+ /*
+ * If devm_of_dp_aux_populate_bus() returns -ENODEV, the done_probing() will
+ * not be called because there are no EP devices. Then the callback function
+ * analogix_dp_aux_done_probing() will be called directly in order to support
+ * the other valid DT configurations.
+ *
+ * NOTE: The devm_of_dp_aux_populate_bus() is allowed to return -EPROBE_DEFER.
+ */
+ if (ret != -ENODEV)
+ return dev_err_probe(dp->dev, ret, "failed to populate aux bus\n");
+
+ return analogix_dp_aux_done_probing(&dp->aux);
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(analogix_dp_finish_probe);
+
MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
MODULE_DESCRIPTION("Analogix DP Core Driver");
MODULE_LICENSE("GPL v2");
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 3428ffff24c5..bae969dec63a 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -30,6 +30,7 @@ struct analogix_dp_plat_data {
struct drm_bridge *next_bridge;
struct drm_encoder *encoder;
struct drm_connector *connector;
+ const struct component_ops *ops;
int (*power_on)(struct analogix_dp_plat_data *);
int (*power_off)(struct analogix_dp_plat_data *);
@@ -49,5 +50,6 @@ int analogix_dp_stop_crc(struct drm_connector *connector);
struct analogix_dp_plat_data *analogix_dp_aux_to_plat_data(struct drm_dp_aux *aux);
struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp);
+int analogix_dp_finish_probe(struct analogix_dp_device *dp);
#endif /* _ANALOGIX_DP_H_ */
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe()
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (11 preceding siblings ...)
2026-04-09 6:52 ` [PATCH v13 12/17] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
@ 2026-04-09 7:19 ` Damon Ding
2026-04-09 7:19 ` [PATCH v13 14/17] drm/exynos: exynos_dp: " Damon Ding
` (4 more replies)
2026-04-09 12:25 ` (subset) [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
14 siblings, 5 replies; 44+ messages in thread
From: Damon Ding @ 2026-04-09 7:19 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Apply analogix_dp_finish_probe() in order to move the panel/bridge
parsing from Rockchip side to the Analogix side.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v4:
- Rename analogix_dp_find_panel_or_bridge() to
analogix_dp_finish_probe().
Changes in v5:
- Remove DRM_DISPLAY_DP_AUX_BUS for ROCKCHIP_ANALOGIX_DP
Changes in v9:
- Add Tested-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 38 +------------------
1 file changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 99e739f4f583..eea230f0227a 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -21,14 +21,12 @@
#include <video/of_videomode.h>
#include <video/videomode.h>
-#include <drm/display/drm_dp_aux_bus.h>
#include <drm/display/drm_dp_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge_connector.h>
#include <drm/bridge/analogix_dp.h>
#include <drm/drm_of.h>
-#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
@@ -417,24 +415,6 @@ static const struct component_ops rockchip_dp_component_ops = {
.unbind = rockchip_dp_unbind,
};
-static int rockchip_dp_link_panel(struct drm_dp_aux *aux)
-{
- struct analogix_dp_plat_data *plat_data = analogix_dp_aux_to_plat_data(aux);
- struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
- int ret;
-
- /*
- * If drm_of_find_panel_or_bridge() returns -ENODEV, there may be no valid panel
- * or bridge nodes. The driver should go on for the driver-free bridge or the DP
- * mode applications.
- */
- ret = drm_of_find_panel_or_bridge(dp->dev->of_node, 1, 0, &plat_data->panel, NULL);
- if (ret && ret != -ENODEV)
- return ret;
-
- return component_add(dp->dev, &rockchip_dp_component_ops);
-}
-
static int rockchip_dp_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -475,6 +455,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
dp->plat_data.dev_type = dp->data->chip_type;
dp->plat_data.power_on = rockchip_dp_poweron;
dp->plat_data.power_off = rockchip_dp_powerdown;
+ dp->plat_data.ops = &rockchip_dp_component_ops;
ret = rockchip_dp_of_probe(dp);
if (ret < 0)
@@ -486,22 +467,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- ret = devm_of_dp_aux_populate_bus(analogix_dp_get_aux(dp->adp), rockchip_dp_link_panel);
- if (ret) {
- /*
- * If devm_of_dp_aux_populate_bus() returns -ENODEV, the done_probing() will not
- * be called because there are no EP devices. Then the rockchip_dp_link_panel()
- * will be called directly in order to support the other valid DT configurations.
- *
- * NOTE: The devm_of_dp_aux_populate_bus() is allowed to return -EPROBE_DEFER.
- */
- if (ret != -ENODEV)
- return dev_err_probe(dp->dev, ret, "failed to populate aux bus\n");
-
- return rockchip_dp_link_panel(analogix_dp_get_aux(dp->adp));
- }
-
- return 0;
+ return analogix_dp_finish_probe(dp->adp);
}
static void rockchip_dp_remove(struct platform_device *pdev)
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 14/17] drm/exynos: exynos_dp: Apply analogix_dp_finish_probe()
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
@ 2026-04-09 7:19 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 15/17] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach() Damon Ding
` (3 subsequent siblings)
4 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 7:19 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Apply analogix_dp_finish_probe() in order to move the panel/bridge
parsing from Exynos side to the Analogix side.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v4:
- Rename analogix_dp_find_panel_or_bridge() to
analogix_dp_finish_probe().
Changes in v7:
- Remove exynos_dp_legacy_bridge_init() and inline API
devm_drm_of_display_mode_bridge().
- If the panel or the next_bridge is parsed from DT, use ptr validity
to check whether to call component_add() directly at the end of
probing.
Changes in v9:
- Add Tested-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/exynos/exynos_dp.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index b2597fafd73d..9f3d4d4c7352 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -158,9 +158,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np;
struct exynos_dp_device *dp;
- struct drm_panel *panel;
- struct drm_bridge *bridge;
- int ret;
dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device),
GFP_KERNEL);
@@ -187,30 +184,30 @@ static int exynos_dp_probe(struct platform_device *pdev)
goto out;
}
- ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, &bridge);
- if (ret == -ENODEV) {
+ if (of_get_display_timings(dev->of_node)) {
dp->plat_data.next_bridge = devm_drm_of_display_mode_bridge(dp->dev,
dp->dev->of_node,
DRM_MODE_CONNECTOR_eDP);
- ret = IS_ERR(dp->plat_data.next_bridge) ? PTR_ERR(dp->plat_data.next_bridge) : 0;
+ if (IS_ERR(dp->plat_data.next_bridge))
+ return PTR_ERR(dp->plat_data.next_bridge);
}
- if (ret)
- return ret;
/* The remote port can be either a panel or a bridge */
- dp->plat_data.panel = panel;
- dp->plat_data.next_bridge = bridge;
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
dp->plat_data.attach = exynos_dp_bridge_attach;
+ dp->plat_data.ops = &exynos_dp_ops;
out:
dp->adp = analogix_dp_probe(dev, &dp->plat_data);
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- return component_add(&pdev->dev, &exynos_dp_ops);
+ if (dp->plat_data.panel || dp->plat_data.next_bridge)
+ return component_add(&pdev->dev, &exynos_dp_ops);
+ else
+ return analogix_dp_finish_probe(dp->adp);
}
static void exynos_dp_remove(struct platform_device *pdev)
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 15/17] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach()
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
2026-04-09 7:19 ` [PATCH v13 14/17] drm/exynos: exynos_dp: " Damon Ding
@ 2026-04-09 7:19 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 16/17] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
` (2 subsequent siblings)
4 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 7:19 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Uniformly, move the next bridge attachment to the Analogix side
rather than scattered on Rockchip and Exynos sides. It can also
help get rid of the callback &analogix_dp_plat_data.attach() and
make codes more concise.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v6:
- Move the next bridge attachment to the Analogix side rather than
scattered on Rockchip and Exynos sides.
Changes in v9:
- Add Tested-by tag.
Changes in v11:
- Add Reviewed-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 7 ++++---
drivers/gpu/drm/exynos/exynos_dp.c | 19 -------------------
include/drm/bridge/analogix_dp.h | 1 -
3 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 17d078b836e3..3daf72aa643e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -930,10 +930,11 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (dp->plat_data->attach) {
- ret = dp->plat_data->attach(dp->plat_data, bridge);
+ if (dp->plat_data->next_bridge) {
+ ret = drm_bridge_attach(dp->encoder, dp->plat_data->next_bridge, bridge,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
- DRM_ERROR("Failed at platform attach func\n");
+ dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
return ret;
}
}
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 9f3d4d4c7352..6884ea6d04eb 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -68,24 +68,6 @@ static int exynos_dp_poweroff(struct analogix_dp_plat_data *plat_data)
return exynos_dp_crtc_clock_enable(plat_data, false);
}
-static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
- struct drm_bridge *bridge)
-{
- struct exynos_dp_device *dp = to_dp(plat_data);
- enum drm_bridge_attach_flags flags = 0;
- int ret;
-
- /* Pre-empt DP connector creation if there's a bridge */
- if (plat_data->next_bridge) {
- ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge,
- flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR);
- if (ret)
- return ret;
- }
-
- return 0;
-}
-
static void exynos_dp_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
@@ -196,7 +178,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
- dp->plat_data.attach = exynos_dp_bridge_attach;
dp->plat_data.ops = &exynos_dp_ops;
out:
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index bae969dec63a..854af692229b 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -34,7 +34,6 @@ struct analogix_dp_plat_data {
int (*power_on)(struct analogix_dp_plat_data *);
int (*power_off)(struct analogix_dp_plat_data *);
- int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *);
};
int analogix_dp_resume(struct analogix_dp_device *dp);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 16/17] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind()
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
2026-04-09 7:19 ` [PATCH v13 14/17] drm/exynos: exynos_dp: " Damon Ding
2026-04-09 7:19 ` [PATCH v13 15/17] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach() Damon Ding
@ 2026-04-09 7:19 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2026-04-12 1:37 ` Claude review: drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Claude Code Review Bot
4 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 7:19 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
The analogix_dp_unbind() should be balanced with analogix_dp_bind().
There are no bridge enabling and panel preparing in analogix_dp_bind(),
so it should be reasonable to remove the bridge disabing and panel
unpreparing in analogix_dp_unbind().
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v9:
- Add Tested-by tag.
Changes in v11:
- Add Reviewed-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 3daf72aa643e..7d30e4184a80 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1526,10 +1526,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
- analogix_dp_bridge_disable(&dp->bridge);
-
- drm_panel_unprepare(dp->plat_data->panel);
-
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v13 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
` (2 preceding siblings ...)
2026-04-09 7:19 ` [PATCH v13 16/17] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
@ 2026-04-09 7:19 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-12 1:37 ` Claude review: drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Claude Code Review Bot
4 siblings, 1 reply; 44+ messages in thread
From: Damon Ding @ 2026-04-09 7:19 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, luca.ceresoli, nicolas.frattaroli,
dianders, m.szyprowski, linux-kernel, dri-devel, imx,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
In order to unify the handling of the panel and bridge, apply
panel_bridge helpers for Analogix DP driver. With this patch, the
bridge support will also become available.
The following changes have ben made:
- Apply plane_bridge helper to wrap the panel as the bridge.
- Remove the explicit panel APIs calls, which can be replaced with
the automic bridge APIs calls wrapped by the panel.
- Remove the unnecessary analogix_dp_bridge_get_modes().
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
---
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge.
Changes in v5:
- Move panel_bridge addition a little forward.
- Move next_bridge attachment from Analogix side to Rockchip/Exynos
side.
Changes in v6
- Remove the unnecessary analogix_dp_bridge_get_modes().
- Not to set DRM_BRIDGE_OP_MODES if the next is a panel.
- Squash [PATCH v5 15/17]drm/bridge: analogix_dp: Remove panel
disabling and enabling in analogix_dp_set_bridge() into this
commit.
- Fix the &drm_bridge->ops to DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT.
Changes in v9:
- Add Tested-by tag.
Changes in v13:
- Modify '(on rk3588)' to '# rk3588' for Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 41 +++++--------------
1 file changed, 11 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 7d30e4184a80..fb6b8aaa353b 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -749,9 +749,6 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
{
int ret;
- /* Keep the panel disabled while we configure video */
- drm_panel_disable(dp->plat_data->panel);
-
ret = analogix_dp_train_link(dp);
if (ret) {
dev_err(dp->dev, "unable to do link train, ret=%d\n", ret);
@@ -771,9 +768,6 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
return ret;
}
- /* Safe to enable the panel now */
- drm_panel_enable(dp->plat_data->panel);
-
/* Check whether panel supports fast training */
ret = analogix_dp_fast_link_train_detection(dp);
if (ret)
@@ -858,17 +852,6 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)
return analogix_dp_send_psr_spd(dp, &psr_vsc, true);
}
-static int analogix_dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector)
-{
- struct analogix_dp_device *dp = to_dp(bridge);
- int num_modes = 0;
-
- if (dp->plat_data->panel)
- num_modes += drm_panel_get_modes(dp->plat_data->panel, connector);
-
- return num_modes;
-}
-
static const struct drm_edid *analogix_dp_bridge_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector)
{
@@ -909,7 +892,7 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->plat_data->panel || dp->plat_data->next_bridge)
+ if (dp->plat_data->next_bridge)
return connector_status_connected;
if (!analogix_dp_detect_hpd(dp))
@@ -995,8 +978,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,
/* Don't touch the panel if we're coming back from PSR */
if (old_crtc_state && old_crtc_state->self_refresh_active)
return;
-
- drm_panel_prepare(dp->plat_data->panel);
}
static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
@@ -1168,16 +1149,12 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
return;
- drm_panel_disable(dp->plat_data->panel);
-
disable_irq(dp->irq);
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
pm_runtime_put_sync(dp->dev);
- drm_panel_unprepare(dp->plat_data->panel);
-
dp->fast_train_enable = false;
dp->psr_supported = false;
dp->dpms_mode = DRM_MODE_DPMS_OFF;
@@ -1252,7 +1229,6 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_post_disable = analogix_dp_bridge_atomic_post_disable,
.atomic_check = analogix_dp_bridge_atomic_check,
.attach = analogix_dp_bridge_attach,
- .get_modes = analogix_dp_bridge_get_modes,
.edid_read = analogix_dp_bridge_edid_read,
.detect = analogix_dp_bridge_detect,
};
@@ -1498,17 +1474,22 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
return ret;
}
- if (dp->plat_data->panel)
- bridge->ops = DRM_BRIDGE_OP_MODES | DRM_BRIDGE_OP_DETECT;
- else
- bridge->ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
-
+ bridge->ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
bridge->of_node = dp->dev->of_node;
bridge->type = DRM_MODE_CONNECTOR_eDP;
ret = devm_drm_bridge_add(dp->dev, &dp->bridge);
if (ret)
goto err_unregister_aux;
+ if (dp->plat_data->panel) {
+ dp->plat_data->next_bridge = devm_drm_panel_bridge_add(dp->dev,
+ dp->plat_data->panel);
+ if (IS_ERR(dp->plat_data->next_bridge)) {
+ ret = PTR_ERR(bridge);
+ goto err_unregister_aux;
+ }
+ }
+
ret = drm_bridge_attach(dp->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
DRM_ERROR("failed to create bridge (%d)\n", ret);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* Re: (subset) [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (12 preceding siblings ...)
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
@ 2026-04-09 12:25 ` Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
14 siblings, 0 replies; 44+ messages in thread
From: Luca Ceresoli @ 2026-04-09 12:25 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, nicolas.frattaroli, dianders,
m.szyprowski, linux-kernel, dri-devel, imx, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
On Thu, 09 Apr 2026 14:52:44 +0800, Damon Ding wrote:
> PATCH 1 is to add a new parameter to store the point of next bridge.
> PATCH 2 is to make legacy bridge driver more universal.
> PATCH 3-10 are preparations for apply drm_bridge_connector helper.
> PATCH 11 is to apply the drm_bridge_connector helper.
> PATCH 12-14 are to move the panel/bridge parsing to the Analogix side.
> PATCH 15 is to attach the next bridge on Analogix side uniformly.
> PATCH 16-17 are to apply the panel_bridge helper.
>
> [...]
Applied, thanks!
[01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge
commit: d842ed8f3417d848046eea2c40de78a1993eb3df
[02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
commit: ba2db93cf3d569a4525a02cd0ed5ec5f979e3afd
[03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
commit: e123c3c5212200c8c443fe0804e7dfc8e9d5986e
[04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector
commit: af917a1b95c2b7e58021b4bbe22355323362bbf8
[05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node
commit: 1b7cee81d8147d341c0240fcc9cbd129b95c0043
[06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
commit: 312a86806b742dfd6fc543d8ec02ab15ee68c1a2
[07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
commit: d3bdde2e0c123ef406be81d1378749362a1ecb30
[08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes()
commit: 4226b19edf240b054fc979557533c4a8c47a5535
[09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach()
commit: b943aefce6ad0c6119cacd6adcc67225b2699e7f
Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set()
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
@ 2026-04-09 21:02 ` Dmitry Baryshkov
2026-04-10 7:45 ` Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2 siblings, 0 replies; 44+ messages in thread
From: Dmitry Baryshkov @ 2026-04-09 21:02 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan, Laurent.pinchart, jonas,
jernej.skrabec, kernel, festevam, alim.akhtar, luca.ceresoli,
nicolas.frattaroli, dianders, m.szyprowski, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Thu, Apr 09, 2026 at 02:52:54PM +0800, Damon Ding wrote:
> To avoid using &analogix_dp_device.connector for compatibility
> with the bridge connector framework, get &drm_connector from
> &drm_atomic_state instead.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> ---
> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
@ 2026-04-09 21:06 ` Dmitry Baryshkov
2026-04-10 7:41 ` Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2 siblings, 0 replies; 44+ messages in thread
From: Dmitry Baryshkov @ 2026-04-09 21:06 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, maarten.lankhorst, mripard,
tzimmermann, airlied, simona, victor.liu, Frank.Li, shawnguo,
s.hauer, inki.dae, sw0312.kim, kyungmin.park, krzk, jingoohan1,
p.zabel, hjc, heiko, andy.yan, Laurent.pinchart, jonas,
jernej.skrabec, kernel, festevam, alim.akhtar, luca.ceresoli,
nicolas.frattaroli, dianders, m.szyprowski, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Thu, Apr 09, 2026 at 02:52:55PM +0800, Damon Ding wrote:
> Initialize bridge_connector for both Rockchip and Exynos encoder sides.
> Then, make DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory for Analogix bridge
> side, as the private &drm_connector is no longer created.
>
> The previous &drm_connector_funcs and &drm_connector_helper_funcs APIs
> are replaced by the corresponding &drm_bridge_funcs APIs:
>
> analogix_dp_atomic_check() -> analogix_dp_bridge_atomic_check()
> analogix_dp_detect() -> analogix_dp_bridge_detect()
> analogix_dp_get_modes() -> analogix_dp_bridge_get_modes()
> analogix_dp_bridge_edid_read()
>
> Additionally, the compatibilities of Analogix DP bridge based on whether
> the next bridge is a 'panel'. If it is, OP_MODES and OP_DETECT are
> supported; If not (the next bridge is a 'monitor' or a bridge chip),
> OP_EDID and OP_DETECT are supported.
>
> The devm_drm_bridge_add() is placed in analogix_dp_bind() instead of
> analogix_dp_probe(), because the type of next bridge (the panel, monitor
> or bridge chip) can only be determined after the probe process has fully
> completed.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2026-04-09 21:06 ` Dmitry Baryshkov
@ 2026-04-10 7:41 ` Luca Ceresoli
2026-04-10 8:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2 siblings, 1 reply; 44+ messages in thread
From: Luca Ceresoli @ 2026-04-10 7:41 UTC (permalink / raw)
To: Damon Ding, andrzej.hajda, neil.armstrong, rfoss,
maarten.lankhorst, mripard, tzimmermann, airlied, simona,
victor.liu, Frank.Li, shawnguo, s.hauer, inki.dae, sw0312.kim,
kyungmin.park, krzk, jingoohan1, p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, nicolas.frattaroli, dianders,
m.szyprowski, linux-kernel, dri-devel, imx, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
Hello Damon,
On Thu Apr 9, 2026 at 8:52 AM CEST, Damon Ding wrote:
> Initialize bridge_connector for both Rockchip and Exynos encoder sides.
> Then, make DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory for Analogix bridge
> side, as the private &drm_connector is no longer created.
>
> The previous &drm_connector_funcs and &drm_connector_helper_funcs APIs
> are replaced by the corresponding &drm_bridge_funcs APIs:
>
> analogix_dp_atomic_check() -> analogix_dp_bridge_atomic_check()
> analogix_dp_detect() -> analogix_dp_bridge_detect()
> analogix_dp_get_modes() -> analogix_dp_bridge_get_modes()
> analogix_dp_bridge_edid_read()
>
> Additionally, the compatibilities of Analogix DP bridge based on whether
> the next bridge is a 'panel'. If it is, OP_MODES and OP_DETECT are
> supported; If not (the next bridge is a 'monitor' or a bridge chip),
> OP_EDID and OP_DETECT are supported.
>
> The devm_drm_bridge_add() is placed in analogix_dp_bind() instead of
> analogix_dp_probe(), because the type of next bridge (the panel, monitor
> or bridge chip) can only be determined after the probe process has fully
> completed.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
I noticed two issues, sorry I haven't catched them before...
> @@ -1580,7 +1533,8 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind);
>
> int analogix_dp_start_crc(struct drm_connector *connector)
> {
> - struct analogix_dp_device *dp = to_dp(connector);
> + struct analogix_dp_device *dp;
> + struct drm_bridge *bridge;
>
> if (!connector->state->crtc) {
> DRM_ERROR("Connector %s doesn't currently have a CRTC.\n",
> @@ -1588,13 +1542,26 @@ int analogix_dp_start_crc(struct drm_connector *connector)
> return -EINVAL;
> }
>
> + bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
> + if (bridge->type != DRM_MODE_CONNECTOR_eDP)
> + return -EINVAL;
> +
> + dp = to_dp(bridge);
> +
> return drm_dp_start_crc(&dp->aux, connector->state->crtc);
> }
drm_bridge_chain_get_first_bridge() takes a reference, you must call
drm_bridge_put(bridge) before returning. Given there are two return paths I
suggest:
- struct drm_bridge *bridge;
- bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
+ struct drm_bridge *bridge __free(drm_bridge_put) =
+ drm_bridge_chain_get_first_bridge(connector->encoder);
> EXPORT_SYMBOL_GPL(analogix_dp_start_crc);
>
> int analogix_dp_stop_crc(struct drm_connector *connector)
> {
> - struct analogix_dp_device *dp = to_dp(connector);
> + struct analogix_dp_device *dp;
> + struct drm_bridge *bridge;
> +
> + bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
> + if (bridge->type != DRM_MODE_CONNECTOR_eDP)
> + return -EINVAL;
> +
> + dp = to_dp(bridge);
>
> return drm_dp_stop_crc(&dp->aux);
> }
Same here:
- struct drm_bridge *bridge;
- bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
+ struct drm_bridge *bridge __free(drm-bridge_put) =
+ drm_bridge_chain_get_first_bridge(connector->encoder);
With the above two changes you can add to v14:
+Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set()
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
2026-04-09 21:02 ` Dmitry Baryshkov
@ 2026-04-10 7:45 ` Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2 siblings, 0 replies; 44+ messages in thread
From: Luca Ceresoli @ 2026-04-10 7:45 UTC (permalink / raw)
To: Damon Ding, andrzej.hajda, neil.armstrong, rfoss,
maarten.lankhorst, mripard, tzimmermann, airlied, simona,
victor.liu, Frank.Li, shawnguo, s.hauer, inki.dae, sw0312.kim,
kyungmin.park, krzk, jingoohan1, p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, nicolas.frattaroli, dianders,
m.szyprowski, linux-kernel, dri-devel, imx, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
On Thu Apr 9, 2026 at 8:52 AM CEST, Damon Ding wrote:
> To avoid using &analogix_dp_device.connector for compatibility
> with the bridge connector framework, get &drm_connector from
> &drm_atomic_state instead.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2026-04-10 7:41 ` Luca Ceresoli
@ 2026-04-10 8:52 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-04-10 8:52 UTC (permalink / raw)
To: Luca Ceresoli, andrzej.hajda, neil.armstrong, rfoss,
maarten.lankhorst, mripard, tzimmermann, airlied, simona,
victor.liu, Frank.Li, shawnguo, s.hauer, inki.dae, sw0312.kim,
kyungmin.park, krzk, jingoohan1, p.zabel, hjc, heiko, andy.yan
Cc: Laurent.pinchart, jonas, jernej.skrabec, kernel, festevam,
alim.akhtar, dmitry.baryshkov, nicolas.frattaroli, dianders,
m.szyprowski, linux-kernel, dri-devel, imx, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
Hi Luca,
On 4/10/2026 3:41 PM, Luca Ceresoli wrote:
> Hello Damon,
>
> On Thu Apr 9, 2026 at 8:52 AM CEST, Damon Ding wrote:
>> Initialize bridge_connector for both Rockchip and Exynos encoder sides.
>> Then, make DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory for Analogix bridge
>> side, as the private &drm_connector is no longer created.
>>
>> The previous &drm_connector_funcs and &drm_connector_helper_funcs APIs
>> are replaced by the corresponding &drm_bridge_funcs APIs:
>>
>> analogix_dp_atomic_check() -> analogix_dp_bridge_atomic_check()
>> analogix_dp_detect() -> analogix_dp_bridge_detect()
>> analogix_dp_get_modes() -> analogix_dp_bridge_get_modes()
>> analogix_dp_bridge_edid_read()
>>
>> Additionally, the compatibilities of Analogix DP bridge based on whether
>> the next bridge is a 'panel'. If it is, OP_MODES and OP_DETECT are
>> supported; If not (the next bridge is a 'monitor' or a bridge chip),
>> OP_EDID and OP_DETECT are supported.
>>
>> The devm_drm_bridge_add() is placed in analogix_dp_bind() instead of
>> analogix_dp_probe(), because the type of next bridge (the panel, monitor
>> or bridge chip) can only be determined after the probe process has fully
>> completed.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588
>
> I noticed two issues, sorry I haven't catched them before...
>
>> @@ -1580,7 +1533,8 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind);
>>
>> int analogix_dp_start_crc(struct drm_connector *connector)
>> {
>> - struct analogix_dp_device *dp = to_dp(connector);
>> + struct analogix_dp_device *dp;
>> + struct drm_bridge *bridge;
>>
>> if (!connector->state->crtc) {
>> DRM_ERROR("Connector %s doesn't currently have a CRTC.\n",
>> @@ -1588,13 +1542,26 @@ int analogix_dp_start_crc(struct drm_connector *connector)
>> return -EINVAL;
>> }
>>
>> + bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
>> + if (bridge->type != DRM_MODE_CONNECTOR_eDP)
>> + return -EINVAL;
>> +
>> + dp = to_dp(bridge);
>> +
>> return drm_dp_start_crc(&dp->aux, connector->state->crtc);
>> }
>
> drm_bridge_chain_get_first_bridge() takes a reference, you must call
> drm_bridge_put(bridge) before returning. Given there are two return paths I
> suggest:
>
> - struct drm_bridge *bridge;
>
> - bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
> + struct drm_bridge *bridge __free(drm_bridge_put) =
> + drm_bridge_chain_get_first_bridge(connector->encoder);
>
>> EXPORT_SYMBOL_GPL(analogix_dp_start_crc);
>>
>> int analogix_dp_stop_crc(struct drm_connector *connector)
>> {
>> - struct analogix_dp_device *dp = to_dp(connector);
>> + struct analogix_dp_device *dp;
>> + struct drm_bridge *bridge;
>> +
>> + bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
>> + if (bridge->type != DRM_MODE_CONNECTOR_eDP)
>> + return -EINVAL;
>> +
>> + dp = to_dp(bridge);
>>
>> return drm_dp_stop_crc(&dp->aux);
>> }
>
> Same here:
>
> - struct drm_bridge *bridge;
>
> - bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
> + struct drm_bridge *bridge __free(drm-bridge_put) =
> + drm_bridge_chain_get_first_bridge(connector->encoder);
>
> With the above two changes you can add to v14:
>
> +Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
>
Ah, your previous commit added this nice reference handling. Thanks for
the kind review.
I'll fix it in v14.
Best regards,
Damon
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (13 preceding siblings ...)
2026-04-09 12:25 ` (subset) [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Luca Ceresoli
@ 2026-04-12 1:37 ` Claude Code Review Bot
14 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
Author: Damon Ding <damon.ding@rock-chips.com>
Patches: 24
Reviewed: 2026-04-12T11:37:38.684157
---
This is a well-structured v13 series (17 patches) that modernizes the Analogix DP bridge driver by:
1. Adopting the `drm_bridge_connector` helper (replacing the private `drm_connector`)
2. Adopting the `panel_bridge` helper (wrapping panels as bridges for uniform handling)
3. Moving panel/bridge parsing from platform drivers (Rockchip/Exynos) into the common Analogix code via `analogix_dp_finish_probe()`
4. Refactoring the IMX legacy bridge into a generic `of-display-mode-bridge` for multi-platform use
The series is at v13, has been well-reviewed (Reviewed-by from Dmitry Baryshkov and Luca Ceresoli, Tested-by from Marek Szyprowski and Heiko Stuebner), and the incremental cleanups are logically ordered. The overall approach is correct and aligns with modern DRM bridge best practices.
**One real bug** exists in patch 17 (wrong variable in `PTR_ERR()`). The rest of the series is clean.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge
2026-04-09 6:52 ` [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Trivial one-liner adding `struct drm_bridge *next_bridge` to the platform data struct. Clean and correct. Has Reviewed-by and Tested-by tags.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
2026-04-09 6:52 ` [PATCH v13 02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Moves `imx-legacy-bridge.c` to `of-display-mode-bridge.c` at the top-level bridge directory, renames all structs/functions accordingly, updates Kconfig/Makefile, and changes consumers (`imx-ldb.c`, `parallel-display.c`). The new header `of-display-mode-bridge.h` replaces `imx.h`.
The rename is clean and mechanical. The new driver is functionally identical to the old one. The Kconfig change from `DRM_IMX_LEGACY_BRIDGE` to `DRM_OF_DISPLAY_MODE_BRIDGE` is correct in all consumers.
Minor note: `of_display_mode_bridge_funcs` should probably be `static const` (it was already non-static non-const in the original, so this isn't a regression):
```c
struct drm_bridge_funcs of_display_mode_bridge_funcs = {
```
No blocking issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
2026-04-09 6:52 ` [PATCH v13 03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces uses of `dp->ptn_bridge` with `plat_data->next_bridge` (which was just added in patch 1), and removes the member. Clean and correct.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector
2026-04-09 6:52 ` [PATCH v13 04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes the `connector` member from `exynos_dp_device` and the assignment `dp->connector = connector` since the value is never read. Correct dead-code removal.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node
2026-04-09 6:52 ` [PATCH v13 05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces the Exynos-specific `exynos_dp_get_modes()` / `exynos_dp_dt_parse_panel()` with the generic `devm_drm_of_display_mode_bridge()` helper from patch 2. This removes the `struct videomode vm` member and the manual `drm_display_mode_from_videomode()` flow.
Introduces `dp->has_of_bridge` as a temporary flag (removed later in patch 11). The flag is used to conditionally set `DRM_BRIDGE_ATTACH_NO_CONNECTOR` only for the of-display-mode-bridge, since at this point the driver still creates its own connector for non-bridge paths.
The transition logic is sound. One minor observation: the `dp->plat_data.get_modes` assignment is removed here, but the `get_modes` callback in analogix_dp_core still exists at this point (removed in patch 8). The Exynos `get_modes` just returned 0 for panel paths anyway, so this doesn't cause functional issues.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
2026-04-09 6:52 ` [PATCH v13 06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces `!dp->plat_data->skip_connector` with `!dp->plat_data->next_bridge` in `analogix_dp_bridge_attach()`. The semantic is equivalent since `skip_connector` was set to `!!bridge`. Removes the `skip_connector` member and the Exynos assignment.
Clean and correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
2026-04-09 6:52 ` [PATCH v13 07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Moves the YUV-to-RGB color format fixup from `rockchip_dp_get_modes()` into `analogix_dp_atomic_check()`, gated by `is_rockchip()`. This makes the check run at atomic_check time rather than get_modes time, which is architecturally more appropriate.
One minor concern: modifying `display_info` (which lives on the connector, not in state) from `atomic_check` is a bit unusual. The `display_info` is typically populated during EDID parsing and is not per-state. However, this pattern was already present in the original code (just in `get_modes()` instead), so this isn't a regression. The bridge `atomic_check` in patch 11 continues this approach.
No blocking issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes()
2026-04-09 6:52 ` [PATCH v13 08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
After patches 5 and 7 removed all implementations of the `get_modes` callback, this patch removes the callback pointer from the struct and its invocation in `analogix_dp_get_modes()`.
Clean dead-code removal.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach()
2026-04-09 6:52 ` [PATCH v13 09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach() Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes the unused `struct drm_connector *` parameter from the `attach` callback. Updates the Analogix caller and Exynos implementation.
Clean signature simplification.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set()
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
2026-04-09 21:02 ` Dmitry Baryshkov
2026-04-10 7:45 ` Luca Ceresoli
@ 2026-04-12 1:37 ` Claude Code Review Bot
2 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `struct drm_atomic_state *state` parameter to `analogix_dp_bridge_mode_set()` and uses `drm_atomic_get_new_connector_for_encoder()` to obtain the connector, replacing the direct `dp->connector.display_info` access. This is necessary preparation for removing the private connector in patch 11.
The `connector` NULL check with early return is appropriate - if no connector is found, silently returning is safe since the bridge isn't connected.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2026-04-09 21:06 ` Dmitry Baryshkov
2026-04-10 7:41 ` Luca Ceresoli
@ 2026-04-12 1:37 ` Claude Code Review Bot
2 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
This is the core patch of the series. Key changes:
- **Removes the private `dp->connector`** from `analogix_dp_device`.
- **Converts connector funcs to bridge funcs**: `analogix_dp_get_modes()` -> `analogix_dp_bridge_get_modes()`, `analogix_dp_detect()` -> `analogix_dp_bridge_detect()`, `analogix_dp_atomic_check()` -> `analogix_dp_bridge_atomic_check()`.
- **Inverts the `DRM_BRIDGE_ATTACH_NO_CONNECTOR` logic** - now it's mandatory (required), not forbidden.
- **Adds `devm_drm_bridge_add()`** in `analogix_dp_bind()` instead of probe time.
- **Creates bridge_connector** on both Rockchip and Exynos sides.
- **Reworks CRC functions** (`analogix_dp_start_crc`/`analogix_dp_stop_crc`) to get the dp device from the bridge chain rather than container_of on the connector.
The CRC function rework deserves attention:
```c
bridge = drm_bridge_chain_get_first_bridge(connector->encoder);
if (bridge->type != DRM_MODE_CONNECTOR_eDP)
return -EINVAL;
dp = to_dp(bridge);
```
This correctly uses the bridge chain to find the analogix dp device, since the connector is now a bridge_connector and not directly embedded in `analogix_dp_device`. The `bridge->type` check is a reasonable guard.
The `analogix_dp_bridge_detect()` correctly returns `connector_status_connected` for both panel and next_bridge cases.
The bridge ops are set based on whether there's a panel or not:
```c
if (dp->plat_data->panel)
bridge->ops = DRM_BRIDGE_OP_MODES | DRM_BRIDGE_OP_DETECT;
else
bridge->ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
```
This is correct: panels provide modes (via `get_modes`), while monitors provide EDID.
On the Exynos side, the error path for `analogix_dp_bind()` failure changes - it now returns immediately rather than falling through to `return ret`. This is a correction since the old code would always call `dp->encoder.funcs->destroy()` and then return `ret`, but if `ret == 0` it would still destroy the encoder. The new code only destroys the encoder on failure and returns immediately on success to proceed with bridge_connector init.
No blocking issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe()
2026-04-09 6:52 ` [PATCH v13 12/17] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `analogix_dp_finish_probe()` which handles DP AUX bus population and panel/bridge parsing centrally. The key flow:
1. `devm_of_dp_aux_populate_bus()` is called with `analogix_dp_aux_done_probing` callback
2. If it returns `-ENODEV` (no EP devices), the callback is invoked directly
3. The callback does `drm_of_find_panel_or_bridge()` and then `component_add()`
The `plat_data->ops` field is added to pass `component_ops` since the AUX bus callback only receives `drm_dp_aux`.
The port number for `drm_of_find_panel_or_bridge()` is correctly differentiated:
```c
int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
```
Also selects `DRM_DISPLAY_DP_AUX_BUS` for `DRM_ANALOGIX_DP` in Kconfig.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe()
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
` (3 preceding siblings ...)
2026-04-09 7:19 ` [PATCH v13 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
4 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces the Rockchip-specific `rockchip_dp_link_panel()` and the manual `devm_of_dp_aux_populate_bus()` flow with a single call to `analogix_dp_finish_probe()`. Clean simplification that removes ~30 lines of duplicated logic.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/exynos: exynos_dp: Apply analogix_dp_finish_probe()
2026-04-09 7:19 ` [PATCH v13 14/17] drm/exynos: exynos_dp: " Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Applies `analogix_dp_finish_probe()` on the Exynos side. The probe logic now:
- Uses `of_get_display_timings()` to check for display-timings DT node
- If present, creates an of-display-mode-bridge and stores it in `next_bridge`
- If panel/bridge was already discovered, calls `component_add()` directly
- Otherwise, delegates to `analogix_dp_finish_probe()` for AUX bus probing
The logic `if (dp->plat_data.panel || dp->plat_data.next_bridge)` determining whether to call `component_add()` directly vs `analogix_dp_finish_probe()` is correct: if we already know the downstream device, skip the AUX bus probing.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach()
2026-04-09 7:19 ` [PATCH v13 15/17] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach() Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Moves the next bridge attachment from the per-platform `attach()` callbacks into `analogix_dp_bridge_attach()`. This removes the `attach` callback entirely from `analogix_dp_plat_data`.
The Exynos `exynos_dp_bridge_attach()` function is removed entirely. On the Analogix side, `drm_bridge_attach()` is called with `DRM_BRIDGE_ATTACH_NO_CONNECTOR` for the next bridge.
Clean centralization of bridge attachment logic.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind()
2026-04-09 7:19 ` [PATCH v13 16/17] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes `analogix_dp_bridge_disable()` and `drm_panel_unprepare()` calls from `analogix_dp_unbind()`. The rationale is that unbind should be symmetric with bind, and bind doesn't enable/prepare. The framework should handle disable/unprepare during the normal atomic shutdown path before unbind is called.
This is correct - the DRM framework ensures the display pipeline is disabled before component unbind.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
* Claude review: drm/bridge: analogix_dp: Apply panel_bridge helper
2026-04-09 7:19 ` [PATCH v13 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2026-04-12 1:37 ` Claude Code Review Bot
0 siblings, 0 replies; 44+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 1:37 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Bug found**: In `analogix_dp_bind()`:
```c
if (dp->plat_data->panel) {
dp->plat_data->next_bridge = devm_drm_panel_bridge_add(dp->dev,
dp->plat_data->panel);
if (IS_ERR(dp->plat_data->next_bridge)) {
ret = PTR_ERR(bridge); // BUG: should be PTR_ERR(dp->plat_data->next_bridge)
goto err_unregister_aux;
}
}
```
`bridge` here is the local variable `&dp->bridge`, which is a valid (non-error) pointer. This means `PTR_ERR(bridge)` will return a garbage non-error value (or 0), and the caller won't see the failure. This should be:
```c
ret = PTR_ERR(dp->plat_data->next_bridge);
```
Otherwise, the patch correctly:
- Wraps the panel with `devm_drm_panel_bridge_add()` to create a bridge
- Removes all explicit `drm_panel_prepare/enable/disable/unprepare` calls
- Removes `analogix_dp_bridge_get_modes()` (panel modes now come through the panel_bridge)
- Simplifies bridge ops to always be `DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT` (modes come from the panel_bridge's own ops)
- Updates `analogix_dp_bridge_detect()` to check `next_bridge` instead of `panel`
The minor typos in the commit message ("ben" -> "been", "plane_bridge" -> "panel_bridge", "automic" -> "atomic") should be fixed.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 44+ messages in thread
end of thread, other threads:[~2026-04-12 1:37 UTC | newest]
Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 6:52 [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2026-04-09 6:52 ` [PATCH v13 01/17] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 02/17] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 03/17] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 04/17] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 05/17] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 06/17] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 07/17] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 08/17] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 09/17] drm/bridge: analogix_dp: Remove unused struct drm_connector* for &analogix_dp_plat_data.attach() Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 10/17] drm/bridge: analogix_dp: Pass struct drm_atomic_state* for analogix_dp_bridge_mode_set() Damon Ding
2026-04-09 21:02 ` Dmitry Baryshkov
2026-04-10 7:45 ` Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2026-04-09 21:06 ` Dmitry Baryshkov
2026-04-10 7:41 ` Luca Ceresoli
2026-04-10 8:52 ` Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 6:52 ` [PATCH v13 12/17] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 13/17] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
2026-04-09 7:19 ` [PATCH v13 14/17] drm/exynos: exynos_dp: " Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 15/17] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach() Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 16/17] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-09 7:19 ` [PATCH v13 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
2026-04-12 1:37 ` Claude review: drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Claude Code Review Bot
2026-04-09 12:25 ` (subset) [PATCH v13 00/17] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Luca Ceresoli
2026-04-12 1:37 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-19 7:14 [PATCH v11 00/17] " Damon Ding
2026-03-19 7:47 ` [PATCH v11 17/17] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2026-03-21 18:35 ` Claude review: " Claude Code Review Bot
2026-02-10 7:12 [PATCH v9 00/15] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2026-02-10 9:10 ` [PATCH v9 15/15] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2026-02-11 6:37 ` Claude review: " Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox