* [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms
@ 2026-09-14 1:33 Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Chaoyi Chen @ 2026-09-14 1:33 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel, Chaoyi Chen
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
This series is dedicated to enhancing the DSI controller and PHY timing
interaction, refining the lane rate calculation, and addressing the
associated hardware limitations.
Changes in v5:
- Link to v4: https://lore.kernel.org/all/20260812073002.328-1-kernel@airkyi.com/
- Change the upper bound check for target_mbps from < to <= (sashiko).
Changes in v4:
- Link to v3: https://lore.kernel.org/all/20260810034139.148-1-kernel@airkyi.com/
- Add missing RK3506 timing and the fallback path for get_timing
(sashiko).
- Fix potential overflow and underflow issues in bandwidth
calculation(sashiko).
Changes in v3:
- Link to v2: https://lore.kernel.org/all/20260603033532.164-1-kernel@airkyi.com/
- Rebase to Linux v7.2
Changes in v2:
- Link to v1: https://lore.kernel.org/all/20260324085838.90-1-kernel@airkyi.com/
- Fix the unit conversion for max_mbps.
- Split the lane rate calculation into a separate patch.
- Add more comment about timing config.
Chaoyi Chen (3):
drm/rockchip: dsi: Add maximum per lane bit rate calculation
drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types
drm/rockchip: dsi: Relax the lane rate margin requirements
.../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 72 +++++++++++++++++--
1 file changed, 65 insertions(+), 7 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
@ 2026-09-14 1:33 ` Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types Chaoyi Chen
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Chaoyi Chen @ 2026-09-14 1:33 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel, Chaoyi Chen
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Different chips have varying support for the maximum bit rate per lane.
Add calculation for the maximum per lane bit rate for various chip
platforms.
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
---
Changes in v5:
- Change the upper bound check for target_mbps from < to <= (sashiko).
(no changes since v4)
Changes in v3:
- Rebase to Linux v7.2
Changes in v2:
- Fix the unit conversion for max_mbps.
- Split the lane rate calculation into a separate patch.
---
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 3547d91b25d3..6a476c2c1303 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -268,6 +268,7 @@ struct rockchip_dw_dsi_chip_data {
unsigned int flags;
unsigned int max_data_lanes;
+ unsigned long max_bit_rate_per_lane;
};
struct dw_mipi_dsi_rockchip {
@@ -565,7 +566,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
int bpp;
unsigned long mpclk, tmp;
unsigned int target_mbps = 1000;
- unsigned int max_mbps = dppa_map[ARRAY_SIZE(dppa_map) - 1].max_mbps;
+ unsigned int max_mbps;
unsigned long best_freq = 0;
unsigned long fvco_min, fvco_max, fin, fout;
unsigned int min_prediv, max_prediv;
@@ -573,6 +574,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
unsigned long _fbdiv, best_fbdiv;
unsigned long min_delta = ULONG_MAX;
+ max_mbps = dsi->cdata->max_bit_rate_per_lane / USEC_PER_SEC;
dsi->format = format;
bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
if (bpp < 0) {
@@ -586,7 +588,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
if (mpclk) {
/* take 1 / 0.8, since mbps must big than bandwidth of RGB */
tmp = mpclk * (bpp / lanes) * 10 / 8;
- if (tmp < max_mbps)
+ if (tmp <= max_mbps)
target_mbps = tmp;
else
DRM_DEV_ERROR(dsi->dev,
@@ -1503,6 +1505,7 @@ static const struct rockchip_dw_dsi_chip_data px30_chip_data[] = {
PX30_DSI_FORCETXSTOPMODE), 0),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1000000000UL,
},
{ /* sentinel */ }
};
@@ -1515,6 +1518,7 @@ static const struct rockchip_dw_dsi_chip_data rk3128_chip_data[] = {
RK3128_DSI_FORCERXMODE |
RK3128_DSI_FORCETXSTOPMODE), 0),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1000000000UL,
},
{ /* sentinel */ }
};
@@ -1527,6 +1531,7 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
.lcdsel_lit = FIELD_PREP_WM16_CONST(RK3288_DSI0_LCDC_SEL, 1),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1500000000UL,
},
{
.reg = 0xff964000,
@@ -1535,6 +1540,7 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
.lcdsel_lit = FIELD_PREP_WM16_CONST(RK3288_DSI1_LCDC_SEL, 1),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1500000000UL,
},
{ /* sentinel */ }
};
@@ -1547,6 +1553,7 @@ static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = {
RK3368_DSI_FORCETXSTOPMODE |
RK3368_DSI_FORCERXMODE), 0),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1500000000UL,
},
{ /* sentinel */ }
};
@@ -1634,6 +1641,7 @@ static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
.flags = DW_MIPI_NEEDS_PHY_CFG_CLK | DW_MIPI_NEEDS_GRF_CLK,
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1500000000UL,
},
{
.reg = 0xff968000,
@@ -1658,6 +1666,7 @@ static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
.flags = DW_MIPI_NEEDS_PHY_CFG_CLK | DW_MIPI_NEEDS_GRF_CLK,
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1500000000UL,
.dphy_rx_init = rk3399_dphy_tx1rx1_init,
.dphy_rx_power_on = rk3399_dphy_tx1rx1_power_on,
@@ -1674,6 +1683,7 @@ static const struct rockchip_dw_dsi_chip_data rk3506_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3506_DSI_FORCERXMODE, 0) |
FIELD_PREP_WM16_CONST(RK3506_DSI_FORCETXSTOPMODE, 0)),
.max_data_lanes = 2,
+ .max_bit_rate_per_lane = 1500000000UL,
},
{ /* sentinel */ }
};
@@ -1687,6 +1697,7 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3568_DSI0_TURNDISABLE, 0) |
FIELD_PREP_WM16_CONST(RK3568_DSI0_FORCERXMODE, 0)),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1200000000UL,
},
{
.reg = 0xfe070000,
@@ -1696,6 +1707,7 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3568_DSI1_TURNDISABLE, 0) |
FIELD_PREP_WM16_CONST(RK3568_DSI1_FORCERXMODE, 0)),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1200000000UL,
},
{ /* sentinel */ }
};
@@ -1708,6 +1720,7 @@ static const struct rockchip_dw_dsi_chip_data rv1126_chip_data[] = {
FIELD_PREP_WM16_CONST(RV1126_DSI_FORCERXMODE, 0) |
FIELD_PREP_WM16_CONST(RV1126_DSI_FORCETXSTOPMODE, 0)),
.max_data_lanes = 4,
+ .max_bit_rate_per_lane = 1000000000UL,
},
{ /* sentinel */ }
};
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
@ 2026-09-14 1:33 ` Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 3/3] drm/rockchip: dsi: Relax the lane rate margin requirements Chaoyi Chen
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Chaoyi Chen @ 2026-09-14 1:33 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel, Chaoyi Chen
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Currently, there are generally two types of DPHY for Rockchip. One is
the DPHY used by RK3288/RK3399, whose timing is described by Table A-3
High-Speed Transition Times in the databook. The other is the DPHY used
by PX30 and its successors. If its timing is still described using
RK3288/RK3399, it may not perform correctly on some DSI panel.
Add dphy_get_timing for different D-PHY types to adapt to timing
differences. The configuration details are as follows:
- RK3288/RK3399: Select the corresponding entry from the timing table based
on the data rate.
- PX30 and later platforms: Use a fixed timing configuration.
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
---
(no changes since v5)
Changes in v4:
- Add missing RK3506 timing and the fallback path for get_timing
(sashiko).
Changes in v3:
- Rebase to Linux v7.2
Changes in v2:
- Add more comment about timing config.
---
.../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 49 ++++++++++++++++++-
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 6a476c2c1303..feb484f7c03e 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -247,6 +247,7 @@ enum {
BIASEXTR_127_7,
};
+struct dw_mipi_dsi_rockchip;
struct rockchip_dw_dsi_chip_data {
u32 reg;
@@ -262,6 +263,9 @@ struct rockchip_dw_dsi_chip_data {
u32 lanecfg2_grf_reg;
u32 lanecfg2;
+ int (*dphy_get_timing)(struct dw_mipi_dsi_rockchip *dsi, unsigned int lane_mbps,
+ struct dw_mipi_dsi_dphy_timing *timing);
+
int (*dphy_rx_init)(struct phy *phy);
int (*dphy_rx_power_on)(struct phy *phy);
int (*dphy_rx_power_off)(struct phy *phy);
@@ -721,8 +725,9 @@ static struct hstt hstt_table[] = {
};
static int
-dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps,
- struct dw_mipi_dsi_dphy_timing *timing)
+dw_mipi_dsi_phy_rk3288_get_timing(struct dw_mipi_dsi_rockchip *dsi,
+ unsigned int lane_mbps,
+ struct dw_mipi_dsi_dphy_timing *timing)
{
int i;
@@ -738,6 +743,35 @@ dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps,
return 0;
}
+static const struct dw_mipi_dsi_dphy_timing dphy_timing_px30 = {
+ .clk_lp2hs = 0x40,
+ .clk_hs2lp = 0x40,
+ .data_lp2hs = 0x10,
+ .data_hs2lp = 0x14,
+};
+
+static int
+dw_mipi_dsi_phy_px30_get_timing(struct dw_mipi_dsi_rockchip *dsi,
+ unsigned int lane_mbps,
+ struct dw_mipi_dsi_dphy_timing *timing)
+{
+ *timing = dphy_timing_px30;
+
+ return 0;
+}
+
+static int
+dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps,
+ struct dw_mipi_dsi_dphy_timing *timing)
+{
+ struct dw_mipi_dsi_rockchip *dsi = priv_data;
+
+ if (dsi->cdata->dphy_get_timing)
+ return dsi->cdata->dphy_get_timing(dsi, lane_mbps, timing);
+
+ return dw_mipi_dsi_phy_px30_get_timing(dsi, lane_mbps, timing);
+}
+
static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_rockchip_phy_ops = {
.init = dw_mipi_dsi_phy_init,
.power_on = dw_mipi_dsi_phy_power_on,
@@ -1506,6 +1540,7 @@ static const struct rockchip_dw_dsi_chip_data px30_chip_data[] = {
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1000000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
@@ -1519,6 +1554,7 @@ static const struct rockchip_dw_dsi_chip_data rk3128_chip_data[] = {
RK3128_DSI_FORCETXSTOPMODE), 0),
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1000000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
@@ -1532,6 +1568,7 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1500000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_rk3288_get_timing,
},
{
.reg = 0xff964000,
@@ -1541,6 +1578,7 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1500000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_rk3288_get_timing,
},
{ /* sentinel */ }
};
@@ -1554,6 +1592,7 @@ static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = {
RK3368_DSI_FORCERXMODE), 0),
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1500000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
@@ -1642,6 +1681,7 @@ static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
.flags = DW_MIPI_NEEDS_PHY_CFG_CLK | DW_MIPI_NEEDS_GRF_CLK,
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1500000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_rk3288_get_timing,
},
{
.reg = 0xff968000,
@@ -1671,6 +1711,7 @@ static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
.dphy_rx_init = rk3399_dphy_tx1rx1_init,
.dphy_rx_power_on = rk3399_dphy_tx1rx1_power_on,
.dphy_rx_power_off = rk3399_dphy_tx1rx1_power_off,
+ .dphy_get_timing = dw_mipi_dsi_phy_rk3288_get_timing,
},
{ /* sentinel */ }
};
@@ -1684,6 +1725,7 @@ static const struct rockchip_dw_dsi_chip_data rk3506_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3506_DSI_FORCETXSTOPMODE, 0)),
.max_data_lanes = 2,
.max_bit_rate_per_lane = 1500000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
@@ -1698,6 +1740,7 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3568_DSI0_FORCERXMODE, 0)),
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1200000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{
.reg = 0xfe070000,
@@ -1708,6 +1751,7 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
FIELD_PREP_WM16_CONST(RK3568_DSI1_FORCERXMODE, 0)),
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1200000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
@@ -1721,6 +1765,7 @@ static const struct rockchip_dw_dsi_chip_data rv1126_chip_data[] = {
FIELD_PREP_WM16_CONST(RV1126_DSI_FORCETXSTOPMODE, 0)),
.max_data_lanes = 4,
.max_bit_rate_per_lane = 1000000000UL,
+ .dphy_get_timing = dw_mipi_dsi_phy_px30_get_timing,
},
{ /* sentinel */ }
};
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 3/3] drm/rockchip: dsi: Relax the lane rate margin requirements
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types Chaoyi Chen
@ 2026-09-14 1:33 ` Chaoyi Chen
2026-09-15 13:36 ` [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Heiko Stübner
2026-09-15 16:39 ` (subset) " Heiko Stuebner
4 siblings, 0 replies; 7+ messages in thread
From: Chaoyi Chen @ 2026-09-14 1:33 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel, Chaoyi Chen
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
The lane rate is calculated as follows:
Lane_Rate = Pixel_Clk * (BPP / lanes) * Overhead
The overhead factor is set to 1/0.8, equivalent to a 25% overhead.
Now let's consider the case of RGB888 (BPP24) with a pclk of 148.5MHz.
The lane rate equals 148.5M * (24 / 4) * 1.25 = 1113.75 Mbps.
However, this is beyond the capability of certain platforms limited to a
1Gbps lane rate. On the other hand, we have observed that some DSI panel
actually perform worse with higher overhead.
So we are considering relaxing the bandwidth margin requirements.
According to the downstream test results, adopting 1/0.9 seems to
be a sound approach, corresponding to an overhead of about 11%.
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
---
(no changes since v5)
Changes in v4:
- Fix potential overflow and underflow issues in bandwidth
calculation(sashiko).
Changes in v3:
- Rebase to Linux v7.2
---
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index feb484f7c03e..03019b99abdc 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -590,8 +590,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
mpclk = DIV_ROUND_UP(mode->clock, MSEC_PER_SEC);
if (mpclk) {
- /* take 1 / 0.8, since mbps must big than bandwidth of RGB */
- tmp = mpclk * (bpp / lanes) * 10 / 8;
+ /* take 1 / 0.9, since mbps must big than bandwidth of RGB */
+ tmp = DIV_ROUND_UP(mpclk * bpp * 10, lanes * 9);
if (tmp <= max_mbps)
target_mbps = tmp;
else
@@ -601,7 +601,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
/* for external phy only a the mipi_dphy_config is necessary */
if (dsi->phy) {
- phy_mipi_dphy_get_default_config(mode->clock * 1000 * 10 / 8,
+ phy_mipi_dphy_get_default_config((u32)mode->clock * 1000 * 10 / 9,
bpp, lanes,
&dsi->phy_opts.mipi_dphy);
dsi->lane_mbps = target_mbps;
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
` (2 preceding siblings ...)
2026-09-14 1:33 ` [PATCH v5 3/3] drm/rockchip: dsi: Relax the lane rate margin requirements Chaoyi Chen
@ 2026-09-15 13:36 ` Heiko Stübner
2026-09-16 1:54 ` Chaoyi Chen
2026-09-15 16:39 ` (subset) " Heiko Stuebner
4 siblings, 1 reply; 7+ messages in thread
From: Heiko Stübner @ 2026-09-15 13:36 UTC (permalink / raw)
To: Sandy Huang, Andy Yan, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Chaoyi Chen
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel,
Chaoyi Chen, Quentin Schulz
Hi,
Am Montag, 14. September 2026, 03:33:28 Mitteleuropäische Sommerzeit schrieb Chaoyi Chen:
> From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>
> This series is dedicated to enhancing the DSI controller and PHY timing
> interaction, refining the lane rate calculation, and addressing the
> associated hardware limitations.
Took me a bit to finally test all the different variants for a display
that shows strange behaviour. Sorry this gets a bit longer.
The display in question is the ltk050h3148w [0], display in portrait
orientation.
Ever since commit ac87d23694f4 ("drm/bridge: synopsys: dw-mipi-dsi: Use
pixel clock rate to calculate lbcc") [1] and the subsequent fix in commit
93e82bb4de01 ("drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for
burst mode") [2], that display has its output shifted about 20 pixels to
the right, with the line then continuing on the next display line.
We have this display running on all the Theobroma-System modules, so there
is a lot of variant data :-) .
Your series actually fixed the PX30 part of that shifted output, but for
the RK3399 the results are sort of mixed:
What was confusing me was that in the Rockchip vendor kernel, _all_ DSI
variants use the standard px30 phy settings? The whole original lookup
table seems to be gone? And that replicating that setting actually fixes
the shifted output on RK3399 too?
RK3399:
original:
shifted
mode-clock 59400, target_mbps 450
patches 1+2:
shifted
mode-clock 59400, target_mbps 450
patch 3:
blank disiplay
mode-clock 59400, target_mbps 400
use static px30 phy with patch3:
image is compressed in height and displayed two times one below the other
image is _not_ shifted anymore (so left+right alignment are correct)
mode-clock 59400, target_mbps 400
use static px30 phy without patch3:
image is _not_ shifted anymore
output is correct
mode-clock 59400, target_mbps 450
PX30:
original
shifted
mode-clock 59556, target_mbps 450
patches 1+2:
output is correct
image is _not_ shifted anymore (so left+right alignment are correct)
mode-clock 59556, target_mbps 450
patch 3:
output is still correct
mode-clock 59556, target_mbps 400
RK3588 (DSI2) for reference:
output is correct
mode-clock 59756, lane_mbps 398
Do you have any insight, what could go wrong here?
I'll apply patches 1+2 as they're correct, but will keep patch3 out
for now.
Also Sashiko seems to still be unhappy with patch3.
Thanks a lot
Heiko
[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c#n299
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac87d23694f44af44a98d21dd77016f2756b6b1b
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93e82bb4de0196c4caeca1d8a6eef67863981d8f
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (subset) [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
` (3 preceding siblings ...)
2026-09-15 13:36 ` [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Heiko Stübner
@ 2026-09-15 16:39 ` Heiko Stuebner
4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2026-09-15 16:39 UTC (permalink / raw)
To: Sandy Huang, Andy Yan, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Chaoyi Chen
Cc: Heiko Stuebner, dri-devel, linux-arm-kernel, linux-rockchip,
linux-kernel, Chaoyi Chen
On Mon, 14 Sep 2026 09:33:28 +0800, Chaoyi Chen wrote:
> This series is dedicated to enhancing the DSI controller and PHY timing
> interaction, refining the lane rate calculation, and addressing the
> associated hardware limitations.
>
> Changes in v5:
> - Link to v4: https://lore.kernel.org/all/20260812073002.328-1-kernel@airkyi.com/
> - Change the upper bound check for target_mbps from < to <= (sashiko).
>
> [...]
Applied, thanks!
[1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation
commit: 3c58af05953af5ab120e2c9061d7bdedde0d1bfd
[2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types
commit: 5363e01e4ff03a204cab85292b89cf90c2d1b101
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms
2026-09-15 13:36 ` [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Heiko Stübner
@ 2026-09-16 1:54 ` Chaoyi Chen
0 siblings, 0 replies; 7+ messages in thread
From: Chaoyi Chen @ 2026-09-16 1:54 UTC (permalink / raw)
To: Heiko Stübner, Sandy Huang, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chaoyi Chen
Cc: dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
Hello Heiko,
On 9/15/2026 9:36 PM, Heiko Stübner wrote:
> Hi,
>
> Am Montag, 14. September 2026, 03:33:28 Mitteleuropäische Sommerzeit schrieb Chaoyi Chen:
>> From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
>>
>> This series is dedicated to enhancing the DSI controller and PHY timing
>> interaction, refining the lane rate calculation, and addressing the
>> associated hardware limitations.
>
>
> Took me a bit to finally test all the different variants for a display
> that shows strange behaviour. Sorry this gets a bit longer.
>
>
> The display in question is the ltk050h3148w [0], display in portrait
> orientation.
>
> Ever since commit ac87d23694f4 ("drm/bridge: synopsys: dw-mipi-dsi: Use
> pixel clock rate to calculate lbcc") [1] and the subsequent fix in commit
> 93e82bb4de01 ("drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for
> burst mode") [2], that display has its output shifted about 20 pixels to
> the right, with the line then continuing on the next display line.
>
> We have this display running on all the Theobroma-System modules, so there
> is a lot of variant data :-) .
>
> Your series actually fixed the PX30 part of that shifted output, but for
> the RK3399 the results are sort of mixed:
>
>
> What was confusing me was that in the Rockchip vendor kernel, _all_ DSI
> variants use the standard px30 phy settings? The whole original lookup
> table seems to be gone? And that replicating that setting actually fixes
> the shifted output on RK3399 too?
>
Thanks a lot for the thorough testing!
The RK3399 results are surprising, as the Synopsys databook
configuration actually performs worse than the PX30 PHY configuration.
As for the vendor changes, unfortunately the specific reasons are lost
to history. But what is certain is that the original intent was to
resolve the interoperability issues with INNO PHY on PX30 and
subsequent platforms.
So I've gone with a compromise in this series to distinguish INNO PHY
and Synopsys PHY. I'm not sure if using the same configuration for both
would work out completely, but so far no related issues have been
reported in the vendor kernel.
I don't have a better idea for patch 3 right now, because different
platforms and panels may have different requirements for target_mbps.
In vendor kernel, we read the DTS to override target_mbps like this:
/* optional override of the desired bandwidth */
if (!of_property_read_u32(dev->of_node, "rockchip,lane-rate", &value)) {
target_mbps = value;
}
Would you consider this modification acceptable as an alternative to
patch 3? Thank you.
>
> RK3399:
> original:
> shifted
> mode-clock 59400, target_mbps 450
>
> patches 1+2:
> shifted
> mode-clock 59400, target_mbps 450
>
> patch 3:
> blank disiplay
> mode-clock 59400, target_mbps 400
>
> use static px30 phy with patch3:
> image is compressed in height and displayed two times one below the other
> image is _not_ shifted anymore (so left+right alignment are correct)
> mode-clock 59400, target_mbps 400
>
> use static px30 phy without patch3:
> image is _not_ shifted anymore
> output is correct
> mode-clock 59400, target_mbps 450
>
>
> PX30:
> original
> shifted
> mode-clock 59556, target_mbps 450
>
> patches 1+2:
> output is correct
> image is _not_ shifted anymore (so left+right alignment are correct)
> mode-clock 59556, target_mbps 450
>
> patch 3:
> output is still correct
> mode-clock 59556, target_mbps 400
>
> RK3588 (DSI2) for reference:
> output is correct
> mode-clock 59756, lane_mbps 398
>
>
> Do you have any insight, what could go wrong here?
>
> I'll apply patches 1+2 as they're correct, but will keep patch3 out
> for now.
>
> Also Sashiko seems to still be unhappy with patch3.
>
>
> Thanks a lot
> Heiko
>
>
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c#n299
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac87d23694f44af44a98d21dd77016f2756b6b1b
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93e82bb4de0196c4caeca1d8a6eef67863981d8f
--
Best,
Chaoyi
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-16 5:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14 1:33 [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types Chaoyi Chen
2026-09-14 1:33 ` [PATCH v5 3/3] drm/rockchip: dsi: Relax the lane rate margin requirements Chaoyi Chen
2026-09-15 13:36 ` [PATCH v5 0/3] DSI Controller improvements for Rockchip platforms Heiko Stübner
2026-09-16 1:54 ` Chaoyi Chen
2026-09-15 16:39 ` (subset) " Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®