* [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
@ 2025-07-24 8:02 Damon Ding
2025-07-24 8:02 ` [PATCH v3 01/14] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
` (14 more replies)
0 siblings, 15 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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 apply a better API for the encoder initialization.
PATCH 4-7 are preparations for apply drm_bridge_connector helper.
PATCH 8 is to apply the drm_bridge_connector helper.
PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
PATCH 12-13 are preparations for apply panel_bridge helper.
PATCH 14 is to apply the panel_bridge helper.
Damon Ding (14):
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/rockchip: analogix_dp: Apply drmm_encoder_init() instead of
drm_simple_encoder_init()
drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge
drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector
drm/bridge: analogix_dp: Remove redundant
&analogix_dp_plat_data.skip_connector
drm/bridge: analogix_dp: Apply drm_bridge_connector helper
drm/bridge: analogix_dp: Add support to find panel or bridge
drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge()
drm/exynos: exynos_dp: Apply analogix_dp_find_panel_or_bridge()
drm/bridge: analogix_dp: Remove panel disabling and enabling in
analogix_dp_set_bridge()
drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing
in analogix_dp_unbind()
drm/bridge: analogix_dp: Apply panel_bridge helper
.../drm/bridge/analogix/analogix_dp_core.c | 383 ++++++++++--------
.../drm/bridge/analogix/analogix_dp_core.h | 5 +-
drivers/gpu/drm/exynos/exynos_dp.c | 48 +--
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 53 +--
include/drm/bridge/analogix_dp.h | 7 +-
5 files changed, 248 insertions(+), 248 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v3 01/14] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-24 8:02 ` [PATCH v3 02/14] 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; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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>
---
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] 39+ messages in thread
* [PATCH v3 02/14] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-07-24 8:02 ` [PATCH v3 01/14] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-24 8:02 ` [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init() Damon Ding
` (12 subsequent siblings)
14 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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>
---
.../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 ed35e567d117..0106e7e0f093 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1177,12 +1177,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;
@@ -1190,6 +1266,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) {
@@ -1296,83 +1377,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,
@@ -1381,7 +1385,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] 39+ messages in thread
* [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init()
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-07-24 8:02 ` [PATCH v3 01/14] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
2025-07-24 8:02 ` [PATCH v3 02/14] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 0:12 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge Damon Ding
` (11 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
Compared with drm_simple_encoder_init(), drmm_encoder_init() can handle
the cleanup automatically through registering drm_encoder_cleanup() with
drmm_add_action().
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index d30f0983a53a..4ed6bf9e5377 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -29,7 +29,6 @@
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
#include "rockchip_drm_drv.h"
@@ -377,8 +376,7 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
dev->of_node);
DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
- ret = drm_simple_encoder_init(drm_dev, encoder,
- DRM_MODE_ENCODER_TMDS);
+ ret = drmm_encoder_init(drm_dev, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL);
if (ret) {
DRM_ERROR("failed to initialize encoder with drm\n");
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (2 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init() Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 0:15 ` Dmitry Baryshkov
2025-07-29 7:30 ` Maxime Ripard
2025-07-24 8:02 ` [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
` (10 subsequent siblings)
14 siblings, 2 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
In order to move the parnel/bridge parsing and attachmenet to the
Analogix side, add component struct drm_bridge *bridge to platform
data struct analogix_dp_plat_data.
The movemenet 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>
---
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..15cb6b706e9f 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 *bridge;
struct drm_encoder *encoder;
struct drm_connector *connector;
bool skip_connector;
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (3 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 0:15 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
` (9 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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>
------
Changes in v3:
- Fix the typographical error for &dp->plat_data.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..1e8f6b4d399e 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->bridge) {
+ ret = drm_bridge_attach(&dp->encoder, plat_data->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.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.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] 39+ messages in thread
* [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (4 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 0:14 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
` (8 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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>
---
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 1e8f6b4d399e..004ab9db5216 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->bridge) {
ret = drm_bridge_attach(&dp->encoder, plat_data->bridge, bridge,
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (5 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 0:14 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
` (7 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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>
------
Changes in v3:
- Squash the Exynos side commit and the Analogix side commit together.
---
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 0106e7e0f093..8ce7ceb70be4 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1050,7 +1050,7 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (!dp->plat_data->skip_connector) {
+ if (!dp->plat_data->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 004ab9db5216..d8bea1a00815 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -234,7 +234,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
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:
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 15cb6b706e9f..202e5eafb2cc 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 *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] 39+ messages in thread
* [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (6 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-24 13:00 ` Heiko Stübner
2025-07-25 2:26 ` kernel test robot
2025-07-24 8:02 ` [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge Damon Ding
` (6 subsequent siblings)
14 siblings, 2 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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().
Signed-off-by: Damon Ding <damon.ding@rock-chips.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.
---
.../drm/bridge/analogix/analogix_dp_core.c | 145 ++++++++----------
.../drm/bridge/analogix/analogix_dp_core.h | 1 -
drivers/gpu/drm/exynos/exynos_dp.c | 18 ++-
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 11 +-
include/drm/bridge/analogix_dp.h | 3 +-
5 files changed, 88 insertions(+), 90 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 8ce7ceb70be4..938925955ca5 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -947,24 +947,16 @@ 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);
- }
- }
+ if (dp->plat_data->bridge)
+ num_modes += drm_bridge_get_modes(dp->plat_data->bridge, connector);
if (dp->plat_data->get_modes)
num_modes += dp->plat_data->get_modes(dp->plat_data, connector);
@@ -972,51 +964,39 @@ static int analogix_dp_get_modes(struct drm_connector *connector)
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);
+ const struct drm_edid *drm_edid = NULL;
- return dp->encoder;
-}
+ drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc);
+ if (dp->plat_data->get_modes)
+ dp->plat_data->get_modes(dp->plat_data, connector);
-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_connector_state *conn_state;
- struct drm_crtc_state *crtc_state;
+ return drm_edid;
+}
- conn_state = drm_atomic_get_new_connector_state(state, connector);
- if (WARN_ON(!conn_state))
- return -ENODEV;
+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(bridge);
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 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)
@@ -1028,21 +1008,11 @@ 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) {
@@ -1050,31 +1020,8 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (!dp->plat_data->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;
@@ -1178,14 +1125,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);
@@ -1269,7 +1223,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 */
@@ -1385,7 +1339,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)
@@ -1615,6 +1573,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;
@@ -1628,7 +1587,16 @@ 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);
+ bridge->ops = DRM_BRIDGE_OP_DETECT |
+ DRM_BRIDGE_OP_EDID |
+ DRM_BRIDGE_OP_MODES;
+ 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, 0);
if (ret) {
DRM_ERROR("failed to create bridge (%d)\n", ret);
goto err_unregister_aux;
@@ -1646,7 +1614,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);
@@ -1656,7 +1623,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",
@@ -1664,13 +1632,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/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index d8bea1a00815..39dfb7a44c85 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -21,6 +21,7 @@
#include <drm/bridge/analogix_dp.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>
@@ -95,8 +96,7 @@ static int exynos_dp_get_modes(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);
int ret;
@@ -147,6 +147,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;
@@ -168,10 +169,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/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 4ed6bf9e5377..250dc8cf2c38 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>
@@ -392,6 +393,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;
@@ -411,7 +413,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 202e5eafb2cc..5346cb1961c3 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 (*get_modes)(struct analogix_dp_plat_data *,
struct drm_connector *);
};
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (7 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
@ 2025-07-24 8:02 ` Damon Ding
2025-07-26 12:03 ` Dmitry Baryshkov
2025-07-24 8:03 ` [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge() Damon Ding
` (5 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:02 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, 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.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../drm/bridge/analogix/analogix_dp_core.c | 48 +++++++++++++++++++
include/drm/bridge/analogix_dp.h | 2 +
2 files changed, 50 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 938925955ca5..b67087639609 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>
@@ -1671,6 +1673,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->bridge);
+ if (ret && ret != -ENODEV)
+ return ret;
+
+ return component_add(dp->dev, plat_data->ops);
+}
+
+int analogix_dp_find_panel_or_bridge(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_find_panel_or_bridge);
+
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 5346cb1961c3..8558fb9384a1 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 *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 *);
@@ -51,5 +52,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_find_panel_or_bridge(struct analogix_dp_device *dp);
#endif /* _ANALOGIX_DP_H_ */
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge()
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (8 preceding siblings ...)
2025-07-24 8:02 ` [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge Damon Ding
@ 2025-07-24 8:03 ` Damon Ding
2025-07-26 12:03 ` Dmitry Baryshkov
2025-07-24 8:03 ` [PATCH v3 11/14] drm/exynos: exynos_dp: " Damon Ding
` (4 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:03 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
Apply analogix_dp_find_panel_or_bridge() in order to move the
panel/bridge parsing from Rockchip side to the Analogix side.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../gpu/drm/rockchip/analogix_dp-rockchip.c | 38 +------------------
1 file changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 250dc8cf2c38..f92e663dc61a 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -21,14 +21,12 @@
#include <video/of_videomode.h>
#include <video/videomode.h>
-#include <drm/display/drm_dp_aux_bus.h>
#include <drm/display/drm_dp_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge_connector.h>
#include <drm/bridge/analogix_dp.h>
#include <drm/drm_of.h>
-#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include "rockchip_drm_drv.h"
@@ -440,24 +438,6 @@ static const struct component_ops rockchip_dp_component_ops = {
.unbind = rockchip_dp_unbind,
};
-static int rockchip_dp_link_panel(struct drm_dp_aux *aux)
-{
- struct analogix_dp_plat_data *plat_data = analogix_dp_aux_to_plat_data(aux);
- struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
- int ret;
-
- /*
- * If drm_of_find_panel_or_bridge() returns -ENODEV, there may be no valid panel
- * or bridge nodes. The driver should go on for the driver-free bridge or the DP
- * mode applications.
- */
- ret = drm_of_find_panel_or_bridge(dp->dev->of_node, 1, 0, &plat_data->panel, NULL);
- if (ret && ret != -ENODEV)
- return ret;
-
- return component_add(dp->dev, &rockchip_dp_component_ops);
-}
-
static int rockchip_dp_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -497,6 +477,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
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;
+ dp->plat_data.ops = &rockchip_dp_component_ops;
ret = rockchip_dp_of_probe(dp);
if (ret < 0)
@@ -508,22 +489,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- ret = devm_of_dp_aux_populate_bus(analogix_dp_get_aux(dp->adp), rockchip_dp_link_panel);
- if (ret) {
- /*
- * If devm_of_dp_aux_populate_bus() returns -ENODEV, the done_probing() will not
- * be called because there are no EP devices. Then the rockchip_dp_link_panel()
- * will be called directly in order to support the other valid DT configurations.
- *
- * NOTE: The devm_of_dp_aux_populate_bus() is allowed to return -EPROBE_DEFER.
- */
- if (ret != -ENODEV)
- return dev_err_probe(dp->dev, ret, "failed to populate aux bus\n");
-
- return rockchip_dp_link_panel(analogix_dp_get_aux(dp->adp));
- }
-
- return 0;
+ return analogix_dp_find_panel_or_bridge(dp->adp);
}
static void rockchip_dp_remove(struct platform_device *pdev)
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 11/14] drm/exynos: exynos_dp: Apply analogix_dp_find_panel_or_bridge()
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (9 preceding siblings ...)
2025-07-24 8:03 ` [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge() Damon Ding
@ 2025-07-24 8:03 ` Damon Ding
2025-07-26 12:05 ` Dmitry Baryshkov
2025-07-24 8:03 ` [PATCH v3 12/14] drm/bridge: analogix_dp: Remove panel disabling and enabling in analogix_dp_set_bridge() Damon Ding
` (3 subsequent siblings)
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:03 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
Apply analogix_dp_find_panel_or_bridge() in order to move the
panel/bridge parsing from Exynos side to the Analogix side.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/exynos/exynos_dp.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 39dfb7a44c85..c5aa9cc5e2bd 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -203,9 +203,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np;
struct exynos_dp_device *dp;
- struct drm_panel *panel;
- struct drm_bridge *bridge;
- int ret;
dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device),
GFP_KERNEL);
@@ -225,32 +222,31 @@ static int exynos_dp_probe(struct platform_device *pdev)
if (np) {
dp->plat_data.panel = of_drm_find_panel(np);
- of_node_put(np);
if (IS_ERR(dp->plat_data.panel))
return PTR_ERR(dp->plat_data.panel);
goto out;
}
- ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, &bridge);
- if (ret)
- return ret;
-
/* The remote port can be either a panel or a bridge */
- dp->plat_data.panel = panel;
- dp->plat_data.bridge = bridge;
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
dp->plat_data.attach = exynos_dp_bridge_attach;
dp->plat_data.get_modes = exynos_dp_get_modes;
+ dp->plat_data.ops = &exynos_dp_ops;
out:
dp->adp = analogix_dp_probe(dev, &dp->plat_data);
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- return component_add(&pdev->dev, &exynos_dp_ops);
+ if (np) {
+ of_node_put(np);
+ return component_add(&pdev->dev, &exynos_dp_ops);
+ } else {
+ return analogix_dp_find_panel_or_bridge(dp->adp);
+ }
}
static void exynos_dp_remove(struct platform_device *pdev)
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 12/14] drm/bridge: analogix_dp: Remove panel disabling and enabling in analogix_dp_set_bridge()
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (10 preceding siblings ...)
2025-07-24 8:03 ` [PATCH v3 11/14] drm/exynos: exynos_dp: " Damon Ding
@ 2025-07-24 8:03 ` Damon Ding
2025-07-24 8:03 ` [PATCH v3 13/14] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
` (2 subsequent siblings)
14 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:03 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
The &drm_panel_funcs.enable() and &drm_panel_funcs.disable() mainly
help turn on/off the backlight to make the image visible, and the
backlight operations are even needless if drm_panel_of_backlight() or
drm_panel_dp_aux_backlight() is applied, in which case the enabling
and disabling process just add necessary delays.
Therefore, it should make sense to remove panel disabling and move
panel enabling after analogix_dp_set_bridge() finished.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index b67087639609..f4807ef337e6 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -840,9 +840,6 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
{
int ret;
- /* Keep the panel disabled while we configure video */
- drm_panel_disable(dp->plat_data->panel);
-
ret = analogix_dp_train_link(dp);
if (ret) {
dev_err(dp->dev, "unable to do link train, ret=%d\n", ret);
@@ -862,9 +859,6 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
return ret;
}
- /* Safe to enable the panel now */
- drm_panel_enable(dp->plat_data->panel);
-
/* Check whether panel supports fast training */
ret = analogix_dp_fast_link_train_detection(dp);
if (ret)
@@ -1242,6 +1236,7 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,
while (timeout_loop < MAX_PLL_LOCK_LOOP) {
if (analogix_dp_set_bridge(dp) == 0) {
dp->dpms_mode = DRM_MODE_DPMS_ON;
+ drm_panel_enable(dp->plat_data->panel);
return;
}
dev_err(dp->dev, "failed to set bridge, retry: %d\n",
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 13/14] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind()
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (11 preceding siblings ...)
2025-07-24 8:03 ` [PATCH v3 12/14] drm/bridge: analogix_dp: Remove panel disabling and enabling in analogix_dp_set_bridge() Damon Ding
@ 2025-07-24 8:03 ` Damon Ding
2025-07-24 8:03 ` [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2025-07-24 13:10 ` [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Heiko Stübner
14 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:03 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
The analogix_dp_unbind() should be balanced with analogix_dp_bind().
There are no bridge enabling and panel preparing in analogix_dp_bind(),
so it should be reasonable to remove the bridge disabing and panel
unpreparing in analogix_dp_unbind().
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index f4807ef337e6..bf0b1c0912e4 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1610,10 +1610,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
- analogix_dp_bridge_disable(&dp->bridge);
-
- drm_panel_unprepare(dp->plat_data->panel);
-
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (12 preceding siblings ...)
2025-07-24 8:03 ` [PATCH v3 13/14] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
@ 2025-07-24 8:03 ` Damon Ding
2025-07-24 13:08 ` Heiko Stübner
2025-07-24 13:10 ` [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Heiko Stübner
14 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-24 8:03 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, heiko,
andy.yan, dmitry.baryshkov, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip,
Damon Ding
In order to unify the handling of the panel and bridge, apply
panel_bridge helpers for Analogix DP driver. With this patch, the
bridge support will also become available.
The following changes have ben made:
- Apply plane_bridge helper to wrap the panel as the bridge.
- Remove the explicit panel APIs calls, which can be replaced with
the automic bridge APIs calls wrapped by the panel.
- Unify the API of getting modes to drm_bridge_get_modes().
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../drm/bridge/analogix/analogix_dp_core.c | 30 +++++++++++--------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index bf0b1c0912e4..18f631c83300 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -948,11 +948,7 @@ static int analogix_dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_co
struct analogix_dp_device *dp = to_dp(bridge);
int num_modes = 0;
- if (dp->plat_data->panel)
- num_modes += drm_panel_get_modes(dp->plat_data->panel, connector);
-
- if (dp->plat_data->bridge)
- num_modes += drm_bridge_get_modes(dp->plat_data->bridge, connector);
+ num_modes += drm_bridge_get_modes(dp->plat_data->bridge, connector);
if (dp->plat_data->get_modes)
num_modes += dp->plat_data->get_modes(dp->plat_data, connector);
@@ -995,7 +991,7 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge)
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->plat_data->panel)
+ if (drm_bridge_is_panel(dp->plat_data->bridge))
return connector_status_connected;
if (!analogix_dp_detect_hpd(dp))
@@ -1080,8 +1076,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,
/* Don't touch the panel if we're coming back from PSR */
if (old_crtc_state && old_crtc_state->self_refresh_active)
return;
-
- drm_panel_prepare(dp->plat_data->panel);
}
static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
@@ -1236,7 +1230,6 @@ static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge,
while (timeout_loop < MAX_PLL_LOCK_LOOP) {
if (analogix_dp_set_bridge(dp) == 0) {
dp->dpms_mode = DRM_MODE_DPMS_ON;
- drm_panel_enable(dp->plat_data->panel);
return;
}
dev_err(dp->dev, "failed to set bridge, retry: %d\n",
@@ -1254,16 +1247,12 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
return;
- drm_panel_disable(dp->plat_data->panel);
-
disable_irq(dp->irq);
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
pm_runtime_put_sync(dp->dev);
- drm_panel_unprepare(dp->plat_data->panel);
-
dp->fast_train_enable = false;
dp->psr_supported = false;
dp->dpms_mode = DRM_MODE_DPMS_OFF;
@@ -1599,6 +1588,21 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ if (dp->plat_data->panel) {
+ dp->plat_data->bridge = devm_drm_panel_bridge_add(dp->dev, dp->plat_data->panel);
+ if (IS_ERR(dp->plat_data->bridge)) {
+ ret = PTR_ERR(bridge);
+ goto err_unregister_aux;
+ }
+ }
+
+ ret = drm_bridge_attach(dp->encoder, dp->plat_data->bridge, bridge,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ if (ret) {
+ dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
+ goto err_unregister_aux;
+ }
+
return 0;
err_unregister_aux:
--
2.34.1
^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2025-07-24 8:02 ` [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
@ 2025-07-24 13:00 ` Heiko Stübner
2025-07-25 1:47 ` Damon Ding
2025-07-25 2:26 ` kernel test robot
1 sibling, 1 reply; 39+ messages in thread
From: Heiko Stübner @ 2025-07-24 13:00 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
Am Donnerstag, 24. Juli 2025, 10:02:58 Mitteleuropäische Sommerzeit schrieb 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().
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> static enum drm_connector_status
> -analogix_dp_detect(struct drm_connector *connector, bool force)
> +analogix_dp_bridge_detect(struct drm_bridge *bridge)
> {
> - 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)
this needs an update to
static enum drm_connector_status
-analogix_dp_bridge_detect(struct drm_bridge *bridge)
+analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
to follow Andy's patch [0] that got already applied to drm-misc-next
Heiko
[0] https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/5d156a9c3d5ea3dbec192121259dee2c2f938fa1
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper
2025-07-24 8:03 ` [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2025-07-24 13:08 ` Heiko Stübner
2025-07-25 1:57 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Heiko Stübner @ 2025-07-24 13:08 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
Am Donnerstag, 24. Juli 2025, 10:03:04 Mitteleuropäische Sommerzeit schrieb Damon Ding:
> In order to unify the handling of the panel and bridge, apply
> panel_bridge helpers for Analogix DP driver. With this patch, the
> bridge support will also become available.
>
> The following changes have ben made:
> - Apply plane_bridge helper to wrap the panel as the bridge.
> - Remove the explicit panel APIs calls, which can be replaced with
> the automic bridge APIs calls wrapped by the panel.
> - Unify the API of getting modes to drm_bridge_get_modes().
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
To keep the code bisectable, I think patches 12+13+14 need to be one patch?
Removing the panel-handling fefore this conversion to the panel-bridge
would produce a gap, where previously hooked up panels would not work
if a git bisect lands directly before this patch 14, I think
Heiko
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
` (13 preceding siblings ...)
2025-07-24 8:03 ` [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
@ 2025-07-24 13:10 ` Heiko Stübner
2025-07-25 2:15 ` Damon Ding
14 siblings, 1 reply; 39+ messages in thread
From: Heiko Stübner @ 2025-07-24 13:10 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit schrieb 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 apply a better API for the encoder initialization.
> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
> PATCH 8 is to apply the drm_bridge_connector helper.
> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
> PATCH 12-13 are preparations for apply panel_bridge helper.
> PATCH 14 is to apply the panel_bridge helper.
for future revisions, please provide a changelog on what changed since
the previous version, I guess ideally here in the cover-letter.
On my rk3588-tiger-displayport-carrier this works like a charm
Tested-by: Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2025-07-24 13:00 ` Heiko Stübner
@ 2025-07-25 1:47 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-25 1:47 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 2025/7/24 21:00, Heiko Stübner wrote:
> Hi Damon,
>
> Am Donnerstag, 24. Juli 2025, 10:02:58 Mitteleuropäische Sommerzeit schrieb 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().
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>
>> static enum drm_connector_status
>> -analogix_dp_detect(struct drm_connector *connector, bool force)
>> +analogix_dp_bridge_detect(struct drm_bridge *bridge)
>> {
>> - 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)
>
> this needs an update to
>
> static enum drm_connector_status
> -analogix_dp_bridge_detect(struct drm_bridge *bridge)
> +analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
>
> to follow Andy's patch [0] that got already applied to drm-misc-next
>
> Heiko
>
>
> [0] https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/5d156a9c3d5ea3dbec192121259dee2c2f938fa1
>
>
>
I will update it in the next version.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper
2025-07-24 13:08 ` Heiko Stübner
@ 2025-07-25 1:57 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-25 1:57 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 2025/7/24 21:08, Heiko Stübner wrote:
> Hi Damon,
>
> Am Donnerstag, 24. Juli 2025, 10:03:04 Mitteleuropäische Sommerzeit schrieb Damon Ding:
>> In order to unify the handling of the panel and bridge, apply
>> panel_bridge helpers for Analogix DP driver. With this patch, the
>> bridge support will also become available.
>>
>> The following changes have ben made:
>> - Apply plane_bridge helper to wrap the panel as the bridge.
>> - Remove the explicit panel APIs calls, which can be replaced with
>> the automic bridge APIs calls wrapped by the panel.
>> - Unify the API of getting modes to drm_bridge_get_modes().
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>
> To keep the code bisectable, I think patches 12+13+14 need to be one patch?
> Removing the panel-handling fefore this conversion to the panel-bridge
> would produce a gap, where previously hooked up panels would not work
> if a git bisect lands directly before this patch 14, I think
>
>
> Heiko
>
>
As expected, patch 12 and patch 13 should remain functionally
independent. They should be logically self-contained even without patch
14. Otherwise, patch 14 would need to incorporate those panel operations
via panel_bridge as well.
Both patch 12 and patch 13 have been independently validated on the
RK3588S EVB1.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-24 13:10 ` [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Heiko Stübner
@ 2025-07-25 2:15 ` Damon Ding
2025-07-25 19:45 ` Heiko Stübner
0 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-25 2:15 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 2025/7/24 21:10, Heiko Stübner wrote:
> Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit schrieb 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 apply a better API for the encoder initialization.
>> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
>> PATCH 8 is to apply the drm_bridge_connector helper.
>> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
>> PATCH 12-13 are preparations for apply panel_bridge helper.
>> PATCH 14 is to apply the panel_bridge helper.
>
> for future revisions, please provide a changelog on what changed since
> the previous version, I guess ideally here in the cover-letter.
>
>
> On my rk3588-tiger-displayport-carrier this works like a charm
> Tested-by: Heiko Stuebner <heiko@sntech.de>
>
>
>
>
Glad to see your review and test. :-)
I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
in the next iteration.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
2025-07-24 8:02 ` [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2025-07-24 13:00 ` Heiko Stübner
@ 2025-07-25 2:26 ` kernel test robot
1 sibling, 0 replies; 39+ messages in thread
From: kernel test robot @ 2025-07-25 2:26 UTC (permalink / raw)
To: Damon Ding, andrzej.hajda, neil.armstrong, rfoss
Cc: llvm, oe-kbuild-all, Laurent.pinchart, jonas, jernej.skrabec,
maarten.lankhorst, mripard, tzimmermann, airlied, simona,
jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, dmitry.baryshkov, l.stach,
dianders, dri-devel, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on next-20250724]
[cannot apply to drm-exynos/exynos-drm-next rockchip/for-next linus/master v6.16-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Formalize-the-struct-analogix_dp_device/20250724-160804
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20250724080304.3572457-9-damon.ding%40rock-chips.com
patch subject: [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper
config: x86_64-buildonly-randconfig-003-20250725 (https://download.01.org/0day-ci/archive/20250725/202507251021.A6WmQ4di-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250725/202507251021.A6WmQ4di-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507251021.A6WmQ4di-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1346:12: error: incompatible function pointer types initializing 'enum drm_connector_status (*)(struct drm_bridge *, struct drm_connector *)' with an expression of type 'enum drm_connector_status (struct drm_bridge *)' [-Wincompatible-function-pointer-types]
1346 | .detect = analogix_dp_bridge_detect,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
vim +1346 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
1333
1334 static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
1335 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
1336 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
1337 .atomic_reset = drm_atomic_helper_bridge_reset,
1338 .atomic_pre_enable = analogix_dp_bridge_atomic_pre_enable,
1339 .atomic_enable = analogix_dp_bridge_atomic_enable,
1340 .atomic_disable = analogix_dp_bridge_atomic_disable,
1341 .atomic_post_disable = analogix_dp_bridge_atomic_post_disable,
1342 .atomic_check = analogix_dp_bridge_atomic_check,
1343 .attach = analogix_dp_bridge_attach,
1344 .get_modes = analogix_dp_bridge_get_modes,
1345 .edid_read = analogix_dp_bridge_edid_read,
> 1346 .detect = analogix_dp_bridge_detect,
1347 };
1348
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-25 2:15 ` Damon Ding
@ 2025-07-25 19:45 ` Heiko Stübner
2025-07-29 3:02 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Heiko Stübner @ 2025-07-25 19:45 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Damon,
Am Freitag, 25. Juli 2025, 04:15:06 Mitteleuropäische Sommerzeit schrieb Damon Ding:
> On 2025/7/24 21:10, Heiko Stübner wrote:
> > Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit schrieb 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 apply a better API for the encoder initialization.
> >> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
> >> PATCH 8 is to apply the drm_bridge_connector helper.
> >> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
> >> PATCH 12-13 are preparations for apply panel_bridge helper.
> >> PATCH 14 is to apply the panel_bridge helper.
> >
> > for future revisions, please provide a changelog on what changed since
> > the previous version, I guess ideally here in the cover-letter.
> >
> >
> > On my rk3588-tiger-displayport-carrier this works like a charm
> > Tested-by: Heiko Stuebner <heiko@sntech.de>
> >
> >
> >
> >
>
> Glad to see your review and test. :-)
>
> I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
> in the next iteration.
I have to amend that a bit, sadly. When doing a reboot with the edp
running, I see logs like:
[...]
[ 139.614749] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 139.622201] systemd-shutdown[1]: Rebooting.
[ 139.684845] ------------[ cut here ]------------
[ 139.690050] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-iommu.c:989 rk_iommu_identity_attach+0xac/0xbc
[ 139.701175] Modules linked in: panthor rockchip_vdec rocket drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper v4l2_mem2mem gpu_sched rng_core fuse
[ 139.717685] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Not tainted 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
[ 139.728799] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger Displayport Carrier v1 (DT)
[ 139.738548] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 139.746351] pc : rk_iommu_identity_attach+0xac/0xbc
[ 139.751821] lr : rk_iommu_identity_attach+0x70/0xbc
[ 139.757290] sp : ffff800080e4b7c0
[ 139.761001] x29: ffff800080e4b7c0 x28: ffff0001f6f98080 x27: ffff0001f0a4b010
[ 139.769006] x26: ffff0001f6f98e58 x25: 0000000000000000 x24: 0000000000000000
[ 139.777010] x23: 0000000000000000 x22: ffffdbf23c0485e0 x21: ffff0001f0e9cc10
[ 139.785014] x20: ffff0001f0df17a0 x19: ffff0001f0e2cb80 x18: 0000000000000038
[ 139.793018] x17: 0002550800000009 x16: 0000046c0446043e x15: 0438000008ca080c
[ 139.801021] x14: 07d008ca07800780 x13: 0438000008ca080c x12: 07d0078000025508
[ 139.809024] x11: 0002550800000009 x10: 0000046c0446043e x9 : ffffdbf23c137000
[ 139.817031] x8 : 0000000000000438 x7 : 0000000000000000 x6 : 0000000000000000
[ 139.825034] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 : ffff0001f0df1780
[ 139.833038] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 : 00000000ffffffea
[ 139.841042] Call trace:
[ 139.843780] rk_iommu_identity_attach+0xac/0xbc (P)
[ 139.849252] rk_iommu_attach_device+0x54/0x134
[ 139.854236] __iommu_device_set_domain+0x7c/0x110
[ 139.859510] __iommu_group_set_domain_internal+0x60/0x134
[ 139.865561] __iommu_attach_group+0x88/0x9c
[ 139.870250] iommu_attach_device+0x68/0xa0
[ 139.874841] rockchip_drm_dma_attach_device+0x28/0x7c
[ 139.880508] vop2_crtc_atomic_enable+0x620/0xaa0
[ 139.885678] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
[ 139.892413] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
[ 139.898369] commit_tail+0xa0/0x1a0
[ 139.902279] drm_atomic_helper_commit+0x17c/0x1b0
[ 139.907552] drm_atomic_commit+0x8c/0xcc
[ 139.911951] drm_client_modeset_commit_atomic+0x228/0x298
[ 139.918005] drm_client_modeset_commit_locked+0x5c/0x188
[ 139.923960] drm_client_modeset_commit+0x2c/0x58
[ 139.929137] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
[ 139.936164] drm_fb_helper_hotplug_event+0xe8/0xf8
[ 139.941526] drm_fbdev_client_hotplug+0x24/0xe0
[ 139.946605] drm_client_hotplug+0x48/0xc4
[ 139.951100] drm_client_dev_hotplug+0x9c/0xd4
[ 139.955984] drm_kms_helper_connector_hotplug_event+0x20/0x30
[ 139.962426] drm_bridge_connector_hpd_cb+0x88/0xa0
[ 139.967790] drm_bridge_hpd_notify+0x3c/0x60
[ 139.972577] display_connector_hpd_irq+0x30/0xa4
[ 139.978835] irq_thread_fn+0x2c/0xb0
[ 139.983894] irq_thread+0x170/0x304
[ 139.988833] kthread+0x12c/0x204
[ 139.993468] ret_from_fork+0x10/0x20
[ 139.998486] ---[ end trace 0000000000000000 ]---
[ 140.004737] ------------[ cut here ]------------
[ 140.010884] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-iommu.c:1040 rk_iommu_attach_device+0x114/0x134
[ 140.023079] Modules linked in: panthor rockchip_vdec rocket drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper v4l2_mem2mem gpu_sched rng_core fuse
[ 140.040577] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Tainted: G W 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
[ 140.054457] Tainted: [W]=WARN
[ 140.058804] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger Displayport Carrier v1 (DT)
[ 140.069595] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 140.078454] pc : rk_iommu_attach_device+0x114/0x134
[ 140.084989] lr : rk_iommu_attach_device+0x98/0x134
[ 140.091423] sp : ffff800080e4b7e0
[ 140.096197] x29: ffff800080e4b7e0 x28: ffff0001f6f98080 x27: ffff0001f0a4b010
[ 140.105270] x26: ffff0001f6f98e58 x25: 0000000000000000 x24: 0000000000000000
[ 140.114351] x23: ffff0001f6f843e0 x22: ffffdbf23c0485e0 x21: ffff0001f0e9cc10
[ 140.123425] x20: ffff0001f0e2cb80 x19: ffff0001f6f843c0 x18: 0000000000000038
[ 140.132489] x17: 0002550800000009 x16: 0000046c0446043e x15: 0438000008ca080c
[ 140.141552] x14: 07d008ca07800780 x13: 0438000008ca080c x12: 07d0078000025508
[ 140.150623] x11: 0002550800000009 x10: 0000046c0446043e x9 : ffffdbf23c137000
[ 140.159701] x8 : 0000000000000438 x7 : 0000000000000000 x6 : 0000000000000000
[ 140.168772] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 : ffff0001f0e2cbe0
[ 140.177825] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 : 00000000ffffffea
[ 140.186858] Call trace:
[ 140.190627] rk_iommu_attach_device+0x114/0x134 (P)
[ 140.197124] __iommu_device_set_domain+0x7c/0x110
[ 140.203417] __iommu_group_set_domain_internal+0x60/0x134
[ 140.210492] __iommu_attach_group+0x88/0x9c
[ 140.216203] iommu_attach_device+0x68/0xa0
[ 140.221802] rockchip_drm_dma_attach_device+0x28/0x7c
[ 140.228479] vop2_crtc_atomic_enable+0x620/0xaa0
[ 140.234664] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
[ 140.242400] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
[ 140.249349] commit_tail+0xa0/0x1a0
[ 140.254246] drm_atomic_helper_commit+0x17c/0x1b0
[ 140.260496] drm_atomic_commit+0x8c/0xcc
[ 140.265866] drm_client_modeset_commit_atomic+0x228/0x298
[ 140.272885] drm_client_modeset_commit_locked+0x5c/0x188
[ 140.279791] drm_client_modeset_commit+0x2c/0x58
[ 140.285914] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
[ 140.293889] drm_fb_helper_hotplug_event+0xe8/0xf8
[ 140.300214] drm_fbdev_client_hotplug+0x24/0xe0
[ 140.306248] drm_client_hotplug+0x48/0xc4
[ 140.311695] drm_client_dev_hotplug+0x9c/0xd4
[ 140.317531] drm_kms_helper_connector_hotplug_event+0x20/0x30
[ 140.324930] drm_bridge_connector_hpd_cb+0x88/0xa0
[ 140.331248] drm_bridge_hpd_notify+0x3c/0x60
[ 140.336990] display_connector_hpd_irq+0x30/0xa4
[ 140.343120] irq_thread_fn+0x2c/0xb0
[ 140.348081] irq_thread+0x170/0x304
[ 140.352937] kthread+0x12c/0x204
[ 140.357501] ret_from_fork+0x10/0x20
[ 140.362453] ---[ end trace 0000000000000000 ]---
After some minutes of hanging it does reboot afterall.
Heiko
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init()
2025-07-24 8:02 ` [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init() Damon Ding
@ 2025-07-26 0:12 ` Dmitry Baryshkov
2025-07-29 3:22 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 0:12 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:53PM +0800, Damon Ding wrote:
> Compared with drm_simple_encoder_init(), drmm_encoder_init() can handle
> the cleanup automatically through registering drm_encoder_cleanup() with
> drmm_add_action().
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> ---
> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index d30f0983a53a..4ed6bf9e5377 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -29,7 +29,6 @@
> #include <drm/drm_of.h>
> #include <drm/drm_panel.h>
> #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>
> #include "rockchip_drm_drv.h"
>
> @@ -377,8 +376,7 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
> dev->of_node);
> DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
>
> - ret = drm_simple_encoder_init(drm_dev, encoder,
> - DRM_MODE_ENCODER_TMDS);
> + ret = drmm_encoder_init(drm_dev, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL);
It's not possible to use drmm_encoder_init() here. Per the documentation
the encoder data structure should be allocated by drmm_kzalloc().
However this drm_encoder is a part of struct rockchip_dp_device. It's
allocated by rockchip_dp_probe() via devm_kzalloc(). This means that it
can potentially be freed before the drm device is completely released,
creating a use-after-free error.
> if (ret) {
> DRM_ERROR("failed to initialize encoder with drm\n");
> return ret;
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector
2025-07-24 8:02 ` [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
@ 2025-07-26 0:14 ` Dmitry Baryshkov
0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 0:14 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:57PM +0800, Damon Ding wrote:
> 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>
>
> ------
>
> Changes in v3:
> - Squash the Exynos side commit and the Analogix side commit together.
> ---
> 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(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector
2025-07-24 8:02 ` [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
@ 2025-07-26 0:14 ` Dmitry Baryshkov
0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 0:14 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:56PM +0800, Damon Ding wrote:
> 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>
> ---
> drivers/gpu/drm/exynos/exynos_dp.c | 3 ---
> 1 file changed, 3 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge
2025-07-24 8:02 ` [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
@ 2025-07-26 0:15 ` Dmitry Baryshkov
0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 0:15 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:55PM +0800, Damon Ding wrote:
> Use &analogix_dp_plat_data.bridge instead of &exynos_dp_device.ptn_bridge
> directly.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>
> ------
>
> Changes in v3:
> - Fix the typographical error for &dp->plat_data.bridge.
> ---
> drivers/gpu/drm/exynos/exynos_dp.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge
2025-07-24 8:02 ` [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge Damon Ding
@ 2025-07-26 0:15 ` Dmitry Baryshkov
2025-07-29 7:30 ` Maxime Ripard
1 sibling, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 0:15 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:54PM +0800, Damon Ding wrote:
> In order to move the parnel/bridge parsing and attachmenet to the
> Analogix side, add component struct drm_bridge *bridge to platform
> data struct analogix_dp_plat_data.
>
> The movemenet 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>
> ---
> include/drm/bridge/analogix_dp.h | 1 +
> 1 file changed, 1 insertion(+)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge
2025-07-24 8:02 ` [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge Damon Ding
@ 2025-07-26 12:03 ` Dmitry Baryshkov
2025-07-29 3:09 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 12:03 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:02:59PM +0800, Damon Ding wrote:
> 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.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> ---
> .../drm/bridge/analogix/analogix_dp_core.c | 48 +++++++++++++++++++
> include/drm/bridge/analogix_dp.h | 2 +
> 2 files changed, 50 insertions(+)
>
> +int analogix_dp_find_panel_or_bridge(struct analogix_dp_device *dp)
Nit: the API does more than just finding the panel or bridge. Also the
drivers use it in a more of 'analogix_dp_finish_probe()' manner.
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge()
2025-07-24 8:03 ` [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge() Damon Ding
@ 2025-07-26 12:03 ` Dmitry Baryshkov
0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 12:03 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:03:00PM +0800, Damon Ding wrote:
> Apply analogix_dp_find_panel_or_bridge() in order to move the
> panel/bridge parsing from Rockchip side to the Analogix side.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> ---
> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 38 +------------------
> 1 file changed, 2 insertions(+), 36 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 11/14] drm/exynos: exynos_dp: Apply analogix_dp_find_panel_or_bridge()
2025-07-24 8:03 ` [PATCH v3 11/14] drm/exynos: exynos_dp: " Damon Ding
@ 2025-07-26 12:05 ` Dmitry Baryshkov
0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Baryshkov @ 2025-07-26 12:05 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
On Thu, Jul 24, 2025 at 04:03:01PM +0800, Damon Ding wrote:
> Apply analogix_dp_find_panel_or_bridge() in order to move the
> panel/bridge parsing from Exynos side to the Analogix side.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> ---
> drivers/gpu/drm/exynos/exynos_dp.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-25 19:45 ` Heiko Stübner
@ 2025-07-29 3:02 ` Damon Ding
2025-07-29 3:16 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-29 3:02 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 2025/7/26 3:45, Heiko Stübner wrote:
> Hi Damon,
> Am Freitag, 25. Juli 2025, 04:15:06 Mitteleuropäische Sommerzeit schrieb Damon Ding:
>> On 2025/7/24 21:10, Heiko Stübner wrote:
>>> Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit schrieb 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 apply a better API for the encoder initialization.
>>>> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
>>>> PATCH 8 is to apply the drm_bridge_connector helper.
>>>> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
>>>> PATCH 12-13 are preparations for apply panel_bridge helper.
>>>> PATCH 14 is to apply the panel_bridge helper.
>>>
>>> for future revisions, please provide a changelog on what changed since
>>> the previous version, I guess ideally here in the cover-letter.
>>>
>>>
>>> On my rk3588-tiger-displayport-carrier this works like a charm
>>> Tested-by: Heiko Stuebner <heiko@sntech.de>
>>>
>>>
>>>
>>>
>>
>> Glad to see your review and test. :-)
>>
>> I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
>> in the next iteration.
>
> I have to amend that a bit, sadly. When doing a reboot with the edp
> running, I see logs like:
>
> [...]
> [ 139.614749] systemd-shutdown[1]: Syncing filesystems and block devices.
> [ 139.622201] systemd-shutdown[1]: Rebooting.
> [ 139.684845] ------------[ cut here ]------------
> [ 139.690050] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-iommu.c:989 rk_iommu_identity_attach+0xac/0xbc
> [ 139.701175] Modules linked in: panthor rockchip_vdec rocket drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper v4l2_mem2mem gpu_sched rng_core fuse
> [ 139.717685] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Not tainted 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
> [ 139.728799] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger Displayport Carrier v1 (DT)
> [ 139.738548] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [ 139.746351] pc : rk_iommu_identity_attach+0xac/0xbc
> [ 139.751821] lr : rk_iommu_identity_attach+0x70/0xbc
> [ 139.757290] sp : ffff800080e4b7c0
> [ 139.761001] x29: ffff800080e4b7c0 x28: ffff0001f6f98080 x27: ffff0001f0a4b010
> [ 139.769006] x26: ffff0001f6f98e58 x25: 0000000000000000 x24: 0000000000000000
> [ 139.777010] x23: 0000000000000000 x22: ffffdbf23c0485e0 x21: ffff0001f0e9cc10
> [ 139.785014] x20: ffff0001f0df17a0 x19: ffff0001f0e2cb80 x18: 0000000000000038
> [ 139.793018] x17: 0002550800000009 x16: 0000046c0446043e x15: 0438000008ca080c
> [ 139.801021] x14: 07d008ca07800780 x13: 0438000008ca080c x12: 07d0078000025508
> [ 139.809024] x11: 0002550800000009 x10: 0000046c0446043e x9 : ffffdbf23c137000
> [ 139.817031] x8 : 0000000000000438 x7 : 0000000000000000 x6 : 0000000000000000
> [ 139.825034] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 : ffff0001f0df1780
> [ 139.833038] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 : 00000000ffffffea
> [ 139.841042] Call trace:
> [ 139.843780] rk_iommu_identity_attach+0xac/0xbc (P)
> [ 139.849252] rk_iommu_attach_device+0x54/0x134
> [ 139.854236] __iommu_device_set_domain+0x7c/0x110
> [ 139.859510] __iommu_group_set_domain_internal+0x60/0x134
> [ 139.865561] __iommu_attach_group+0x88/0x9c
> [ 139.870250] iommu_attach_device+0x68/0xa0
> [ 139.874841] rockchip_drm_dma_attach_device+0x28/0x7c
> [ 139.880508] vop2_crtc_atomic_enable+0x620/0xaa0
> [ 139.885678] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
> [ 139.892413] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
> [ 139.898369] commit_tail+0xa0/0x1a0
> [ 139.902279] drm_atomic_helper_commit+0x17c/0x1b0
> [ 139.907552] drm_atomic_commit+0x8c/0xcc
> [ 139.911951] drm_client_modeset_commit_atomic+0x228/0x298
> [ 139.918005] drm_client_modeset_commit_locked+0x5c/0x188
> [ 139.923960] drm_client_modeset_commit+0x2c/0x58
> [ 139.929137] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
> [ 139.936164] drm_fb_helper_hotplug_event+0xe8/0xf8
> [ 139.941526] drm_fbdev_client_hotplug+0x24/0xe0
> [ 139.946605] drm_client_hotplug+0x48/0xc4
> [ 139.951100] drm_client_dev_hotplug+0x9c/0xd4
> [ 139.955984] drm_kms_helper_connector_hotplug_event+0x20/0x30
> [ 139.962426] drm_bridge_connector_hpd_cb+0x88/0xa0
> [ 139.967790] drm_bridge_hpd_notify+0x3c/0x60
> [ 139.972577] display_connector_hpd_irq+0x30/0xa4
> [ 139.978835] irq_thread_fn+0x2c/0xb0
> [ 139.983894] irq_thread+0x170/0x304
> [ 139.988833] kthread+0x12c/0x204
> [ 139.993468] ret_from_fork+0x10/0x20
> [ 139.998486] ---[ end trace 0000000000000000 ]---
> [ 140.004737] ------------[ cut here ]------------
> [ 140.010884] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-iommu.c:1040 rk_iommu_attach_device+0x114/0x134
> [ 140.023079] Modules linked in: panthor rockchip_vdec rocket drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper v4l2_mem2mem gpu_sched rng_core fuse
> [ 140.040577] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Tainted: G W 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
> [ 140.054457] Tainted: [W]=WARN
> [ 140.058804] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger Displayport Carrier v1 (DT)
> [ 140.069595] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [ 140.078454] pc : rk_iommu_attach_device+0x114/0x134
> [ 140.084989] lr : rk_iommu_attach_device+0x98/0x134
> [ 140.091423] sp : ffff800080e4b7e0
> [ 140.096197] x29: ffff800080e4b7e0 x28: ffff0001f6f98080 x27: ffff0001f0a4b010
> [ 140.105270] x26: ffff0001f6f98e58 x25: 0000000000000000 x24: 0000000000000000
> [ 140.114351] x23: ffff0001f6f843e0 x22: ffffdbf23c0485e0 x21: ffff0001f0e9cc10
> [ 140.123425] x20: ffff0001f0e2cb80 x19: ffff0001f6f843c0 x18: 0000000000000038
> [ 140.132489] x17: 0002550800000009 x16: 0000046c0446043e x15: 0438000008ca080c
> [ 140.141552] x14: 07d008ca07800780 x13: 0438000008ca080c x12: 07d0078000025508
> [ 140.150623] x11: 0002550800000009 x10: 0000046c0446043e x9 : ffffdbf23c137000
> [ 140.159701] x8 : 0000000000000438 x7 : 0000000000000000 x6 : 0000000000000000
> [ 140.168772] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 : ffff0001f0e2cbe0
> [ 140.177825] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 : 00000000ffffffea
> [ 140.186858] Call trace:
> [ 140.190627] rk_iommu_attach_device+0x114/0x134 (P)
> [ 140.197124] __iommu_device_set_domain+0x7c/0x110
> [ 140.203417] __iommu_group_set_domain_internal+0x60/0x134
> [ 140.210492] __iommu_attach_group+0x88/0x9c
> [ 140.216203] iommu_attach_device+0x68/0xa0
> [ 140.221802] rockchip_drm_dma_attach_device+0x28/0x7c
> [ 140.228479] vop2_crtc_atomic_enable+0x620/0xaa0
> [ 140.234664] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
> [ 140.242400] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
> [ 140.249349] commit_tail+0xa0/0x1a0
> [ 140.254246] drm_atomic_helper_commit+0x17c/0x1b0
> [ 140.260496] drm_atomic_commit+0x8c/0xcc
> [ 140.265866] drm_client_modeset_commit_atomic+0x228/0x298
> [ 140.272885] drm_client_modeset_commit_locked+0x5c/0x188
> [ 140.279791] drm_client_modeset_commit+0x2c/0x58
> [ 140.285914] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
> [ 140.293889] drm_fb_helper_hotplug_event+0xe8/0xf8
> [ 140.300214] drm_fbdev_client_hotplug+0x24/0xe0
> [ 140.306248] drm_client_hotplug+0x48/0xc4
> [ 140.311695] drm_client_dev_hotplug+0x9c/0xd4
> [ 140.317531] drm_kms_helper_connector_hotplug_event+0x20/0x30
> [ 140.324930] drm_bridge_connector_hpd_cb+0x88/0xa0
> [ 140.331248] drm_bridge_hpd_notify+0x3c/0x60
> [ 140.336990] display_connector_hpd_irq+0x30/0xa4
> [ 140.343120] irq_thread_fn+0x2c/0xb0
> [ 140.348081] irq_thread+0x170/0x304
> [ 140.352937] kthread+0x12c/0x204
> [ 140.357501] ret_from_fork+0x10/0x20
> [ 140.362453] ---[ end trace 0000000000000000 ]---
>
>
> After some minutes of hanging it does reboot afterall.
>
> Heiko
>
>
Could you please help confirm whether the same error still occurs with
this patch series under the same conditions?
And I will also perform additional verification on my RK3588S EVB1 board.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge
2025-07-26 12:03 ` Dmitry Baryshkov
@ 2025-07-29 3:09 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-29 3:09 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Dmitry,
On 2025/7/26 20:03, Dmitry Baryshkov wrote:
> On Thu, Jul 24, 2025 at 04:02:59PM +0800, Damon Ding wrote:
>> 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.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> ---
>> .../drm/bridge/analogix/analogix_dp_core.c | 48 +++++++++++++++++++
>> include/drm/bridge/analogix_dp.h | 2 +
>> 2 files changed, 50 insertions(+)
>>
>> +int analogix_dp_find_panel_or_bridge(struct analogix_dp_device *dp)
>
> Nit: the API does more than just finding the panel or bridge. Also the
> drivers use it in a more of 'analogix_dp_finish_probe()' manner.
>
>>
>
Yes, since the new API also includes component_add(), it would be better
to rename it.
And the commit message will be expanded in the next version.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-29 3:02 ` Damon Ding
@ 2025-07-29 3:16 ` Damon Ding
2025-08-06 19:54 ` Heiko Stübner
0 siblings, 1 reply; 39+ messages in thread
From: Damon Ding @ 2025-07-29 3:16 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
On 2025/7/29 11:02, Damon Ding wrote:
> Hi Heiko,
>
> On 2025/7/26 3:45, Heiko Stübner wrote:
>> Hi Damon,
>> Am Freitag, 25. Juli 2025, 04:15:06 Mitteleuropäische Sommerzeit
>> schrieb Damon Ding:
>>> On 2025/7/24 21:10, Heiko Stübner wrote:
>>>> Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit
>>>> schrieb 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 apply a better API for the encoder initialization.
>>>>> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
>>>>> PATCH 8 is to apply the drm_bridge_connector helper.
>>>>> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
>>>>> PATCH 12-13 are preparations for apply panel_bridge helper.
>>>>> PATCH 14 is to apply the panel_bridge helper.
>>>>
>>>> for future revisions, please provide a changelog on what changed since
>>>> the previous version, I guess ideally here in the cover-letter.
>>>>
>>>>
>>>> On my rk3588-tiger-displayport-carrier this works like a charm
>>>> Tested-by: Heiko Stuebner <heiko@sntech.de>
>>>>
>>>>
>>>>
>>>>
>>>
>>> Glad to see your review and test. :-)
>>>
>>> I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
>>> in the next iteration.
>>
>> I have to amend that a bit, sadly. When doing a reboot with the edp
>> running, I see logs like:
>>
>> [...]
>> [ 139.614749] systemd-shutdown[1]: Syncing filesystems and block
>> devices.
>> [ 139.622201] systemd-shutdown[1]: Rebooting.
>> [ 139.684845] ------------[ cut here ]------------
>> [ 139.690050] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
>> iommu.c:989 rk_iommu_identity_attach+0xac/0xbc
>> [ 139.701175] Modules linked in: panthor rockchip_vdec rocket
>> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
>> v4l2_mem2mem gpu_sched rng_core fuse
>> [ 139.717685] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Not tainted
>> 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
>> [ 139.728799] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
>> Displayport Carrier v1 (DT)
>> [ 139.738548] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
>> BTYPE=--)
>> [ 139.746351] pc : rk_iommu_identity_attach+0xac/0xbc
>> [ 139.751821] lr : rk_iommu_identity_attach+0x70/0xbc
>> [ 139.757290] sp : ffff800080e4b7c0
>> [ 139.761001] x29: ffff800080e4b7c0 x28: ffff0001f6f98080 x27:
>> ffff0001f0a4b010
>> [ 139.769006] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
>> 0000000000000000
>> [ 139.777010] x23: 0000000000000000 x22: ffffdbf23c0485e0 x21:
>> ffff0001f0e9cc10
>> [ 139.785014] x20: ffff0001f0df17a0 x19: ffff0001f0e2cb80 x18:
>> 0000000000000038
>> [ 139.793018] x17: 0002550800000009 x16: 0000046c0446043e x15:
>> 0438000008ca080c
>> [ 139.801021] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
>> 07d0078000025508
>> [ 139.809024] x11: 0002550800000009 x10: 0000046c0446043e x9 :
>> ffffdbf23c137000
>> [ 139.817031] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
>> 0000000000000000
>> [ 139.825034] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
>> ffff0001f0df1780
>> [ 139.833038] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
>> 00000000ffffffea
>> [ 139.841042] Call trace:
>> [ 139.843780] rk_iommu_identity_attach+0xac/0xbc (P)
>> [ 139.849252] rk_iommu_attach_device+0x54/0x134
>> [ 139.854236] __iommu_device_set_domain+0x7c/0x110
>> [ 139.859510] __iommu_group_set_domain_internal+0x60/0x134
>> [ 139.865561] __iommu_attach_group+0x88/0x9c
>> [ 139.870250] iommu_attach_device+0x68/0xa0
>> [ 139.874841] rockchip_drm_dma_attach_device+0x28/0x7c
>> [ 139.880508] vop2_crtc_atomic_enable+0x620/0xaa0
>> [ 139.885678] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
>> [ 139.892413] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
>> [ 139.898369] commit_tail+0xa0/0x1a0
>> [ 139.902279] drm_atomic_helper_commit+0x17c/0x1b0
>> [ 139.907552] drm_atomic_commit+0x8c/0xcc
>> [ 139.911951] drm_client_modeset_commit_atomic+0x228/0x298
>> [ 139.918005] drm_client_modeset_commit_locked+0x5c/0x188
>> [ 139.923960] drm_client_modeset_commit+0x2c/0x58
>> [ 139.929137] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
>> [ 139.936164] drm_fb_helper_hotplug_event+0xe8/0xf8
>> [ 139.941526] drm_fbdev_client_hotplug+0x24/0xe0
>> [ 139.946605] drm_client_hotplug+0x48/0xc4
>> [ 139.951100] drm_client_dev_hotplug+0x9c/0xd4
>> [ 139.955984] drm_kms_helper_connector_hotplug_event+0x20/0x30
>> [ 139.962426] drm_bridge_connector_hpd_cb+0x88/0xa0
>> [ 139.967790] drm_bridge_hpd_notify+0x3c/0x60
>> [ 139.972577] display_connector_hpd_irq+0x30/0xa4
>> [ 139.978835] irq_thread_fn+0x2c/0xb0
>> [ 139.983894] irq_thread+0x170/0x304
>> [ 139.988833] kthread+0x12c/0x204
>> [ 139.993468] ret_from_fork+0x10/0x20
>> [ 139.998486] ---[ end trace 0000000000000000 ]---
>> [ 140.004737] ------------[ cut here ]------------
>> [ 140.010884] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
>> iommu.c:1040 rk_iommu_attach_device+0x114/0x134
>> [ 140.023079] Modules linked in: panthor rockchip_vdec rocket
>> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
>> v4l2_mem2mem gpu_sched rng_core fuse
>> [ 140.040577] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Tainted:
>> G W 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
>> [ 140.054457] Tainted: [W]=WARN
>> [ 140.058804] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
>> Displayport Carrier v1 (DT)
>> [ 140.069595] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
>> BTYPE=--)
>> [ 140.078454] pc : rk_iommu_attach_device+0x114/0x134
>> [ 140.084989] lr : rk_iommu_attach_device+0x98/0x134
>> [ 140.091423] sp : ffff800080e4b7e0
>> [ 140.096197] x29: ffff800080e4b7e0 x28: ffff0001f6f98080 x27:
>> ffff0001f0a4b010
>> [ 140.105270] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
>> 0000000000000000
>> [ 140.114351] x23: ffff0001f6f843e0 x22: ffffdbf23c0485e0 x21:
>> ffff0001f0e9cc10
>> [ 140.123425] x20: ffff0001f0e2cb80 x19: ffff0001f6f843c0 x18:
>> 0000000000000038
>> [ 140.132489] x17: 0002550800000009 x16: 0000046c0446043e x15:
>> 0438000008ca080c
>> [ 140.141552] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
>> 07d0078000025508
>> [ 140.150623] x11: 0002550800000009 x10: 0000046c0446043e x9 :
>> ffffdbf23c137000
>> [ 140.159701] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
>> 0000000000000000
>> [ 140.168772] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
>> ffff0001f0e2cbe0
>> [ 140.177825] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
>> 00000000ffffffea
>> [ 140.186858] Call trace:
>> [ 140.190627] rk_iommu_attach_device+0x114/0x134 (P)
>> [ 140.197124] __iommu_device_set_domain+0x7c/0x110
>> [ 140.203417] __iommu_group_set_domain_internal+0x60/0x134
>> [ 140.210492] __iommu_attach_group+0x88/0x9c
>> [ 140.216203] iommu_attach_device+0x68/0xa0
>> [ 140.221802] rockchip_drm_dma_attach_device+0x28/0x7c
>> [ 140.228479] vop2_crtc_atomic_enable+0x620/0xaa0
>> [ 140.234664] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
>> [ 140.242400] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
>> [ 140.249349] commit_tail+0xa0/0x1a0
>> [ 140.254246] drm_atomic_helper_commit+0x17c/0x1b0
>> [ 140.260496] drm_atomic_commit+0x8c/0xcc
>> [ 140.265866] drm_client_modeset_commit_atomic+0x228/0x298
>> [ 140.272885] drm_client_modeset_commit_locked+0x5c/0x188
>> [ 140.279791] drm_client_modeset_commit+0x2c/0x58
>> [ 140.285914] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
>> [ 140.293889] drm_fb_helper_hotplug_event+0xe8/0xf8
>> [ 140.300214] drm_fbdev_client_hotplug+0x24/0xe0
>> [ 140.306248] drm_client_hotplug+0x48/0xc4
>> [ 140.311695] drm_client_dev_hotplug+0x9c/0xd4
>> [ 140.317531] drm_kms_helper_connector_hotplug_event+0x20/0x30
>> [ 140.324930] drm_bridge_connector_hpd_cb+0x88/0xa0
>> [ 140.331248] drm_bridge_hpd_notify+0x3c/0x60
>> [ 140.336990] display_connector_hpd_irq+0x30/0xa4
>> [ 140.343120] irq_thread_fn+0x2c/0xb0
>> [ 140.348081] irq_thread+0x170/0x304
>> [ 140.352937] kthread+0x12c/0x204
>> [ 140.357501] ret_from_fork+0x10/0x20
>> [ 140.362453] ---[ end trace 0000000000000000 ]---
>>
>>
>> After some minutes of hanging it does reboot afterall.
>>
>> Heiko
>>
>>
>
> Could you please help confirm whether the same error still occurs with
> this patch series under the same conditions?
Careless, what I want to express should be '...without this patch
series...'. :-)
>
> And I will also perform additional verification on my RK3588S EVB1 board.
>
> Best regards,
> Damon
>
>
>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init()
2025-07-26 0:12 ` Dmitry Baryshkov
@ 2025-07-29 3:22 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-29 3:22 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, mripard, tzimmermann, airlied,
simona, jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, l.stach, dianders, dri-devel,
linux-kernel, linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Dmitry,
On 2025/7/26 8:12, Dmitry Baryshkov wrote:
> On Thu, Jul 24, 2025 at 04:02:53PM +0800, Damon Ding wrote:
>> Compared with drm_simple_encoder_init(), drmm_encoder_init() can handle
>> the cleanup automatically through registering drm_encoder_cleanup() with
>> drmm_add_action().
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> ---
>> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index d30f0983a53a..4ed6bf9e5377 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -29,7 +29,6 @@
>> #include <drm/drm_of.h>
>> #include <drm/drm_panel.h>
>> #include <drm/drm_probe_helper.h>
>> -#include <drm/drm_simple_kms_helper.h>
>>
>> #include "rockchip_drm_drv.h"
>>
>> @@ -377,8 +376,7 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
>> dev->of_node);
>> DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
>>
>> - ret = drm_simple_encoder_init(drm_dev, encoder,
>> - DRM_MODE_ENCODER_TMDS);
>> + ret = drmm_encoder_init(drm_dev, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL);
>
> It's not possible to use drmm_encoder_init() here. Per the documentation
> the encoder data structure should be allocated by drmm_kzalloc().
> However this drm_encoder is a part of struct rockchip_dp_device. It's
> allocated by rockchip_dp_probe() via devm_kzalloc(). This means that it
> can potentially be freed before the drm device is completely released,
> creating a use-after-free error.
>
>> if (ret) {
>> DRM_ERROR("failed to initialize encoder with drm\n");
>> return ret;
>> --
>> 2.34.1
>>
>
Got it. This patch will be dropped in the next version.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge
2025-07-24 8:02 ` [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge Damon Ding
2025-07-26 0:15 ` Dmitry Baryshkov
@ 2025-07-29 7:30 ` Maxime Ripard
2025-07-29 8:31 ` Damon Ding
1 sibling, 1 reply; 39+ messages in thread
From: Maxime Ripard @ 2025-07-29 7:30 UTC (permalink / raw)
To: Damon Ding
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, tzimmermann, airlied, simona,
jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, dmitry.baryshkov, l.stach,
dianders, dri-devel, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]
Hi,
On Thu, Jul 24, 2025 at 04:02:54PM +0800, Damon Ding wrote:
> In order to move the parnel/bridge parsing and attachmenet to the
> Analogix side, add component struct drm_bridge *bridge to platform
> data struct analogix_dp_plat_data.
>
> The movemenet 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>
> ---
> 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..15cb6b706e9f 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 *bridge;
> struct drm_encoder *encoder;
> struct drm_connector *connector;
> bool skip_connector;
So it's not the analogix_dp bridge, but the bridge after that if any?
You should probably change it to next_bridge to avoid any confusion.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge
2025-07-29 7:30 ` Maxime Ripard
@ 2025-07-29 8:31 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-07-29 8:31 UTC (permalink / raw)
To: Maxime Ripard
Cc: andrzej.hajda, neil.armstrong, rfoss, Laurent.pinchart, jonas,
jernej.skrabec, maarten.lankhorst, tzimmermann, airlied, simona,
jingoohan1, inki.dae, sw0312.kim, kyungmin.park, krzk,
alim.akhtar, hjc, heiko, andy.yan, dmitry.baryshkov, l.stach,
dianders, dri-devel, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip
Hi Maxime,
On 2025/7/29 15:30, Maxime Ripard wrote:
> Hi,
>
> On Thu, Jul 24, 2025 at 04:02:54PM +0800, Damon Ding wrote:
>> In order to move the parnel/bridge parsing and attachmenet to the
>> Analogix side, add component struct drm_bridge *bridge to platform
>> data struct analogix_dp_plat_data.
>>
>> The movemenet 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>
>> ---
>> 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..15cb6b706e9f 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 *bridge;
>> struct drm_encoder *encoder;
>> struct drm_connector *connector;
>> bool skip_connector;
>
> So it's not the analogix_dp bridge, but the bridge after that if any?
>
> You should probably change it to next_bridge to avoid any confusion.
>
Yes, &analogix_dp_plat_data.bridge is intended to be the next bridge
after analogix_dp bridge.
I will rename it to &analogix_dp_plat_data.next_bridge as suggested and
update it in the next version.
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-07-29 3:16 ` Damon Ding
@ 2025-08-06 19:54 ` Heiko Stübner
2025-08-07 1:31 ` Damon Ding
0 siblings, 1 reply; 39+ messages in thread
From: Heiko Stübner @ 2025-08-06 19:54 UTC (permalink / raw)
To: andrzej.hajda, neil.armstrong, rfoss, Damon Ding
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Damon,
Am Dienstag, 29. Juli 2025, 05:16:27 Mitteleuropäische Sommerzeit schrieb Damon Ding:
> On 2025/7/29 11:02, Damon Ding wrote:
> > On 2025/7/26 3:45, Heiko Stübner wrote:
> >> Am Freitag, 25. Juli 2025, 04:15:06 Mitteleuropäische Sommerzeit
> >> schrieb Damon Ding:
> >>> On 2025/7/24 21:10, Heiko Stübner wrote:
> >>>> Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit
> >>>> schrieb 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 apply a better API for the encoder initialization.
> >>>>> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
> >>>>> PATCH 8 is to apply the drm_bridge_connector helper.
> >>>>> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
> >>>>> PATCH 12-13 are preparations for apply panel_bridge helper.
> >>>>> PATCH 14 is to apply the panel_bridge helper.
> >>>>
> >>>> for future revisions, please provide a changelog on what changed since
> >>>> the previous version, I guess ideally here in the cover-letter.
> >>>>
> >>>>
> >>>> On my rk3588-tiger-displayport-carrier this works like a charm
> >>>> Tested-by: Heiko Stuebner <heiko@sntech.de>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>> Glad to see your review and test. :-)
> >>>
> >>> I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
> >>> in the next iteration.
> >>
> >> I have to amend that a bit, sadly. When doing a reboot with the edp
> >> running, I see logs like:
> >>
> >> [...]
> >> [ 139.614749] systemd-shutdown[1]: Syncing filesystems and block
> >> devices.
> >> [ 139.622201] systemd-shutdown[1]: Rebooting.
> >> [ 139.684845] ------------[ cut here ]------------
> >> [ 139.690050] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
> >> iommu.c:989 rk_iommu_identity_attach+0xac/0xbc
> >> [ 139.701175] Modules linked in: panthor rockchip_vdec rocket
> >> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
> >> v4l2_mem2mem gpu_sched rng_core fuse
> >> [ 139.717685] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Not tainted
> >> 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
> >> [ 139.728799] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
> >> Displayport Carrier v1 (DT)
> >> [ 139.738548] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
> >> BTYPE=--)
> >> [ 139.746351] pc : rk_iommu_identity_attach+0xac/0xbc
> >> [ 139.751821] lr : rk_iommu_identity_attach+0x70/0xbc
> >> [ 139.757290] sp : ffff800080e4b7c0
> >> [ 139.761001] x29: ffff800080e4b7c0 x28: ffff0001f6f98080 x27:
> >> ffff0001f0a4b010
> >> [ 139.769006] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
> >> 0000000000000000
> >> [ 139.777010] x23: 0000000000000000 x22: ffffdbf23c0485e0 x21:
> >> ffff0001f0e9cc10
> >> [ 139.785014] x20: ffff0001f0df17a0 x19: ffff0001f0e2cb80 x18:
> >> 0000000000000038
> >> [ 139.793018] x17: 0002550800000009 x16: 0000046c0446043e x15:
> >> 0438000008ca080c
> >> [ 139.801021] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
> >> 07d0078000025508
> >> [ 139.809024] x11: 0002550800000009 x10: 0000046c0446043e x9 :
> >> ffffdbf23c137000
> >> [ 139.817031] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
> >> 0000000000000000
> >> [ 139.825034] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
> >> ffff0001f0df1780
> >> [ 139.833038] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
> >> 00000000ffffffea
> >> [ 139.841042] Call trace:
> >> [ 139.843780] rk_iommu_identity_attach+0xac/0xbc (P)
> >> [ 139.849252] rk_iommu_attach_device+0x54/0x134
> >> [ 139.854236] __iommu_device_set_domain+0x7c/0x110
> >> [ 139.859510] __iommu_group_set_domain_internal+0x60/0x134
> >> [ 139.865561] __iommu_attach_group+0x88/0x9c
> >> [ 139.870250] iommu_attach_device+0x68/0xa0
> >> [ 139.874841] rockchip_drm_dma_attach_device+0x28/0x7c
> >> [ 139.880508] vop2_crtc_atomic_enable+0x620/0xaa0
> >> [ 139.885678] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
> >> [ 139.892413] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
> >> [ 139.898369] commit_tail+0xa0/0x1a0
> >> [ 139.902279] drm_atomic_helper_commit+0x17c/0x1b0
> >> [ 139.907552] drm_atomic_commit+0x8c/0xcc
> >> [ 139.911951] drm_client_modeset_commit_atomic+0x228/0x298
> >> [ 139.918005] drm_client_modeset_commit_locked+0x5c/0x188
> >> [ 139.923960] drm_client_modeset_commit+0x2c/0x58
> >> [ 139.929137] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
> >> [ 139.936164] drm_fb_helper_hotplug_event+0xe8/0xf8
> >> [ 139.941526] drm_fbdev_client_hotplug+0x24/0xe0
> >> [ 139.946605] drm_client_hotplug+0x48/0xc4
> >> [ 139.951100] drm_client_dev_hotplug+0x9c/0xd4
> >> [ 139.955984] drm_kms_helper_connector_hotplug_event+0x20/0x30
> >> [ 139.962426] drm_bridge_connector_hpd_cb+0x88/0xa0
> >> [ 139.967790] drm_bridge_hpd_notify+0x3c/0x60
> >> [ 139.972577] display_connector_hpd_irq+0x30/0xa4
> >> [ 139.978835] irq_thread_fn+0x2c/0xb0
> >> [ 139.983894] irq_thread+0x170/0x304
> >> [ 139.988833] kthread+0x12c/0x204
> >> [ 139.993468] ret_from_fork+0x10/0x20
> >> [ 139.998486] ---[ end trace 0000000000000000 ]---
> >> [ 140.004737] ------------[ cut here ]------------
> >> [ 140.010884] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
> >> iommu.c:1040 rk_iommu_attach_device+0x114/0x134
> >> [ 140.023079] Modules linked in: panthor rockchip_vdec rocket
> >> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
> >> v4l2_mem2mem gpu_sched rng_core fuse
> >> [ 140.040577] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Tainted:
> >> G W 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
> >> [ 140.054457] Tainted: [W]=WARN
> >> [ 140.058804] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
> >> Displayport Carrier v1 (DT)
> >> [ 140.069595] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
> >> BTYPE=--)
> >> [ 140.078454] pc : rk_iommu_attach_device+0x114/0x134
> >> [ 140.084989] lr : rk_iommu_attach_device+0x98/0x134
> >> [ 140.091423] sp : ffff800080e4b7e0
> >> [ 140.096197] x29: ffff800080e4b7e0 x28: ffff0001f6f98080 x27:
> >> ffff0001f0a4b010
> >> [ 140.105270] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
> >> 0000000000000000
> >> [ 140.114351] x23: ffff0001f6f843e0 x22: ffffdbf23c0485e0 x21:
> >> ffff0001f0e9cc10
> >> [ 140.123425] x20: ffff0001f0e2cb80 x19: ffff0001f6f843c0 x18:
> >> 0000000000000038
> >> [ 140.132489] x17: 0002550800000009 x16: 0000046c0446043e x15:
> >> 0438000008ca080c
> >> [ 140.141552] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
> >> 07d0078000025508
> >> [ 140.150623] x11: 0002550800000009 x10: 0000046c0446043e x9 :
> >> ffffdbf23c137000
> >> [ 140.159701] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
> >> 0000000000000000
> >> [ 140.168772] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
> >> ffff0001f0e2cbe0
> >> [ 140.177825] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
> >> 00000000ffffffea
> >> [ 140.186858] Call trace:
> >> [ 140.190627] rk_iommu_attach_device+0x114/0x134 (P)
> >> [ 140.197124] __iommu_device_set_domain+0x7c/0x110
> >> [ 140.203417] __iommu_group_set_domain_internal+0x60/0x134
> >> [ 140.210492] __iommu_attach_group+0x88/0x9c
> >> [ 140.216203] iommu_attach_device+0x68/0xa0
> >> [ 140.221802] rockchip_drm_dma_attach_device+0x28/0x7c
> >> [ 140.228479] vop2_crtc_atomic_enable+0x620/0xaa0
> >> [ 140.234664] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
> >> [ 140.242400] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
> >> [ 140.249349] commit_tail+0xa0/0x1a0
> >> [ 140.254246] drm_atomic_helper_commit+0x17c/0x1b0
> >> [ 140.260496] drm_atomic_commit+0x8c/0xcc
> >> [ 140.265866] drm_client_modeset_commit_atomic+0x228/0x298
> >> [ 140.272885] drm_client_modeset_commit_locked+0x5c/0x188
> >> [ 140.279791] drm_client_modeset_commit+0x2c/0x58
> >> [ 140.285914] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
> >> [ 140.293889] drm_fb_helper_hotplug_event+0xe8/0xf8
> >> [ 140.300214] drm_fbdev_client_hotplug+0x24/0xe0
> >> [ 140.306248] drm_client_hotplug+0x48/0xc4
> >> [ 140.311695] drm_client_dev_hotplug+0x9c/0xd4
> >> [ 140.317531] drm_kms_helper_connector_hotplug_event+0x20/0x30
> >> [ 140.324930] drm_bridge_connector_hpd_cb+0x88/0xa0
> >> [ 140.331248] drm_bridge_hpd_notify+0x3c/0x60
> >> [ 140.336990] display_connector_hpd_irq+0x30/0xa4
> >> [ 140.343120] irq_thread_fn+0x2c/0xb0
> >> [ 140.348081] irq_thread+0x170/0x304
> >> [ 140.352937] kthread+0x12c/0x204
> >> [ 140.357501] ret_from_fork+0x10/0x20
> >> [ 140.362453] ---[ end trace 0000000000000000 ]---
> >>
> >>
> >> After some minutes of hanging it does reboot afterall.
> >>
> >> Heiko
> >>
> >>
> >
> > Could you please help confirm whether the same error still occurs with
> > this patch series under the same conditions?
>
> Careless, what I want to express should be '...without this patch
> series...'. :-)
sorry this took a tad longer for me to get back to this topic, but I was
now able to run a number of scenarios:
So I ran a number of variants and interestingly as the board I do eDP
tests on does not have any PCIe parts, I enountered an issue with
the PCIe SMMU [0].
When I disable the SMMU node, I also cannot reproduce the error from
above. So I've rebooted so many times today both with and without the
SMMU, and encountered the log from above only ever with the dangling
SMMU. So I'd assume, the Analogix series is actually innocent :-) .
Heiko
[0] https://lore.kernel.org/linux-rockchip/4400329.mogB4TqSGs@diego/T/#m5901974351b7c11e34f29a02b4f7f69b6ef29b2f
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver
2025-08-06 19:54 ` Heiko Stübner
@ 2025-08-07 1:31 ` Damon Ding
0 siblings, 0 replies; 39+ messages in thread
From: Damon Ding @ 2025-08-07 1:31 UTC (permalink / raw)
To: Heiko Stübner, andrzej.hajda, neil.armstrong, rfoss
Cc: Laurent.pinchart, jonas, jernej.skrabec, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, jingoohan1, inki.dae,
sw0312.kim, kyungmin.park, krzk, alim.akhtar, hjc, andy.yan,
dmitry.baryshkov, l.stach, dianders, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 2025/8/7 3:54, Heiko Stübner wrote:
> Hi Damon,
>
> Am Dienstag, 29. Juli 2025, 05:16:27 Mitteleuropäische Sommerzeit schrieb Damon Ding:
>> On 2025/7/29 11:02, Damon Ding wrote:
>>> On 2025/7/26 3:45, Heiko Stübner wrote:
>>>> Am Freitag, 25. Juli 2025, 04:15:06 Mitteleuropäische Sommerzeit
>>>> schrieb Damon Ding:
>>>>> On 2025/7/24 21:10, Heiko Stübner wrote:
>>>>>> Am Donnerstag, 24. Juli 2025, 10:02:50 Mitteleuropäische Sommerzeit
>>>>>> schrieb 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 apply a better API for the encoder initialization.
>>>>>>> PATCH 4-7 are preparations for apply drm_bridge_connector helper.
>>>>>>> PATCH 8 is to apply the drm_bridge_connector helper.
>>>>>>> PATCH 9-11 are to move the panel/bridge parsing to the Analogix side.
>>>>>>> PATCH 12-13 are preparations for apply panel_bridge helper.
>>>>>>> PATCH 14 is to apply the panel_bridge helper.
>>>>>>
>>>>>> for future revisions, please provide a changelog on what changed since
>>>>>> the previous version, I guess ideally here in the cover-letter.
>>>>>>
>>>>>>
>>>>>> On my rk3588-tiger-displayport-carrier this works like a charm
>>>>>> Tested-by: Heiko Stuebner <heiko@sntech.de>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> Glad to see your review and test. :-)
>>>>>
>>>>> I will include the version-to-version changelogs (v2 -> v3 and v3 -> v4)
>>>>> in the next iteration.
>>>>
>>>> I have to amend that a bit, sadly. When doing a reboot with the edp
>>>> running, I see logs like:
>>>>
>>>> [...]
>>>> [ 139.614749] systemd-shutdown[1]: Syncing filesystems and block
>>>> devices.
>>>> [ 139.622201] systemd-shutdown[1]: Rebooting.
>>>> [ 139.684845] ------------[ cut here ]------------
>>>> [ 139.690050] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
>>>> iommu.c:989 rk_iommu_identity_attach+0xac/0xbc
>>>> [ 139.701175] Modules linked in: panthor rockchip_vdec rocket
>>>> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
>>>> v4l2_mem2mem gpu_sched rng_core fuse
>>>> [ 139.717685] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Not tainted
>>>> 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
>>>> [ 139.728799] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
>>>> Displayport Carrier v1 (DT)
>>>> [ 139.738548] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
>>>> BTYPE=--)
>>>> [ 139.746351] pc : rk_iommu_identity_attach+0xac/0xbc
>>>> [ 139.751821] lr : rk_iommu_identity_attach+0x70/0xbc
>>>> [ 139.757290] sp : ffff800080e4b7c0
>>>> [ 139.761001] x29: ffff800080e4b7c0 x28: ffff0001f6f98080 x27:
>>>> ffff0001f0a4b010
>>>> [ 139.769006] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
>>>> 0000000000000000
>>>> [ 139.777010] x23: 0000000000000000 x22: ffffdbf23c0485e0 x21:
>>>> ffff0001f0e9cc10
>>>> [ 139.785014] x20: ffff0001f0df17a0 x19: ffff0001f0e2cb80 x18:
>>>> 0000000000000038
>>>> [ 139.793018] x17: 0002550800000009 x16: 0000046c0446043e x15:
>>>> 0438000008ca080c
>>>> [ 139.801021] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
>>>> 07d0078000025508
>>>> [ 139.809024] x11: 0002550800000009 x10: 0000046c0446043e x9 :
>>>> ffffdbf23c137000
>>>> [ 139.817031] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
>>>> 0000000000000000
>>>> [ 139.825034] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
>>>> ffff0001f0df1780
>>>> [ 139.833038] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
>>>> 00000000ffffffea
>>>> [ 139.841042] Call trace:
>>>> [ 139.843780] rk_iommu_identity_attach+0xac/0xbc (P)
>>>> [ 139.849252] rk_iommu_attach_device+0x54/0x134
>>>> [ 139.854236] __iommu_device_set_domain+0x7c/0x110
>>>> [ 139.859510] __iommu_group_set_domain_internal+0x60/0x134
>>>> [ 139.865561] __iommu_attach_group+0x88/0x9c
>>>> [ 139.870250] iommu_attach_device+0x68/0xa0
>>>> [ 139.874841] rockchip_drm_dma_attach_device+0x28/0x7c
>>>> [ 139.880508] vop2_crtc_atomic_enable+0x620/0xaa0
>>>> [ 139.885678] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
>>>> [ 139.892413] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
>>>> [ 139.898369] commit_tail+0xa0/0x1a0
>>>> [ 139.902279] drm_atomic_helper_commit+0x17c/0x1b0
>>>> [ 139.907552] drm_atomic_commit+0x8c/0xcc
>>>> [ 139.911951] drm_client_modeset_commit_atomic+0x228/0x298
>>>> [ 139.918005] drm_client_modeset_commit_locked+0x5c/0x188
>>>> [ 139.923960] drm_client_modeset_commit+0x2c/0x58
>>>> [ 139.929137] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
>>>> [ 139.936164] drm_fb_helper_hotplug_event+0xe8/0xf8
>>>> [ 139.941526] drm_fbdev_client_hotplug+0x24/0xe0
>>>> [ 139.946605] drm_client_hotplug+0x48/0xc4
>>>> [ 139.951100] drm_client_dev_hotplug+0x9c/0xd4
>>>> [ 139.955984] drm_kms_helper_connector_hotplug_event+0x20/0x30
>>>> [ 139.962426] drm_bridge_connector_hpd_cb+0x88/0xa0
>>>> [ 139.967790] drm_bridge_hpd_notify+0x3c/0x60
>>>> [ 139.972577] display_connector_hpd_irq+0x30/0xa4
>>>> [ 139.978835] irq_thread_fn+0x2c/0xb0
>>>> [ 139.983894] irq_thread+0x170/0x304
>>>> [ 139.988833] kthread+0x12c/0x204
>>>> [ 139.993468] ret_from_fork+0x10/0x20
>>>> [ 139.998486] ---[ end trace 0000000000000000 ]---
>>>> [ 140.004737] ------------[ cut here ]------------
>>>> [ 140.010884] WARNING: CPU: 0 PID: 110 at drivers/iommu/rockchip-
>>>> iommu.c:1040 rk_iommu_attach_device+0x114/0x134
>>>> [ 140.023079] Modules linked in: panthor rockchip_vdec rocket
>>>> drm_gpuvm v4l2_vp9 v4l2_h264 drm_exec rockchip_rng drm_shmem_helper
>>>> v4l2_mem2mem gpu_sched rng_core fuse
>>>> [ 140.040577] CPU: 0 UID: 0 PID: 110 Comm: irq/58-HPD Tainted:
>>>> G W 6.16.0-rc7-00183-gd436cbe8e4b3 #1541 PREEMPT
>>>> [ 140.054457] Tainted: [W]=WARN
>>>> [ 140.058804] Hardware name: Theobroma Systems RK3588-Q7 SoM on Tiger
>>>> Displayport Carrier v1 (DT)
>>>> [ 140.069595] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS
>>>> BTYPE=--)
>>>> [ 140.078454] pc : rk_iommu_attach_device+0x114/0x134
>>>> [ 140.084989] lr : rk_iommu_attach_device+0x98/0x134
>>>> [ 140.091423] sp : ffff800080e4b7e0
>>>> [ 140.096197] x29: ffff800080e4b7e0 x28: ffff0001f6f98080 x27:
>>>> ffff0001f0a4b010
>>>> [ 140.105270] x26: ffff0001f6f98e58 x25: 0000000000000000 x24:
>>>> 0000000000000000
>>>> [ 140.114351] x23: ffff0001f6f843e0 x22: ffffdbf23c0485e0 x21:
>>>> ffff0001f0e9cc10
>>>> [ 140.123425] x20: ffff0001f0e2cb80 x19: ffff0001f6f843c0 x18:
>>>> 0000000000000038
>>>> [ 140.132489] x17: 0002550800000009 x16: 0000046c0446043e x15:
>>>> 0438000008ca080c
>>>> [ 140.141552] x14: 07d008ca07800780 x13: 0438000008ca080c x12:
>>>> 07d0078000025508
>>>> [ 140.150623] x11: 0002550800000009 x10: 0000046c0446043e x9 :
>>>> ffffdbf23c137000
>>>> [ 140.159701] x8 : 0000000000000438 x7 : 0000000000000000 x6 :
>>>> 0000000000000000
>>>> [ 140.168772] x5 : ffffdbf23adbb9c0 x4 : ffff0001f0df1780 x3 :
>>>> ffff0001f0e2cbe0
>>>> [ 140.177825] x2 : 0000000000000081 x1 : ffff0001f6fad500 x0 :
>>>> 00000000ffffffea
>>>> [ 140.186858] Call trace:
>>>> [ 140.190627] rk_iommu_attach_device+0x114/0x134 (P)
>>>> [ 140.197124] __iommu_device_set_domain+0x7c/0x110
>>>> [ 140.203417] __iommu_group_set_domain_internal+0x60/0x134
>>>> [ 140.210492] __iommu_attach_group+0x88/0x9c
>>>> [ 140.216203] iommu_attach_device+0x68/0xa0
>>>> [ 140.221802] rockchip_drm_dma_attach_device+0x28/0x7c
>>>> [ 140.228479] vop2_crtc_atomic_enable+0x620/0xaa0
>>>> [ 140.234664] drm_atomic_helper_commit_modeset_enables+0xac/0x26c
>>>> [ 140.242400] drm_atomic_helper_commit_tail_rpm+0x50/0xa0
>>>> [ 140.249349] commit_tail+0xa0/0x1a0
>>>> [ 140.254246] drm_atomic_helper_commit+0x17c/0x1b0
>>>> [ 140.260496] drm_atomic_commit+0x8c/0xcc
>>>> [ 140.265866] drm_client_modeset_commit_atomic+0x228/0x298
>>>> [ 140.272885] drm_client_modeset_commit_locked+0x5c/0x188
>>>> [ 140.279791] drm_client_modeset_commit+0x2c/0x58
>>>> [ 140.285914] __drm_fb_helper_restore_fbdev_mode_unlocked+0xb4/0x100
>>>> [ 140.293889] drm_fb_helper_hotplug_event+0xe8/0xf8
>>>> [ 140.300214] drm_fbdev_client_hotplug+0x24/0xe0
>>>> [ 140.306248] drm_client_hotplug+0x48/0xc4
>>>> [ 140.311695] drm_client_dev_hotplug+0x9c/0xd4
>>>> [ 140.317531] drm_kms_helper_connector_hotplug_event+0x20/0x30
>>>> [ 140.324930] drm_bridge_connector_hpd_cb+0x88/0xa0
>>>> [ 140.331248] drm_bridge_hpd_notify+0x3c/0x60
>>>> [ 140.336990] display_connector_hpd_irq+0x30/0xa4
>>>> [ 140.343120] irq_thread_fn+0x2c/0xb0
>>>> [ 140.348081] irq_thread+0x170/0x304
>>>> [ 140.352937] kthread+0x12c/0x204
>>>> [ 140.357501] ret_from_fork+0x10/0x20
>>>> [ 140.362453] ---[ end trace 0000000000000000 ]---
>>>>
>>>>
>>>> After some minutes of hanging it does reboot afterall.
>>>>
>>>> Heiko
>>>>
>>>>
>>>
>>> Could you please help confirm whether the same error still occurs with
>>> this patch series under the same conditions?
>>
>> Careless, what I want to express should be '...without this patch
>> series...'. :-)
>
> sorry this took a tad longer for me to get back to this topic, but I was
> now able to run a number of scenarios:
>
> So I ran a number of variants and interestingly as the board I do eDP
> tests on does not have any PCIe parts, I enountered an issue with
> the PCIe SMMU [0].
>
> When I disable the SMMU node, I also cannot reproduce the error from
> above. So I've rebooted so many times today both with and without the
> SMMU, and encountered the log from above only ever with the dangling
> SMMU. So I'd assume, the Analogix series is actually innocent :-) .
>
>
> Heiko
>
>
>
> [0] https://lore.kernel.org/linux-rockchip/4400329.mogB4TqSGs@diego/T/#m5901974351b7c11e34f29a02b4f7f69b6ef29b2f
>
>
Thanks for testing! And v4 patch series is on the way. ;-)
Best regards,
Damon
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2025-08-07 1:34 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 8:02 [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2025-07-24 8:02 ` [PATCH v3 01/14] drm/bridge: analogix_dp: Formalize the struct analogix_dp_device Damon Ding
2025-07-24 8:02 ` [PATCH v3 02/14] drm/bridge: analogix_dp: Move &drm_bridge_funcs.mode_set to &drm_bridge_funcs.atomic_enable Damon Ding
2025-07-24 8:02 ` [PATCH v3 03/14] drm/rockchip: analogix_dp: Apply drmm_encoder_init() instead of drm_simple_encoder_init() Damon Ding
2025-07-26 0:12 ` Dmitry Baryshkov
2025-07-29 3:22 ` Damon Ding
2025-07-24 8:02 ` [PATCH v3 04/14] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.bridge Damon Ding
2025-07-26 0:15 ` Dmitry Baryshkov
2025-07-29 7:30 ` Maxime Ripard
2025-07-29 8:31 ` Damon Ding
2025-07-24 8:02 ` [PATCH v3 05/14] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
2025-07-26 0:15 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 06/14] drm/bridge: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
2025-07-26 0:14 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 07/14] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
2025-07-26 0:14 ` Dmitry Baryshkov
2025-07-24 8:02 ` [PATCH v3 08/14] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2025-07-24 13:00 ` Heiko Stübner
2025-07-25 1:47 ` Damon Ding
2025-07-25 2:26 ` kernel test robot
2025-07-24 8:02 ` [PATCH v3 09/14] drm/bridge: analogix_dp: Add support to find panel or bridge Damon Ding
2025-07-26 12:03 ` Dmitry Baryshkov
2025-07-29 3:09 ` Damon Ding
2025-07-24 8:03 ` [PATCH v3 10/14] drm/rockchip: analogix_dp: Apply analogix_dp_find_panel_or_bridge() Damon Ding
2025-07-26 12:03 ` Dmitry Baryshkov
2025-07-24 8:03 ` [PATCH v3 11/14] drm/exynos: exynos_dp: " Damon Ding
2025-07-26 12:05 ` Dmitry Baryshkov
2025-07-24 8:03 ` [PATCH v3 12/14] drm/bridge: analogix_dp: Remove panel disabling and enabling in analogix_dp_set_bridge() Damon Ding
2025-07-24 8:03 ` [PATCH v3 13/14] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
2025-07-24 8:03 ` [PATCH v3 14/14] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2025-07-24 13:08 ` Heiko Stübner
2025-07-25 1:57 ` Damon Ding
2025-07-24 13:10 ` [PATCH v3 00/14] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Heiko Stübner
2025-07-25 2:15 ` Damon Ding
2025-07-25 19:45 ` Heiko Stübner
2025-07-29 3:02 ` Damon Ding
2025-07-29 3:16 ` Damon Ding
2025-08-06 19:54 ` Heiko Stübner
2025-08-07 1:31 ` Damon Ding
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).