* [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 01/18] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
` (14 more replies)
0 siblings, 15 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip, Damon Ding
PATCH 1 is a small format optimization for struct analogid_dp_device.
PATCH 2 is to perform mode setting in &drm_bridge_funcs.atomic_enable.
PATCH 3 is to add a new parameter to store the point of next bridge.
PATCH 4 is to make legacy bridge driver more universal.
PATCH 5-10 are preparations for apply drm_bridge_connector helper.
PATCH 11 is to ensure last bridge determines OP_EDID/OP_MODES capabilities.
PATCH 12 is to apply the drm_bridge_connector helper.
PATCH 13-15 are to move the panel/bridge parsing to the Analogix side.
PATCH 16 is to attach the next bridge on Analogix side uniformly.
PATCH 17-18 are to apply the panel_bridge helper.
Damon Ding (18):
drm/bridge: analogix_dp: Formalize the struct analogix_dp_device
drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to
&drm_bridge_funcs.atomic_enable
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 legacy 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/display: bridge_connector: Ensure last bridge determines
EDID/modes detection capabilities
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 | 395 +++++++++---------
.../drm/bridge/analogix/analogix_dp_core.h | 5 +-
drivers/gpu/drm/bridge/imx/Kconfig | 10 -
drivers/gpu/drm/bridge/imx/Makefile | 1 -
.../gpu/drm/bridge/imx/imx-legacy-bridge.c | 91 ----
drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++
.../gpu/drm/display/drm_bridge_connector.c | 42 ++
drivers/gpu/drm/exynos/Kconfig | 2 +
drivers/gpu/drm/exynos/exynos_dp.c | 117 ++----
drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
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/legacy-bridge.h | 18 +
20 files changed, 433 insertions(+), 466 deletions(-)
delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
delete mode 100644 include/drm/bridge/imx.h
create mode 100644 include/drm/bridge/legacy-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.
--
2.34.1
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v6 01/18] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 02/18] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable Damon Ding
` (13 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip, Damon Ding
Use the tap instead of the space for &analogix_dp_device.aux and
&analogix_dp_device.force_hpd.
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>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index b86e93f30ed6..91b215c6a0cf 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -156,7 +156,7 @@ struct analogix_dp_device {
struct drm_device *drm_dev;
struct drm_connector connector;
struct drm_bridge bridge;
- struct drm_dp_aux aux;
+ struct drm_dp_aux aux;
struct clk *clock;
unsigned int irq;
void __iomem *reg_base;
@@ -166,7 +166,7 @@ struct analogix_dp_device {
struct phy *phy;
int dpms_mode;
struct gpio_desc *hpd_gpiod;
- bool force_hpd;
+ bool force_hpd;
bool fast_train_enable;
bool psr_supported;
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v6 02/18] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-09-30 9:09 ` [PATCH v6 01/18] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 03/18] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
` (12 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip, Damon Ding
According to the include/drm/drm_bridge.h, the callback
&drm_bridge_funcs.mode_set is deprecated and it should be better to
include the mode setting in the &drm_bridge_funcs.atomic_enable instead.
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>
---
.../drm/bridge/analogix/analogix_dp_core.c | 161 +++++++++---------
1 file changed, 82 insertions(+), 79 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 1e834d3656c1..3caa47d31649 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1086,12 +1086,88 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
return ret;
}
+static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
+ 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;
+ int vic;
+
+ /* 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);
+ video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
+
+ /* Input video dynamic_range & colorimetry */
+ vic = drm_match_cea_mode(mode);
+ if ((vic == 6) || (vic == 7) || (vic == 21) || (vic == 22) ||
+ (vic == 2) || (vic == 3) || (vic == 17) || (vic == 18)) {
+ video->dynamic_range = CEA;
+ video->ycbcr_coeff = COLOR_YCBCR601;
+ } else if (vic) {
+ video->dynamic_range = CEA;
+ video->ycbcr_coeff = COLOR_YCBCR709;
+ } else {
+ video->dynamic_range = VESA;
+ video->ycbcr_coeff = COLOR_YCBCR709;
+ }
+
+ /* Input vide bpc and color_formats */
+ switch (display_info->bpc) {
+ case 12:
+ video->color_depth = COLOR_12;
+ break;
+ case 10:
+ video->color_depth = COLOR_10;
+ break;
+ case 8:
+ video->color_depth = COLOR_8;
+ break;
+ case 6:
+ video->color_depth = COLOR_6;
+ break;
+ default:
+ video->color_depth = COLOR_8;
+ break;
+ }
+ if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+ video->color_space = COLOR_YCBCR444;
+ else if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+ video->color_space = COLOR_YCBCR422;
+ else
+ video->color_space = COLOR_RGB;
+
+ /*
+ * NOTE: those property parsing code is used for providing backward
+ * compatibility for samsung platform.
+ * Due to we used the "of_property_read_u32" interfaces, when this
+ * property isn't present, the "video_info" can keep the original
+ * values and wouldn't be modified.
+ */
+ of_property_read_u32(dp_node, "samsung,color-space",
+ &video->color_space);
+ of_property_read_u32(dp_node, "samsung,dynamic-range",
+ &video->dynamic_range);
+ of_property_read_u32(dp_node, "samsung,ycbcr-coeff",
+ &video->ycbcr_coeff);
+ of_property_read_u32(dp_node, "samsung,color-depth",
+ &video->color_depth);
+ if (of_property_read_bool(dp_node, "hsync-active-high"))
+ video->h_sync_polarity = true;
+ if (of_property_read_bool(dp_node, "vsync-active-high"))
+ video->v_sync_polarity = true;
+ if (of_property_read_bool(dp_node, "interlaced"))
+ video->interlaced = true;
+}
+
static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,
struct drm_atomic_state *old_state)
{
struct analogix_dp_device *dp = to_dp(bridge);
struct drm_crtc *crtc;
- struct drm_crtc_state *old_crtc_state;
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
int timeout_loop = 0;
int ret;
@@ -1099,6 +1175,11 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,
if (!crtc)
return;
+ 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);
+
old_crtc_state = drm_atomic_get_old_crtc_state(old_state, crtc);
/* Not a full enable, just disable PSR and continue */
if (old_crtc_state && old_crtc_state->self_refresh_active) {
@@ -1205,83 +1286,6 @@ static void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge,
DRM_ERROR("Failed to enable psr (%d)\n", ret);
}
-static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
- const struct drm_display_mode *orig_mode,
- 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;
- int vic;
-
- /* 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);
- video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
-
- /* Input video dynamic_range & colorimetry */
- vic = drm_match_cea_mode(mode);
- if ((vic == 6) || (vic == 7) || (vic == 21) || (vic == 22) ||
- (vic == 2) || (vic == 3) || (vic == 17) || (vic == 18)) {
- video->dynamic_range = CEA;
- video->ycbcr_coeff = COLOR_YCBCR601;
- } else if (vic) {
- video->dynamic_range = CEA;
- video->ycbcr_coeff = COLOR_YCBCR709;
- } else {
- video->dynamic_range = VESA;
- video->ycbcr_coeff = COLOR_YCBCR709;
- }
-
- /* Input vide bpc and color_formats */
- switch (display_info->bpc) {
- case 12:
- video->color_depth = COLOR_12;
- break;
- case 10:
- video->color_depth = COLOR_10;
- break;
- case 8:
- video->color_depth = COLOR_8;
- break;
- case 6:
- video->color_depth = COLOR_6;
- break;
- default:
- video->color_depth = COLOR_8;
- break;
- }
- if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
- video->color_space = COLOR_YCBCR444;
- else if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
- video->color_space = COLOR_YCBCR422;
- else
- video->color_space = COLOR_RGB;
-
- /*
- * NOTE: those property parsing code is used for providing backward
- * compatibility for samsung platform.
- * Due to we used the "of_property_read_u32" interfaces, when this
- * property isn't present, the "video_info" can keep the original
- * values and wouldn't be modified.
- */
- of_property_read_u32(dp_node, "samsung,color-space",
- &video->color_space);
- of_property_read_u32(dp_node, "samsung,dynamic-range",
- &video->dynamic_range);
- of_property_read_u32(dp_node, "samsung,ycbcr-coeff",
- &video->ycbcr_coeff);
- of_property_read_u32(dp_node, "samsung,color-depth",
- &video->color_depth);
- if (of_property_read_bool(dp_node, "hsync-active-high"))
- video->h_sync_polarity = true;
- if (of_property_read_bool(dp_node, "vsync-active-high"))
- video->v_sync_polarity = true;
- if (of_property_read_bool(dp_node, "interlaced"))
- video->interlaced = true;
-}
-
static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -1290,7 +1294,6 @@ 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,
- .mode_set = analogix_dp_bridge_mode_set,
.attach = analogix_dp_bridge_attach,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v6 03/18] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-09-30 9:09 ` [PATCH v6 01/18] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
2025-09-30 9:09 ` [PATCH v6 02/18] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
` (11 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
Changes in v4:
- Rename the &analogix_dp_plat_data.bridge to
&analogix_dp_plat_data.next_bridge
---
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] 30+ messages in thread
* [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (2 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 03/18] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 20:10 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 05/18] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
` (10 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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.
Additionally, a new API drm_bridge_is_legacy() is added to identify
the legacy bridge, allowing specialized handling for such cases.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
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 -----------------
drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++++++++++++++++
drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
include/drm/bridge/imx.h | 17 ----
include/drm/bridge/legacy-bridge.h | 18 ++++
11 files changed, 135 insertions(+), 126 deletions(-)
delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
delete mode 100644 include/drm/bridge/imx.h
create mode 100644 include/drm/bridge/legacy-bridge.h
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index a250afd8d662..77d8de3fa8c4 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -125,6 +125,16 @@ config DRM_ITE_IT6505
help
ITE IT6505 DisplayPort bridge chip driver.
+config DRM_LEGACY_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.
+
+ Newer designs should not use this bridge and should use proper panel
+ driver instead.
+
config DRM_LONTIUM_LT8912B
tristate "Lontium LT8912B DSI/HDMI bridge"
depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index c7dc03182e59..f2cb7b4f26e5 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_DRM_I2C_NXP_TDA998X) += tda998x.o
obj-$(CONFIG_DRM_ITE_IT6263) += ite-it6263.o
obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o
+obj-$(CONFIG_DRM_LEGACY_BRIDGE) += legacy-bridge.o
obj-$(CONFIG_DRM_LONTIUM_LT8912B) += lontium-lt8912b.o
obj-$(CONFIG_DRM_LONTIUM_LT9211) += lontium-lt9211.o
obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index 9a480c6abb85..8dd89efa8ea7 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 dd5d48584806..edb0a7b71b30 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_PVI) += imx8mp-hdmi-pvi.o
obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.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/legacy-bridge.c b/drivers/gpu/drm/bridge/legacy-bridge.c
new file mode 100644
index 000000000000..0d0a398036fe
--- /dev/null
+++ b/drivers/gpu/drm/bridge/legacy-bridge.c
@@ -0,0 +1,99 @@
+// 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/legacy-bridge.h>
+
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+
+struct legacy_bridge {
+ struct drm_bridge base;
+
+ struct drm_display_mode mode;
+ u32 bus_flags;
+};
+
+#define to_legacy_bridge(bridge) container_of(bridge, struct legacy_bridge, base)
+
+static int 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 legacy_bridge_get_modes(struct drm_bridge *bridge,
+ struct drm_connector *connector)
+{
+ struct legacy_bridge *legacy = to_legacy_bridge(bridge);
+ int ret;
+
+ ret = drm_connector_helper_get_modes_fixed(connector, &legacy->mode);
+ if (ret)
+ return ret;
+
+ connector->display_info.bus_flags = legacy->bus_flags;
+
+ return 0;
+}
+
+struct drm_bridge_funcs legacy_bridge_funcs = {
+ .attach = legacy_bridge_attach,
+ .get_modes = legacy_bridge_get_modes,
+};
+
+struct drm_bridge *devm_drm_legacy_bridge(struct device *dev,
+ struct device_node *np,
+ int type)
+{
+ struct legacy_bridge *legacy;
+ int ret;
+
+ legacy = devm_drm_bridge_alloc(dev, struct legacy_bridge,
+ base, &legacy_bridge_funcs);
+ if (IS_ERR(legacy))
+ return ERR_CAST(legacy);
+
+ ret = of_get_drm_display_mode(np,
+ &legacy->mode,
+ &legacy->bus_flags,
+ OF_USE_NATIVE_MODE);
+ if (ret)
+ return ERR_PTR(ret);
+
+ legacy->mode.type |= DRM_MODE_TYPE_DRIVER;
+
+ legacy->base.of_node = np;
+ legacy->base.ops = DRM_BRIDGE_OP_MODES;
+ legacy->base.type = type;
+
+ ret = devm_drm_bridge_add(dev, &legacy->base);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return &legacy->base;
+}
+EXPORT_SYMBOL_GPL(devm_drm_legacy_bridge);
+
+bool drm_bridge_is_legacy(const struct drm_bridge *bridge)
+{
+ return bridge->funcs == &legacy_bridge_funcs;
+}
+EXPORT_SYMBOL(drm_bridge_is_legacy);
+
+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 acaf25089001..401e9cfe5419 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -15,7 +15,7 @@ config DRM_IMX_PARALLEL_DISPLAY
depends on DRM_IMX
select DRM_BRIDGE
select DRM_BRIDGE_CONNECTOR
- select DRM_IMX_LEGACY_BRIDGE
+ select DRM_LEGACY_BRIDGE
select DRM_PANEL_BRIDGE
select VIDEOMODE_HELPERS
@@ -36,7 +36,7 @@ config DRM_IMX_LDB
select DRM_BRIDGE
select DRM_BRIDGE_CONNECTOR
select DRM_PANEL_BRIDGE
- select DRM_IMX_LEGACY_BRIDGE
+ select DRM_LEGACY_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 6be7a57ad03d..3b0206c7d88e 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/legacy-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_legacy_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 6d8325c76697..f8f7206b45bb 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/legacy-bridge.h>
#include "imx-drm.h"
@@ -235,7 +235,7 @@ 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_legacy_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/legacy-bridge.h b/include/drm/bridge/legacy-bridge.h
new file mode 100644
index 000000000000..27bc056f5543
--- /dev/null
+++ b/include/drm/bridge/legacy-bridge.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ */
+
+#ifndef DRM_LEGACY_BRIDGE_H
+#define DRM_LEGACY_BRIDGE_H
+
+struct device;
+struct device_node;
+struct drm_bridge;
+
+struct drm_bridge *devm_drm_legacy_bridge(struct device *dev,
+ struct device_node *np,
+ int type);
+bool drm_bridge_is_legacy(const struct drm_bridge *bridge);
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v6 05/18] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (3 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 06/18] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
` (9 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
------
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.
---
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] 30+ messages in thread
* [PATCH v6 06/18] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (4 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 05/18] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node Damon Ding
` (8 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
Changes in v5:
- Fix the 'drm/bridge' to 'drm/exynos' in commit message.
---
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] 30+ messages in thread
* [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (5 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 06/18] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 20:17 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 08/18] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
` (7 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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 legacy bridge to parse display
timings.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
------
Changes in v6:
- Apply DRM legacy bridge to parse display timings intead of
implementing the same codes only for Exynos DP.
---
drivers/gpu/drm/exynos/Kconfig | 1 +
drivers/gpu/drm/exynos/exynos_dp.c | 71 +++++++++---------------------
2 files changed, 22 insertions(+), 50 deletions(-)
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 0d13828e7d9e..66665d317848 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_LEGACY_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..507d0a98fe5b 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/legacy-bridge.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_crtc.h>
@@ -38,11 +39,23 @@ 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;
};
+static int exynos_dp_legacy_bridge_init(struct exynos_dp_device *dp,
+ struct drm_bridge **bridge)
+{
+ if (!bridge)
+ return -EINVAL;
+
+ *bridge = devm_drm_legacy_bridge(dp->dev, dp->dev->of_node, DRM_MODE_CONNECTOR_eDP);
+ if (IS_ERR(*bridge))
+ return PTR_ERR(*bridge);
+
+ return 0;
+}
+
static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
bool enable)
{
@@ -67,44 +80,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 (drm_bridge_is_legacy(plat_data->next_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 +118,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 +127,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 +193,8 @@ 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)
+ ret = exynos_dp_legacy_bridge_init(dp, &bridge);
if (ret)
return ret;
@@ -233,7 +205,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] 30+ messages in thread
* [PATCH v6 08/18] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (6 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
` (6 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
------
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.
---
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 3caa47d31649..4606ecc3f480 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 507d0a98fe5b..8d41de2490d5 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -205,7 +205,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] 30+ messages in thread
* [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (7 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 08/18] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 20:18 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
` (5 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
---
.../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 4606ecc3f480..5bf41b364aba 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 = DRM_COLOR_FORMAT_YCBCR444 | DRM_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 |= DRM_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 94da0f745525..0a185ebd26af 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -165,23 +165,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 = DRM_COLOR_FORMAT_YCBCR444 | DRM_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 |= DRM_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,
@@ -480,7 +463,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] 30+ messages in thread
* [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes()
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (8 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 20:18 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities Damon Ding
` (4 subsequent siblings)
14 siblings, 1 reply; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
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 5bf41b364aba..b0bc96693fdb 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] 30+ messages in thread
* [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (9 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 20:21 ` Dmitry Baryshkov
2025-10-01 16:09 ` Luca Ceresoli
2025-09-30 9:09 ` [PATCH v6 12/18] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
` (3 subsequent siblings)
14 siblings, 2 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip, Damon Ding
When multiple bridges are present, EDID detection capability
(DRM_BRIDGE_OP_EDID) takes precedence over modes detection
(DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
determined by the last bridge in the chain, we handle three cases:
Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
- If the previous bridge declares DRM_BRIDGE_OP_EDID, set
&drm_bridge_connector.bridge_edid to NULL and set
&drm_bridge_connector.bridge_modes to the later bridge.
- Ensure modes detection capability of the later bridge will not
be ignored.
Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
- If the previous bridge declares DRM_BRIDGE_OP_MODES, set
&drm_bridge_connector.bridge_modes to NULL and set
&drm_bridge_connector.bridge_edid to the later bridge.
- Although EDID detection capability has higher priority, this
operation is for balance and makes sense.
Case 3: the later bridge declares both of them
- Assign later bridge as &drm_bridge_connector.bridge_edid and
and &drm_bridge_connector.bridge_modes to this bridge.
- Just leave transfer of these two capabilities as before.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
.../gpu/drm/display/drm_bridge_connector.c | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index baacd21e7341..0ca6f140e85b 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -640,6 +640,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
struct drm_connector *connector;
struct i2c_adapter *ddc = NULL;
struct drm_bridge *bridge, *panel_bridge = NULL;
+ struct drm_bridge *pre_bridge_edid, *pre_bridge_modes;
unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
unsigned int max_bpc = 8;
bool support_hdcp = false;
@@ -668,6 +669,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
*/
connector_type = DRM_MODE_CONNECTOR_Unknown;
drm_for_each_bridge_in_chain(encoder, bridge) {
+ pre_bridge_edid = bridge_connector->bridge_edid;
+ pre_bridge_modes = bridge_connector->bridge_modes;
+
if (!bridge->interlace_allowed)
connector->interlace_allowed = false;
if (!bridge->ycbcr_420_allowed)
@@ -681,6 +685,44 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
bridge_connector->bridge_detect = bridge;
if (bridge->ops & DRM_BRIDGE_OP_MODES)
bridge_connector->bridge_modes = bridge;
+
+ /*
+ * When multiple bridges are present, EDID detection capability
+ * (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
+ * (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities
+ * are determined by the last bridge in the chain, we handle
+ * three cases:
+ *
+ * Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
+ * - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
+ * &drm_bridge_connector.bridge_edid to NULL and set
+ * &drm_bridge_connector.bridge_modes to the later bridge.
+ * - Ensure modes detection capability of the later bridge
+ * will not be ignored.
+ *
+ * Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
+ * - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
+ * &drm_bridge_connector.bridge_modes to NULL and set
+ * &drm_bridge_connector.bridge_edid to the later bridge.
+ * - Although EDID detection capability has higher priority,
+ * this operation is for balance and makes sense.
+ *
+ * Case 3: the later bridge declares both of them
+ * - Assign later bridge as &drm_bridge_connector.bridge_edid
+ * and &drm_bridge_connector.bridge_modes to this bridge.
+ * - Just leave transfer of these two capabilities as before.
+ */
+ if (bridge->ops & DRM_BRIDGE_OP_EDID &&
+ !(bridge->ops & DRM_BRIDGE_OP_MODES)) {
+ if (pre_bridge_modes)
+ bridge_connector->bridge_modes = NULL;
+ }
+ if (bridge->ops & DRM_BRIDGE_OP_MODES &&
+ !(bridge->ops & DRM_BRIDGE_OP_EDID)) {
+ if (pre_bridge_edid)
+ bridge_connector->bridge_edid = NULL;
+ }
+
if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
if (bridge_connector->bridge_hdmi)
return ERR_PTR(-EBUSY);
--
2.34.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v6 12/18] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (10 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 13/18] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
` (2 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip, Damon Ding
Apply drm_bridge_connector helper for Analogix DP driver.
The following changes have been made:
- Apply drm_bridge_connector helper to get rid of &drm_connector_funcs
and &drm_connector_helper_funcs.
- Remove unnecessary parameter struct drm_connector* for callback
&analogix_dp_plat_data.attach.
- Remove &analogix_dp_device.connector.
- Convert analogix_dp_atomic_check()/analogix_dp_detect() to
&drm_bridge_funcs.atomic_check()/&drm_bridge_funcs.detect().
- Split analogix_dp_get_modes() into &drm_bridge_funcs.get_modes() and
&drm_bridge_funcs.edid_read().
- 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().
- Set &drm_bridge.ops according to different cases.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
------
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.
---
.../drm/bridge/analogix/analogix_dp_core.c | 148 ++++++++----------
.../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 +-
include/drm/bridge/analogix_dp.h | 3 +-
7 files changed, 90 insertions(+), 100 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index b0bc96693fdb..81c6e81dd352 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 = DRM_COLOR_FORMAT_YCBCR444 | DRM_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,53 +916,20 @@ 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, connector);
+ ret = dp->plat_data->attach(dp->plat_data, bridge);
if (ret) {
DRM_ERROR("Failed at platform attach func\n");
return ret;
@@ -1095,14 +1033,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 +1131,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 */
@@ -1302,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)
@@ -1532,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;
@@ -1545,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;
@@ -1563,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);
@@ -1573,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",
@@ -1581,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 66665d317848..1573620510d0 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_LEGACY_BRIDGE
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 8d41de2490d5..e767ac506515 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -22,6 +22,7 @@
#include <drm/bridge/legacy-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>
@@ -81,19 +82,15 @@ 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;
int ret;
/* Pre-empt DP connector creation if there's a bridge */
if (plat_data->next_bridge) {
- if (drm_bridge_is_legacy(plat_data->next_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,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ret;
}
@@ -123,6 +120,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;
@@ -138,10 +136,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,
diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index b7b025814e72..61e95a3ca6ab 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -43,6 +43,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 0a185ebd26af..3b6b2d3ca5d1 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>
@@ -368,6 +369,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;
@@ -387,7 +389,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;
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] 30+ messages in thread
* [PATCH v6 13/18] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe()
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (11 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 12/18] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
@ 2025-09-30 9:09 ` Damon Ding
2025-09-30 10:17 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Marek Szyprowski
2025-09-30 20:29 ` Dmitry Baryshkov
14 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-09-30 9:09 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, m.szyprowski, luca.ceresoli, jani.nikula, 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.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
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.
---
drivers/gpu/drm/bridge/analogix/Kconfig | 1 +
.../drm/bridge/analogix/analogix_dp_core.c | 48 +++++++++++++++++++
include/drm/bridge/analogix_dp.h | 2 +
3 files changed, 51 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig
index 4846b2e9be7c..964122b5bd39 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 81c6e81dd352..933f1843777f 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,52 @@ 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) {
+ dev_err(dp->dev, "failed to populate aux bus\n");
+ return ret;
+ }
+
+ 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] 30+ messages in thread
* Re: [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (12 preceding siblings ...)
2025-09-30 9:09 ` [PATCH v6 13/18] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
@ 2025-09-30 10:17 ` Marek Szyprowski
2025-10-09 1:29 ` Damon Ding
2025-09-30 20:29 ` Dmitry Baryshkov
14 siblings, 1 reply; 30+ messages in thread
From: Marek Szyprowski @ 2025-09-30 10:17 UTC (permalink / raw)
To: Damon Ding, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, luca.ceresoli, jani.nikula, linux-kernel, dri-devel,
imx, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On 30.09.2025 11:09, Damon Ding wrote:
> PATCH 1 is a small format optimization for struct analogid_dp_device.
> PATCH 2 is to perform mode setting in &drm_bridge_funcs.atomic_enable.
> PATCH 3 is to add a new parameter to store the point of next bridge.
> PATCH 4 is to make legacy bridge driver more universal.
> PATCH 5-10 are preparations for apply drm_bridge_connector helper.
> PATCH 11 is to ensure last bridge determines OP_EDID/OP_MODES capabilities.
> PATCH 12 is to apply the drm_bridge_connector helper.
> PATCH 13-15 are to move the panel/bridge parsing to the Analogix side.
> PATCH 16 is to attach the next bridge on Analogix side uniformly.
> PATCH 17-18 are to apply the panel_bridge helper.
Works fine on my Exynos based test boards with (e)DP displays. Thanks!
Feel free to update tags if needed:
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Damon Ding (18):
> drm/bridge: analogix_dp: Formalize the struct analogix_dp_device
> drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to
> &drm_bridge_funcs.atomic_enable
> 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 legacy 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/display: bridge_connector: Ensure last bridge determines
> EDID/modes detection capabilities
> 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 | 395 +++++++++---------
> .../drm/bridge/analogix/analogix_dp_core.h | 5 +-
> drivers/gpu/drm/bridge/imx/Kconfig | 10 -
> drivers/gpu/drm/bridge/imx/Makefile | 1 -
> .../gpu/drm/bridge/imx/imx-legacy-bridge.c | 91 ----
> drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++
> .../gpu/drm/display/drm_bridge_connector.c | 42 ++
> drivers/gpu/drm/exynos/Kconfig | 2 +
> drivers/gpu/drm/exynos/exynos_dp.c | 117 ++----
> drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
> drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
> 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/legacy-bridge.h | 18 +
> 20 files changed, 433 insertions(+), 466 deletions(-)
> delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
> create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
> delete mode 100644 include/drm/bridge/imx.h
> create mode 100644 include/drm/bridge/legacy-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.
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
2025-09-30 9:09 ` [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
@ 2025-09-30 20:10 ` Dmitry Baryshkov
2025-10-09 1:46 ` Damon Ding
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:10 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:06PM +0800, Damon Ding wrote:
> 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.
>
> Additionally, a new API drm_bridge_is_legacy() is added to identify
> the legacy bridge, allowing specialized handling for such cases.
Why do you need special handling for it?
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> 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 -----------------
> drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++++++++++++++++
> drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
> drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
> include/drm/bridge/imx.h | 17 ----
> include/drm/bridge/legacy-bridge.h | 18 ++++
> 11 files changed, 135 insertions(+), 126 deletions(-)
> delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
> create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
> delete mode 100644 include/drm/bridge/imx.h
> create mode 100644 include/drm/bridge/legacy-bridge.h
I'm slightly concerned with the name of 'legacy drm bridge', It was fine
for 'i.MX legacy', but now it might be a bit of overkill. Maybe
something like drm_display_mode or drm_of_display_mode bridge?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node
2025-09-30 9:09 ` [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node Damon Ding
@ 2025-09-30 20:17 ` Dmitry Baryshkov
2025-10-09 2:01 ` Damon Ding
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:17 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:09PM +0800, Damon Ding wrote:
> 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 legacy bridge to parse display
> timings.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>
> ------
>
> Changes in v6:
> - Apply DRM legacy bridge to parse display timings intead of
> implementing the same codes only for Exynos DP.
> ---
> drivers/gpu/drm/exynos/Kconfig | 1 +
> drivers/gpu/drm/exynos/exynos_dp.c | 71 +++++++++---------------------
> 2 files changed, 22 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
> index 0d13828e7d9e..66665d317848 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_LEGACY_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..507d0a98fe5b 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/legacy-bridge.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_bridge.h>
> #include <drm/drm_crtc.h>
> @@ -38,11 +39,23 @@ 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;
> };
>
> +static int exynos_dp_legacy_bridge_init(struct exynos_dp_device *dp,
> + struct drm_bridge **bridge)
> +{
> + if (!bridge)
> + return -EINVAL;
Well, this can't happen, can it?
> +
> + *bridge = devm_drm_legacy_bridge(dp->dev, dp->dev->of_node, DRM_MODE_CONNECTOR_eDP);
> + if (IS_ERR(*bridge))
> + return PTR_ERR(*bridge);
> +
> + return 0;
> +}
I'd suggest inlining the function. It doesn't make sense to have
one-line wrapper.
> +
> static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
> bool enable)
> {
[...]
> 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 (drm_bridge_is_legacy(plat_data->next_bridge))
I see... You are going to kill this line in one of the next patches, but
the API will stay. I suggest adding a flag to the exynos_dp_device and
then removing the flag once you migrate to drm_bridge_connector.
> + flags = DRM_BRIDGE_ATTACH_NO_CONNECTOR;
> +
> + ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge, flags);
> if (ret)
> return ret;
> }
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
2025-09-30 9:09 ` [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
@ 2025-09-30 20:18 ` Dmitry Baryshkov
0 siblings, 0 replies; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:18 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:11PM +0800, Damon Ding wrote:
> 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>
> ---
> .../gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++++
> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 18 ------------------
> 2 files changed, 11 insertions(+), 18 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes()
2025-09-30 9:09 ` [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
@ 2025-09-30 20:18 ` Dmitry Baryshkov
0 siblings, 0 replies; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:18 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:12PM +0800, Damon Ding wrote:
> 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>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 ---
> include/drm/bridge/analogix_dp.h | 2 --
> 2 files changed, 5 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-09-30 9:09 ` [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities Damon Ding
@ 2025-09-30 20:21 ` Dmitry Baryshkov
2025-10-09 3:15 ` Damon Ding
2025-10-01 16:09 ` Luca Ceresoli
1 sibling, 1 reply; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:21 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:13PM +0800, Damon Ding wrote:
> When multiple bridges are present, EDID detection capability
> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
> determined by the last bridge in the chain, we handle three cases:
>
> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
> &drm_bridge_connector.bridge_edid to NULL and set
> &drm_bridge_connector.bridge_modes to the later bridge.
> - Ensure modes detection capability of the later bridge will not
> be ignored.
>
> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
> &drm_bridge_connector.bridge_modes to NULL and set
> &drm_bridge_connector.bridge_edid to the later bridge.
> - Although EDID detection capability has higher priority, this
> operation is for balance and makes sense.
>
> Case 3: the later bridge declares both of them
> - Assign later bridge as &drm_bridge_connector.bridge_edid and
> and &drm_bridge_connector.bridge_modes to this bridge.
> - Just leave transfer of these two capabilities as before.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> .../gpu/drm/display/drm_bridge_connector.c | 42 +++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
But I'd suggest pulling this to a top of the series to let others also
take a look at it.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (13 preceding siblings ...)
2025-09-30 10:17 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Marek Szyprowski
@ 2025-09-30 20:29 ` Dmitry Baryshkov
14 siblings, 0 replies; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-09-30 20:29 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
On Tue, Sep 30, 2025 at 05:09:02PM +0800, Damon Ding wrote:
> PATCH 1 is a small format optimization for struct analogid_dp_device.
> PATCH 2 is to perform mode setting in &drm_bridge_funcs.atomic_enable.
> PATCH 3 is to add a new parameter to store the point of next bridge.
> PATCH 4 is to make legacy bridge driver more universal.
> PATCH 5-10 are preparations for apply drm_bridge_connector helper.
> PATCH 11 is to ensure last bridge determines OP_EDID/OP_MODES capabilities.
> PATCH 12 is to apply the drm_bridge_connector helper.
> PATCH 13-15 are to move the panel/bridge parsing to the Analogix side.
> PATCH 16 is to attach the next bridge on Analogix side uniformly.
> PATCH 17-18 are to apply the panel_bridge helper.
Note, only patches 1-13 made it to the list:
https://lore.kernel.org/dri-devel/41c2a141-a72e-4780-ab32-f22f3a2e0179@samsung.com/#related
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-09-30 9:09 ` [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities Damon Ding
2025-09-30 20:21 ` Dmitry Baryshkov
@ 2025-10-01 16:09 ` Luca Ceresoli
2025-10-03 7:34 ` Luca Ceresoli
2025-10-09 4:10 ` Damon Ding
1 sibling, 2 replies; 30+ messages in thread
From: Luca Ceresoli @ 2025-10-01 16:09 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dmitry.baryshkov, dianders, m.szyprowski, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hello Damon,
On Tue, 30 Sep 2025 17:09:13 +0800
Damon Ding <damon.ding@rock-chips.com> wrote:
> When multiple bridges are present, EDID detection capability
> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
> determined by the last bridge in the chain, we handle three cases:
>
> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
> &drm_bridge_connector.bridge_edid to NULL and set
> &drm_bridge_connector.bridge_modes to the later bridge.
> - Ensure modes detection capability of the later bridge will not
> be ignored.
>
> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
> &drm_bridge_connector.bridge_modes to NULL and set
> &drm_bridge_connector.bridge_edid to the later bridge.
> - Although EDID detection capability has higher priority, this
> operation is for balance and makes sense.
>
> Case 3: the later bridge declares both of them
> - Assign later bridge as &drm_bridge_connector.bridge_edid and
> and &drm_bridge_connector.bridge_modes to this bridge.
> - Just leave transfer of these two capabilities as before.
I think the whole explanation can be more concisely rewritten as:
If the later bridge declares OP_EDID, OP_MODES or both, then both
.bridge_modes and .bridge_edid should be set to NULL (if any was set
from a previous bridge), and then .bridge_modes and/or .bridge_edid be
set to the later bridge as is done already.
Does this look correct (i.e. does it convey the same meaning)?
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -640,6 +640,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> struct drm_connector *connector;
> struct i2c_adapter *ddc = NULL;
> struct drm_bridge *bridge, *panel_bridge = NULL;
> + struct drm_bridge *pre_bridge_edid, *pre_bridge_modes;
> unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
> unsigned int max_bpc = 8;
> bool support_hdcp = false;
> @@ -668,6 +669,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> */
> connector_type = DRM_MODE_CONNECTOR_Unknown;
> drm_for_each_bridge_in_chain(encoder, bridge) {
> + pre_bridge_edid = bridge_connector->bridge_edid;
> + pre_bridge_modes = bridge_connector->bridge_modes;
> +
> if (!bridge->interlace_allowed)
> connector->interlace_allowed = false;
> if (!bridge->ycbcr_420_allowed)
> @@ -681,6 +685,44 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> bridge_connector->bridge_detect = bridge;
> if (bridge->ops & DRM_BRIDGE_OP_MODES)
> bridge_connector->bridge_modes = bridge;
> +
> + /*
> + * When multiple bridges are present, EDID detection capability
> + * (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
> + * (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities
> + * are determined by the last bridge in the chain, we handle
> + * three cases:
> + *
> + * Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
> + * - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
> + * &drm_bridge_connector.bridge_edid to NULL and set
> + * &drm_bridge_connector.bridge_modes to the later bridge.
> + * - Ensure modes detection capability of the later bridge
> + * will not be ignored.
> + *
> + * Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
> + * - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
> + * &drm_bridge_connector.bridge_modes to NULL and set
> + * &drm_bridge_connector.bridge_edid to the later bridge.
> + * - Although EDID detection capability has higher priority,
> + * this operation is for balance and makes sense.
> + *
> + * Case 3: the later bridge declares both of them
> + * - Assign later bridge as &drm_bridge_connector.bridge_edid
> + * and &drm_bridge_connector.bridge_modes to this bridge.
> + * - Just leave transfer of these two capabilities as before.
> + */
> + if (bridge->ops & DRM_BRIDGE_OP_EDID &&
> + !(bridge->ops & DRM_BRIDGE_OP_MODES)) {
> + if (pre_bridge_modes)
> + bridge_connector->bridge_modes = NULL;
> + }
> + if (bridge->ops & DRM_BRIDGE_OP_MODES &&
> + !(bridge->ops & DRM_BRIDGE_OP_EDID)) {
> + if (pre_bridge_edid)
> + bridge_connector->bridge_edid = NULL;
> + }
> +
If the above rewrite is correct, then I think this patch can be
rewritten in a simple way (build tested only):
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index a5bdd6c10643..bd5dbafe88bc 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -672,14 +672,18 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
if (!bridge->ycbcr_420_allowed)
connector->ycbcr_420_allowed = false;
- if (bridge->ops & DRM_BRIDGE_OP_EDID)
- bridge_connector->bridge_edid = bridge;
+ if (bridge->ops & DRM_BRIDGE_OP_EDID || bridge->ops & DRM_BRIDGE_OP_MODES) {
+ bridge_connector->bridge_edid = NULL;
+ bridge_connector->bridge_modes = NULL;
+ if (bridge->ops & DRM_BRIDGE_OP_EDID)
+ bridge_connector->bridge_edid = bridge;
+ if (bridge->ops & DRM_BRIDGE_OP_MODES)
+ bridge_connector->bridge_modes = bridge;
+ }
if (bridge->ops & DRM_BRIDGE_OP_HPD)
bridge_connector->bridge_hpd = bridge;
if (bridge->ops & DRM_BRIDGE_OP_DETECT)
bridge_connector->bridge_detect = bridge;
- if (bridge->ops & DRM_BRIDGE_OP_MODES)
- bridge_connector->bridge_modes = bridge;
if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
if (bridge_connector->bridge_hdmi)
return ERR_PTR(-EBUSY);
Another thing to note is that this patch conflicts with [0], which I
plan to apply in the next few days. The two patches are orthogonal but
they insist on the same lines (those assigning
bridge_connector->bridge_* = bridge). Not a big deal, whichever patch
comes later will be easily adapted. Just wanted to ensure you are aware.
[0] https://lore.kernel.org/all/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com/
Best regards,
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-10-01 16:09 ` Luca Ceresoli
@ 2025-10-03 7:34 ` Luca Ceresoli
2025-10-09 4:10 ` Damon Ding
1 sibling, 0 replies; 30+ messages in thread
From: Luca Ceresoli @ 2025-10-03 7:34 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dmitry.baryshkov, dianders, m.szyprowski, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hello Damon,
On Wed, 1 Oct 2025 18:09:22 +0200
Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
> Another thing to note is that this patch conflicts with [0], which I
> plan to apply in the next few days. The two patches are orthogonal but
> they insist on the same lines (those assigning
> bridge_connector->bridge_* = bridge). Not a big deal, whichever patch
> comes later will be easily adapted. Just wanted to ensure you are aware.
>
> [0] https://lore.kernel.org/all/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com/
The patch I mentioned is now merged on drm-misc-next [1], so you'll
need to rebase yours on top adapting the changes. I expect it to be
simple enough, but don't hesitate to ask here in case it's not.
[1] https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/2be300f9a0b6f6b0ae2a90be97e558ec0535be54
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-09-30 10:17 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Marek Szyprowski
@ 2025-10-09 1:29 ` Damon Ding
0 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-10-09 1:29 UTC (permalink / raw)
To: Marek Szyprowski, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dmitry.baryshkov,
dianders, luca.ceresoli, jani.nikula, linux-kernel, dri-devel,
imx, linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Marek,
On 9/30/2025 6:17 PM, Marek Szyprowski wrote:
> On 30.09.2025 11:09, Damon Ding wrote:
>> PATCH 1 is a small format optimization for struct analogid_dp_device.
>> PATCH 2 is to perform mode setting in &drm_bridge_funcs.atomic_enable.
>> PATCH 3 is to add a new parameter to store the point of next bridge.
>> PATCH 4 is to make legacy bridge driver more universal.
>> PATCH 5-10 are preparations for apply drm_bridge_connector helper.
>> PATCH 11 is to ensure last bridge determines OP_EDID/OP_MODES capabilities.
>> PATCH 12 is to apply the drm_bridge_connector helper.
>> PATCH 13-15 are to move the panel/bridge parsing to the Analogix side.
>> PATCH 16 is to attach the next bridge on Analogix side uniformly.
>> PATCH 17-18 are to apply the panel_bridge helper.
>
> Works fine on my Exynos based test boards with (e)DP displays. Thanks!
>
> Feel free to update tags if needed:
>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
Thanks a lot for the testing and the tag!
Apologies for the delayed reply as I was on vacation. ;-)
>
>> Damon Ding (18):
>> drm/bridge: analogix_dp: Formalize the struct analogix_dp_device
>> drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to
>> &drm_bridge_funcs.atomic_enable
>> 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 legacy 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/display: bridge_connector: Ensure last bridge determines
>> EDID/modes detection capabilities
>> 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 | 395 +++++++++---------
>> .../drm/bridge/analogix/analogix_dp_core.h | 5 +-
>> drivers/gpu/drm/bridge/imx/Kconfig | 10 -
>> drivers/gpu/drm/bridge/imx/Makefile | 1 -
>> .../gpu/drm/bridge/imx/imx-legacy-bridge.c | 91 ----
>> drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++
>> .../gpu/drm/display/drm_bridge_connector.c | 42 ++
>> drivers/gpu/drm/exynos/Kconfig | 2 +
>> drivers/gpu/drm/exynos/exynos_dp.c | 117 ++----
>> drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
>> drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
>> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
>> 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/legacy-bridge.h | 18 +
>> 20 files changed, 433 insertions(+), 466 deletions(-)
>> delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
>> create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
>> delete mode 100644 include/drm/bridge/imx.h
>> create mode 100644 include/drm/bridge/legacy-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.
>>
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
2025-09-30 20:10 ` Dmitry Baryshkov
@ 2025-10-09 1:46 ` Damon Ding
0 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-10-09 1:46 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hi Dmitry,
On 10/1/2025 4:10 AM, Dmitry Baryshkov wrote:
> On Tue, Sep 30, 2025 at 05:09:06PM +0800, Damon Ding wrote:
>> 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.
>>
>> Additionally, a new API drm_bridge_is_legacy() is added to identify
>> the legacy bridge, allowing specialized handling for such cases.
>
> Why do you need special handling for it?
>
As you suggested, I will remove this API and add a temporary flag to the
Exynos side.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> ---
>> 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 -----------------
>> drivers/gpu/drm/bridge/legacy-bridge.c | 99 +++++++++++++++++++
>> drivers/gpu/drm/imx/ipuv3/Kconfig | 4 +-
>> drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 6 +-
>> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
>> include/drm/bridge/imx.h | 17 ----
>> include/drm/bridge/legacy-bridge.h | 18 ++++
>> 11 files changed, 135 insertions(+), 126 deletions(-)
>> delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
>> create mode 100644 drivers/gpu/drm/bridge/legacy-bridge.c
>> delete mode 100644 include/drm/bridge/imx.h
>> create mode 100644 include/drm/bridge/legacy-bridge.h
>
> I'm slightly concerned with the name of 'legacy drm bridge', It was fine
> for 'i.MX legacy', but now it might be a bit of overkill. Maybe
> something like drm_display_mode or drm_of_display_mode bridge?
>
The 'drm_of_display_mode_bridge' is more descriptive. Compared to that,
the 'legacy-bridge' is somewhat ambiguous.
Apologies for the delayed reply as I was on vacation. ;-)
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node
2025-09-30 20:17 ` Dmitry Baryshkov
@ 2025-10-09 2:01 ` Damon Ding
0 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-10-09 2:01 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hi Dmitry,
On 10/1/2025 4:17 AM, Dmitry Baryshkov wrote:
> On Tue, Sep 30, 2025 at 05:09:09PM +0800, Damon Ding wrote:
>> 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 legacy bridge to parse display
>> timings.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>
>> ------
>>
>> Changes in v6:
>> - Apply DRM legacy bridge to parse display timings intead of
>> implementing the same codes only for Exynos DP.
>> ---
>> drivers/gpu/drm/exynos/Kconfig | 1 +
>> drivers/gpu/drm/exynos/exynos_dp.c | 71 +++++++++---------------------
>> 2 files changed, 22 insertions(+), 50 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
>> index 0d13828e7d9e..66665d317848 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_LEGACY_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..507d0a98fe5b 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/legacy-bridge.h>
>> #include <drm/drm_atomic_helper.h>
>> #include <drm/drm_bridge.h>
>> #include <drm/drm_crtc.h>
>> @@ -38,11 +39,23 @@ 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;
>> };
>>
>> +static int exynos_dp_legacy_bridge_init(struct exynos_dp_device *dp,
>> + struct drm_bridge **bridge)
>> +{
>> + if (!bridge)
>> + return -EINVAL;
>
> Well, this can't happen, can it?
>
>> +
>> + *bridge = devm_drm_legacy_bridge(dp->dev, dp->dev->of_node, DRM_MODE_CONNECTOR_eDP);
>> + if (IS_ERR(*bridge))
>> + return PTR_ERR(*bridge);
>> +
>> + return 0;
>> +}
>
> I'd suggest inlining the function. It doesn't make sense to have
> one-line wrapper.
>
Will do in v7.
>> +
>> static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
>> bool enable)
>> {
>
> [...]
>
>> 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 (drm_bridge_is_legacy(plat_data->next_bridge))
>
> I see... You are going to kill this line in one of the next patches, but
> the API will stay. I suggest adding a flag to the exynos_dp_device and
> then removing the flag once you migrate to drm_bridge_connector.
>
Yes, using a temporary flag is a better approach.
>> + flags = DRM_BRIDGE_ATTACH_NO_CONNECTOR;
>> +
>> + ret = drm_bridge_attach(&dp->encoder, plat_data->next_bridge, bridge, flags);
>> if (ret)
>> return ret;
>> }
>
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-09-30 20:21 ` Dmitry Baryshkov
@ 2025-10-09 3:15 ` Damon Ding
0 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-10-09 3:15 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, luca.ceresoli, jani.nikula,
linux-kernel, dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hi Dmitry,
On 10/1/2025 4:21 AM, Dmitry Baryshkov wrote:
> On Tue, Sep 30, 2025 at 05:09:13PM +0800, Damon Ding wrote:
>> When multiple bridges are present, EDID detection capability
>> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
>> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
>> determined by the last bridge in the chain, we handle three cases:
>>
>> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
>> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
>> &drm_bridge_connector.bridge_edid to NULL and set
>> &drm_bridge_connector.bridge_modes to the later bridge.
>> - Ensure modes detection capability of the later bridge will not
>> be ignored.
>>
>> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
>> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
>> &drm_bridge_connector.bridge_modes to NULL and set
>> &drm_bridge_connector.bridge_edid to the later bridge.
>> - Although EDID detection capability has higher priority, this
>> operation is for balance and makes sense.
>>
>> Case 3: the later bridge declares both of them
>> - Assign later bridge as &drm_bridge_connector.bridge_edid and
>> and &drm_bridge_connector.bridge_modes to this bridge.
>> - Just leave transfer of these two capabilities as before.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> ---
>> .../gpu/drm/display/drm_bridge_connector.c | 42 +++++++++++++++++++
>> 1 file changed, 42 insertions(+)
>>
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
> But I'd suggest pulling this to a top of the series to let others also
> take a look at it.
>
Will do in v7.
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-10-01 16:09 ` Luca Ceresoli
2025-10-03 7:34 ` Luca Ceresoli
@ 2025-10-09 4:10 ` Damon Ding
2025-10-10 14:02 ` Dmitry Baryshkov
1 sibling, 1 reply; 30+ messages in thread
From: Damon Ding @ 2025-10-09 4:10 UTC (permalink / raw)
To: Luca Ceresoli, Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hi Luca,
On 10/2/2025 12:09 AM, Luca Ceresoli wrote:
> Hello Damon,
>
> On Tue, 30 Sep 2025 17:09:13 +0800
> Damon Ding <damon.ding@rock-chips.com> wrote:
>
>> When multiple bridges are present, EDID detection capability
>> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
>> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
>> determined by the last bridge in the chain, we handle three cases:
>>
>> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
>> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
>> &drm_bridge_connector.bridge_edid to NULL and set
>> &drm_bridge_connector.bridge_modes to the later bridge.
>> - Ensure modes detection capability of the later bridge will not
>> be ignored.
>>
>> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
>> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
>> &drm_bridge_connector.bridge_modes to NULL and set
>> &drm_bridge_connector.bridge_edid to the later bridge.
>> - Although EDID detection capability has higher priority, this
>> operation is for balance and makes sense.
>>
>> Case 3: the later bridge declares both of them
>> - Assign later bridge as &drm_bridge_connector.bridge_edid and
>> and &drm_bridge_connector.bridge_modes to this bridge.
>> - Just leave transfer of these two capabilities as before.
>
> I think the whole explanation can be more concisely rewritten as:
>
> If the later bridge declares OP_EDID, OP_MODES or both, then both
> .bridge_modes and .bridge_edid should be set to NULL (if any was set
> from a previous bridge), and then .bridge_modes and/or .bridge_edid be
> set to the later bridge as is done already.
>
> Does this look correct (i.e. does it convey the same meaning)?
>
>> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
>> @@ -640,6 +640,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>> struct drm_connector *connector;
>> struct i2c_adapter *ddc = NULL;
>> struct drm_bridge *bridge, *panel_bridge = NULL;
>> + struct drm_bridge *pre_bridge_edid, *pre_bridge_modes;
>> unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
>> unsigned int max_bpc = 8;
>> bool support_hdcp = false;
>> @@ -668,6 +669,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>> */
>> connector_type = DRM_MODE_CONNECTOR_Unknown;
>> drm_for_each_bridge_in_chain(encoder, bridge) {
>> + pre_bridge_edid = bridge_connector->bridge_edid;
>> + pre_bridge_modes = bridge_connector->bridge_modes;
>> +
>> if (!bridge->interlace_allowed)
>> connector->interlace_allowed = false;
>> if (!bridge->ycbcr_420_allowed)
>> @@ -681,6 +685,44 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>> bridge_connector->bridge_detect = bridge;
>> if (bridge->ops & DRM_BRIDGE_OP_MODES)
>> bridge_connector->bridge_modes = bridge;
>> +
>> + /*
>> + * When multiple bridges are present, EDID detection capability
>> + * (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
>> + * (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities
>> + * are determined by the last bridge in the chain, we handle
>> + * three cases:
>> + *
>> + * Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
>> + * - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
>> + * &drm_bridge_connector.bridge_edid to NULL and set
>> + * &drm_bridge_connector.bridge_modes to the later bridge.
>> + * - Ensure modes detection capability of the later bridge
>> + * will not be ignored.
>> + *
>> + * Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
>> + * - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
>> + * &drm_bridge_connector.bridge_modes to NULL and set
>> + * &drm_bridge_connector.bridge_edid to the later bridge.
>> + * - Although EDID detection capability has higher priority,
>> + * this operation is for balance and makes sense.
>> + *
>> + * Case 3: the later bridge declares both of them
>> + * - Assign later bridge as &drm_bridge_connector.bridge_edid
>> + * and &drm_bridge_connector.bridge_modes to this bridge.
>> + * - Just leave transfer of these two capabilities as before.
>> + */
>> + if (bridge->ops & DRM_BRIDGE_OP_EDID &&
>> + !(bridge->ops & DRM_BRIDGE_OP_MODES)) {
>> + if (pre_bridge_modes)
>> + bridge_connector->bridge_modes = NULL;
>> + }
>> + if (bridge->ops & DRM_BRIDGE_OP_MODES &&
>> + !(bridge->ops & DRM_BRIDGE_OP_EDID)) {
>> + if (pre_bridge_edid)
>> + bridge_connector->bridge_edid = NULL;
>> + }
>> +
>
> If the above rewrite is correct, then I think this patch can be
> rewritten in a simple way (build tested only):
>
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index a5bdd6c10643..bd5dbafe88bc 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -672,14 +672,18 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> if (!bridge->ycbcr_420_allowed)
> connector->ycbcr_420_allowed = false;
>
> - if (bridge->ops & DRM_BRIDGE_OP_EDID)
> - bridge_connector->bridge_edid = bridge;
> + if (bridge->ops & DRM_BRIDGE_OP_EDID || bridge->ops & DRM_BRIDGE_OP_MODES) {
> + bridge_connector->bridge_edid = NULL;
> + bridge_connector->bridge_modes = NULL;
> + if (bridge->ops & DRM_BRIDGE_OP_EDID)
> + bridge_connector->bridge_edid = bridge;
> + if (bridge->ops & DRM_BRIDGE_OP_MODES)
> + bridge_connector->bridge_modes = bridge;
> + }
> if (bridge->ops & DRM_BRIDGE_OP_HPD)
> bridge_connector->bridge_hpd = bridge;
> if (bridge->ops & DRM_BRIDGE_OP_DETECT)
> bridge_connector->bridge_detect = bridge;
> - if (bridge->ops & DRM_BRIDGE_OP_MODES)
> - bridge_connector->bridge_modes = bridge;
> if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
> if (bridge_connector->bridge_hdmi)
> return ERR_PTR(-EBUSY);
>
Yes, this is correct and maintains functional equivalence with the
previous implementation.
I previously attempted to implement this feature by modifying the logic
in this section. However, that approach would obscure the explicit
propagation semantics of the bridge chain flags
(OP_EDID/OP_HPD/OP_DETECT/OP_MODES). Therefore, I finally decided to
implemented it as a specific check after this code block.
Dmitry, what's your take on this?
> Another thing to note is that this patch conflicts with [0], which I
> plan to apply in the next few days. The two patches are orthogonal but
> they insist on the same lines (those assigning
> bridge_connector->bridge_* = bridge). Not a big deal, whichever patch
> comes later will be easily adapted. Just wanted to ensure you are aware.
>
> [0] https://lore.kernel.org/all/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com/
>
This is indeed a clever approach to the managing bridge resource cleanup
in drm_bridge_connector. Thanks a lot for the heads-up! I'll resolve
this conflict and rebase the patch series.
Apologies for the delayed reply as I was on vacation. ;-)
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-10-09 4:10 ` Damon Ding
@ 2025-10-10 14:02 ` Dmitry Baryshkov
2025-10-11 1:04 ` Damon Ding
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Baryshkov @ 2025-10-10 14:02 UTC (permalink / raw)
To: Damon Ding
Cc: Luca Ceresoli, andrzej.hajda, neil.armstrong, rfoss,
Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, shawnguo, s.hauer, kernel,
festevam, inki.dae, sw0312.kim, kyungmin.park, krzk, alim.akhtar,
jingoohan1, p.zabel, hjc, heiko, andy.yan, dianders, m.szyprowski,
jani.nikula, linux-kernel, dri-devel, imx, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
On Thu, Oct 09, 2025 at 12:10:42PM +0800, Damon Ding wrote:
> Hi Luca,
>
> On 10/2/2025 12:09 AM, Luca Ceresoli wrote:
> > Hello Damon,
> >
> > On Tue, 30 Sep 2025 17:09:13 +0800
> > Damon Ding <damon.ding@rock-chips.com> wrote:
> >
> > > When multiple bridges are present, EDID detection capability
> > > (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
> > > (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
> > > determined by the last bridge in the chain, we handle three cases:
> > >
> > > Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
> > > - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
> > > &drm_bridge_connector.bridge_edid to NULL and set
> > > &drm_bridge_connector.bridge_modes to the later bridge.
> > > - Ensure modes detection capability of the later bridge will not
> > > be ignored.
> > >
> > > Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
> > > - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
> > > &drm_bridge_connector.bridge_modes to NULL and set
> > > &drm_bridge_connector.bridge_edid to the later bridge.
> > > - Although EDID detection capability has higher priority, this
> > > operation is for balance and makes sense.
> > >
> > > Case 3: the later bridge declares both of them
> > > - Assign later bridge as &drm_bridge_connector.bridge_edid and
> > > and &drm_bridge_connector.bridge_modes to this bridge.
> > > - Just leave transfer of these two capabilities as before.
> >
> > I think the whole explanation can be more concisely rewritten as:
> >
> > If the later bridge declares OP_EDID, OP_MODES or both, then both
> > .bridge_modes and .bridge_edid should be set to NULL (if any was set
> > from a previous bridge), and then .bridge_modes and/or .bridge_edid be
> > set to the later bridge as is done already.
> >
> > Does this look correct (i.e. does it convey the same meaning)?
> >
> > > --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> > > +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> > > @@ -640,6 +640,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > > struct drm_connector *connector;
> > > struct i2c_adapter *ddc = NULL;
> > > struct drm_bridge *bridge, *panel_bridge = NULL;
> > > + struct drm_bridge *pre_bridge_edid, *pre_bridge_modes;
> > > unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
> > > unsigned int max_bpc = 8;
> > > bool support_hdcp = false;
> > > @@ -668,6 +669,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > > */
> > > connector_type = DRM_MODE_CONNECTOR_Unknown;
> > > drm_for_each_bridge_in_chain(encoder, bridge) {
> > > + pre_bridge_edid = bridge_connector->bridge_edid;
> > > + pre_bridge_modes = bridge_connector->bridge_modes;
> > > +
> > > if (!bridge->interlace_allowed)
> > > connector->interlace_allowed = false;
> > > if (!bridge->ycbcr_420_allowed)
> > > @@ -681,6 +685,44 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > > bridge_connector->bridge_detect = bridge;
> > > if (bridge->ops & DRM_BRIDGE_OP_MODES)
> > > bridge_connector->bridge_modes = bridge;
> > > +
> > > + /*
> > > + * When multiple bridges are present, EDID detection capability
> > > + * (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
> > > + * (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities
> > > + * are determined by the last bridge in the chain, we handle
> > > + * three cases:
> > > + *
> > > + * Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
> > > + * - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
> > > + * &drm_bridge_connector.bridge_edid to NULL and set
> > > + * &drm_bridge_connector.bridge_modes to the later bridge.
> > > + * - Ensure modes detection capability of the later bridge
> > > + * will not be ignored.
> > > + *
> > > + * Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
> > > + * - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
> > > + * &drm_bridge_connector.bridge_modes to NULL and set
> > > + * &drm_bridge_connector.bridge_edid to the later bridge.
> > > + * - Although EDID detection capability has higher priority,
> > > + * this operation is for balance and makes sense.
> > > + *
> > > + * Case 3: the later bridge declares both of them
> > > + * - Assign later bridge as &drm_bridge_connector.bridge_edid
> > > + * and &drm_bridge_connector.bridge_modes to this bridge.
> > > + * - Just leave transfer of these two capabilities as before.
> > > + */
> > > + if (bridge->ops & DRM_BRIDGE_OP_EDID &&
> > > + !(bridge->ops & DRM_BRIDGE_OP_MODES)) {
> > > + if (pre_bridge_modes)
> > > + bridge_connector->bridge_modes = NULL;
> > > + }
> > > + if (bridge->ops & DRM_BRIDGE_OP_MODES &&
> > > + !(bridge->ops & DRM_BRIDGE_OP_EDID)) {
> > > + if (pre_bridge_edid)
> > > + bridge_connector->bridge_edid = NULL;
> > > + }
> > > +
> >
> > If the above rewrite is correct, then I think this patch can be
> > rewritten in a simple way (build tested only):
> >
> > diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> > index a5bdd6c10643..bd5dbafe88bc 100644
> > --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> > +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> > @@ -672,14 +672,18 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > if (!bridge->ycbcr_420_allowed)
> > connector->ycbcr_420_allowed = false;
> > - if (bridge->ops & DRM_BRIDGE_OP_EDID)
> > - bridge_connector->bridge_edid = bridge;
> > + if (bridge->ops & DRM_BRIDGE_OP_EDID || bridge->ops & DRM_BRIDGE_OP_MODES) {
> > + bridge_connector->bridge_edid = NULL;
> > + bridge_connector->bridge_modes = NULL;
> > + if (bridge->ops & DRM_BRIDGE_OP_EDID)
> > + bridge_connector->bridge_edid = bridge;
> > + if (bridge->ops & DRM_BRIDGE_OP_MODES)
> > + bridge_connector->bridge_modes = bridge;
> > + }
> > if (bridge->ops & DRM_BRIDGE_OP_HPD)
> > bridge_connector->bridge_hpd = bridge;
> > if (bridge->ops & DRM_BRIDGE_OP_DETECT)
> > bridge_connector->bridge_detect = bridge;
> > - if (bridge->ops & DRM_BRIDGE_OP_MODES)
> > - bridge_connector->bridge_modes = bridge;
> > if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
> > if (bridge_connector->bridge_hdmi)
> > return ERR_PTR(-EBUSY);
> >
>
> Yes, this is correct and maintains functional equivalence with the previous
> implementation.
>
> I previously attempted to implement this feature by modifying the logic in
> this section. However, that approach would obscure the explicit propagation
> semantics of the bridge chain flags (OP_EDID/OP_HPD/OP_DETECT/OP_MODES).
> Therefore, I finally decided to implemented it as a specific check after
> this code block.
>
> Dmitry, what's your take on this?
I think I prefer Luca's code, it is simpler and easier to understand. It
doesn't need a huge comment, something like "leave the last bridge which
provides either OP_EDID or OP_MODES" should be enough.
>
> > Another thing to note is that this patch conflicts with [0], which I
> > plan to apply in the next few days. The two patches are orthogonal but
> > they insist on the same lines (those assigning
> > bridge_connector->bridge_* = bridge). Not a big deal, whichever patch
> > comes later will be easily adapted. Just wanted to ensure you are aware.
> >
> > [0] https://lore.kernel.org/all/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com/
> >
>
> This is indeed a clever approach to the managing bridge resource cleanup in
> drm_bridge_connector. Thanks a lot for the heads-up! I'll resolve this
> conflict and rebase the patch series.
>
> Apologies for the delayed reply as I was on vacation. ;-)
>
> Best regards,
> Damon
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities
2025-10-10 14:02 ` Dmitry Baryshkov
@ 2025-10-11 1:04 ` Damon Ding
0 siblings, 0 replies; 30+ messages in thread
From: Damon Ding @ 2025-10-11 1:04 UTC (permalink / raw)
To: Dmitry Baryshkov, Luca Ceresoli
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, shawnguo, s.hauer, kernel, festevam, inki.dae, sw0312.kim,
kyungmin.park, krzk, alim.akhtar, jingoohan1, p.zabel, hjc, heiko,
andy.yan, dianders, m.szyprowski, jani.nikula, linux-kernel,
dri-devel, imx, linux-arm-kernel, linux-samsung-soc,
linux-rockchip
Hi,
On 10/10/2025 10:02 PM, Dmitry Baryshkov wrote:
> On Thu, Oct 09, 2025 at 12:10:42PM +0800, Damon Ding wrote:
>> Hi Luca,
>>
>> On 10/2/2025 12:09 AM, Luca Ceresoli wrote:
>>> Hello Damon,
>>>
>>> On Tue, 30 Sep 2025 17:09:13 +0800
>>> Damon Ding <damon.ding@rock-chips.com> wrote:
>>>
>>>> When multiple bridges are present, EDID detection capability
>>>> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
>>>> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are
>>>> determined by the last bridge in the chain, we handle three cases:
>>>>
>>>> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
>>>> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
>>>> &drm_bridge_connector.bridge_edid to NULL and set
>>>> &drm_bridge_connector.bridge_modes to the later bridge.
>>>> - Ensure modes detection capability of the later bridge will not
>>>> be ignored.
>>>>
>>>> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
>>>> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
>>>> &drm_bridge_connector.bridge_modes to NULL and set
>>>> &drm_bridge_connector.bridge_edid to the later bridge.
>>>> - Although EDID detection capability has higher priority, this
>>>> operation is for balance and makes sense.
>>>>
>>>> Case 3: the later bridge declares both of them
>>>> - Assign later bridge as &drm_bridge_connector.bridge_edid and
>>>> and &drm_bridge_connector.bridge_modes to this bridge.
>>>> - Just leave transfer of these two capabilities as before.
>>>
>>> I think the whole explanation can be more concisely rewritten as:
>>>
>>> If the later bridge declares OP_EDID, OP_MODES or both, then both
>>> .bridge_modes and .bridge_edid should be set to NULL (if any was set
>>> from a previous bridge), and then .bridge_modes and/or .bridge_edid be
>>> set to the later bridge as is done already.
>>>
>>> Does this look correct (i.e. does it convey the same meaning)?
>>>
>>>> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
>>>> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
>>>> @@ -640,6 +640,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>>> struct drm_connector *connector;
>>>> struct i2c_adapter *ddc = NULL;
>>>> struct drm_bridge *bridge, *panel_bridge = NULL;
>>>> + struct drm_bridge *pre_bridge_edid, *pre_bridge_modes;
>>>> unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
>>>> unsigned int max_bpc = 8;
>>>> bool support_hdcp = false;
>>>> @@ -668,6 +669,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>>> */
>>>> connector_type = DRM_MODE_CONNECTOR_Unknown;
>>>> drm_for_each_bridge_in_chain(encoder, bridge) {
>>>> + pre_bridge_edid = bridge_connector->bridge_edid;
>>>> + pre_bridge_modes = bridge_connector->bridge_modes;
>>>> +
>>>> if (!bridge->interlace_allowed)
>>>> connector->interlace_allowed = false;
>>>> if (!bridge->ycbcr_420_allowed)
>>>> @@ -681,6 +685,44 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>>> bridge_connector->bridge_detect = bridge;
>>>> if (bridge->ops & DRM_BRIDGE_OP_MODES)
>>>> bridge_connector->bridge_modes = bridge;
>>>> +
>>>> + /*
>>>> + * When multiple bridges are present, EDID detection capability
>>>> + * (DRM_BRIDGE_OP_EDID) takes precedence over modes detection
>>>> + * (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities
>>>> + * are determined by the last bridge in the chain, we handle
>>>> + * three cases:
>>>> + *
>>>> + * Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES
>>>> + * - If the previous bridge declares DRM_BRIDGE_OP_EDID, set
>>>> + * &drm_bridge_connector.bridge_edid to NULL and set
>>>> + * &drm_bridge_connector.bridge_modes to the later bridge.
>>>> + * - Ensure modes detection capability of the later bridge
>>>> + * will not be ignored.
>>>> + *
>>>> + * Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID
>>>> + * - If the previous bridge declares DRM_BRIDGE_OP_MODES, set
>>>> + * &drm_bridge_connector.bridge_modes to NULL and set
>>>> + * &drm_bridge_connector.bridge_edid to the later bridge.
>>>> + * - Although EDID detection capability has higher priority,
>>>> + * this operation is for balance and makes sense.
>>>> + *
>>>> + * Case 3: the later bridge declares both of them
>>>> + * - Assign later bridge as &drm_bridge_connector.bridge_edid
>>>> + * and &drm_bridge_connector.bridge_modes to this bridge.
>>>> + * - Just leave transfer of these two capabilities as before.
>>>> + */
>>>> + if (bridge->ops & DRM_BRIDGE_OP_EDID &&
>>>> + !(bridge->ops & DRM_BRIDGE_OP_MODES)) {
>>>> + if (pre_bridge_modes)
>>>> + bridge_connector->bridge_modes = NULL;
>>>> + }
>>>> + if (bridge->ops & DRM_BRIDGE_OP_MODES &&
>>>> + !(bridge->ops & DRM_BRIDGE_OP_EDID)) {
>>>> + if (pre_bridge_edid)
>>>> + bridge_connector->bridge_edid = NULL;
>>>> + }
>>>> +
>>>
>>> If the above rewrite is correct, then I think this patch can be
>>> rewritten in a simple way (build tested only):
>>>
>>> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
>>> index a5bdd6c10643..bd5dbafe88bc 100644
>>> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
>>> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
>>> @@ -672,14 +672,18 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>> if (!bridge->ycbcr_420_allowed)
>>> connector->ycbcr_420_allowed = false;
>>> - if (bridge->ops & DRM_BRIDGE_OP_EDID)
>>> - bridge_connector->bridge_edid = bridge;
>>> + if (bridge->ops & DRM_BRIDGE_OP_EDID || bridge->ops & DRM_BRIDGE_OP_MODES) {
>>> + bridge_connector->bridge_edid = NULL;
>>> + bridge_connector->bridge_modes = NULL;
>>> + if (bridge->ops & DRM_BRIDGE_OP_EDID)
>>> + bridge_connector->bridge_edid = bridge;
>>> + if (bridge->ops & DRM_BRIDGE_OP_MODES)
>>> + bridge_connector->bridge_modes = bridge;
>>> + }
>>> if (bridge->ops & DRM_BRIDGE_OP_HPD)
>>> bridge_connector->bridge_hpd = bridge;
>>> if (bridge->ops & DRM_BRIDGE_OP_DETECT)
>>> bridge_connector->bridge_detect = bridge;
>>> - if (bridge->ops & DRM_BRIDGE_OP_MODES)
>>> - bridge_connector->bridge_modes = bridge;
>>> if (bridge->ops & DRM_BRIDGE_OP_HDMI) {
>>> if (bridge_connector->bridge_hdmi)
>>> return ERR_PTR(-EBUSY);
>>>
>>
>> Yes, this is correct and maintains functional equivalence with the previous
>> implementation.
>>
>> I previously attempted to implement this feature by modifying the logic in
>> this section. However, that approach would obscure the explicit propagation
>> semantics of the bridge chain flags (OP_EDID/OP_HPD/OP_DETECT/OP_MODES).
>> Therefore, I finally decided to implemented it as a specific check after
>> this code block.
>>
>> Dmitry, what's your take on this?
>
> I think I prefer Luca's code, it is simpler and easier to understand. It
> doesn't need a huge comment, something like "leave the last bridge which
> provides either OP_EDID or OP_MODES" should be enough.
>
Yes, I will update the code in v7.
>>
>>> Another thing to note is that this patch conflicts with [0], which I
>>> plan to apply in the next few days. The two patches are orthogonal but
>>> they insist on the same lines (those assigning
>>> bridge_connector->bridge_* = bridge). Not a big deal, whichever patch
>>> comes later will be easily adapted. Just wanted to ensure you are aware.
>>>
>>> [0] https://lore.kernel.org/all/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com/
>>>
>>
>> This is indeed a clever approach to the managing bridge resource cleanup in
>> drm_bridge_connector. Thanks a lot for the heads-up! I'll resolve this
>> conflict and rebase the patch series.
>>
>> Apologies for the delayed reply as I was on vacation. ;-)
Best regards,
Damon
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2025-10-11 1:04 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250930091415eucas1p1f82ef0c96cbe0c7c673d975d502629e2@eucas1p1.samsung.com>
2025-09-30 9:09 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-09-30 9:09 ` [PATCH v6 01/18] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
2025-09-30 9:09 ` [PATCH v6 02/18] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable Damon Ding
2025-09-30 9:09 ` [PATCH v6 03/18] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
2025-09-30 9:09 ` [PATCH v6 04/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
2025-09-30 20:10 ` Dmitry Baryshkov
2025-10-09 1:46 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 05/18] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
2025-09-30 9:09 ` [PATCH v6 06/18] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
2025-09-30 9:09 ` [PATCH v6 07/18] drm/exynos: exynos_dp: Apply legacy bridge to parse the display-timings node Damon Ding
2025-09-30 20:17 ` Dmitry Baryshkov
2025-10-09 2:01 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 08/18] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
2025-09-30 9:09 ` [PATCH v6 09/18] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
2025-09-30 20:18 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 10/18] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
2025-09-30 20:18 ` Dmitry Baryshkov
2025-09-30 9:09 ` [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities Damon Ding
2025-09-30 20:21 ` Dmitry Baryshkov
2025-10-09 3:15 ` Damon Ding
2025-10-01 16:09 ` Luca Ceresoli
2025-10-03 7:34 ` Luca Ceresoli
2025-10-09 4:10 ` Damon Ding
2025-10-10 14:02 ` Dmitry Baryshkov
2025-10-11 1:04 ` Damon Ding
2025-09-30 9:09 ` [PATCH v6 12/18] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2025-09-30 9:09 ` [PATCH v6 13/18] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
2025-09-30 10:17 ` [PATCH v6 00/18] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Marek Szyprowski
2025-10-09 1:29 ` Damon Ding
2025-09-30 20:29 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).