Skip to content

Commit ff3d5d0

Browse files
mwalledaeinki
authored andcommitted
drm: bridge: samsung-dsim: Don't use FORCE_STOP_STATE
The FORCE_STOP_STATE bit is unsuitable to force the DSI link into LP-11 mode. It seems the bridge internally queues DSI packets and when the FORCE_STOP_STATE bit is cleared, they are sent in close succession without any useful timing (this also means that the DSI lanes won't go into LP-11 mode). The length of this gibberish varies between 1ms and 5ms. This sometimes breaks an attached bridge (TI SN65DSI84 in this case). In our case, the bridge will fail in about 1 per 500 reboots. The FORCE_STOP_STATE handling was introduced to have the DSI lanes in LP-11 state during the .pre_enable phase. But as it turns out, none of this is needed at all. Between samsung_dsim_init() and samsung_dsim_set_display_enable() the lanes are already in LP-11 mode. The code as it was before commit 20c8276 ("drm: bridge: samsung-dsim: Fix init during host transfer") and 0c14d31 ("drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec") was correct in this regard. This patch basically reverts both commits. It was tested on an i.MX8M SoC with an SN65DSI84 bridge. The signals were probed and the DSI packets were decoded during initialization and link start-up. After this patch the first DSI packet on the link is a VSYNC packet and the timing is correct. Command mode between .pre_enable and .enable was also briefly tested by a quick hack. There was no DSI link partner which would have responded, but it was made sure the DSI packet was send on the link. As a side note, the command mode seems to just work in HS mode. I couldn't find that the bridge will handle commands in LP mode. Fixes: 20c8276 ("drm: bridge: samsung-dsim: Fix init during host transfer") Fixes: 0c14d31 ("drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec") Signed-off-by: Michael Walle <[email protected]> Signed-off-by: Inki Dae <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 27d1926 commit ff3d5d0

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

drivers/gpu/drm/bridge/samsung-dsim.c

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,6 @@ static int samsung_dsim_init_link(struct samsung_dsim *dsi)
969969
reg = samsung_dsim_read(dsi, DSIM_ESCMODE_REG);
970970
reg &= ~DSIM_STOP_STATE_CNT_MASK;
971971
reg |= DSIM_STOP_STATE_CNT(driver_data->reg_values[STOP_STATE_CNT]);
972-
973-
if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type))
974-
reg |= DSIM_FORCE_STOP_STATE;
975-
976972
samsung_dsim_write(dsi, DSIM_ESCMODE_REG, reg);
977973

978974
reg = DSIM_BTA_TIMEOUT(0xff) | DSIM_LPDR_TIMEOUT(0xffff);
@@ -1431,18 +1427,6 @@ static void samsung_dsim_disable_irq(struct samsung_dsim *dsi)
14311427
disable_irq(dsi->irq);
14321428
}
14331429

1434-
static void samsung_dsim_set_stop_state(struct samsung_dsim *dsi, bool enable)
1435-
{
1436-
u32 reg = samsung_dsim_read(dsi, DSIM_ESCMODE_REG);
1437-
1438-
if (enable)
1439-
reg |= DSIM_FORCE_STOP_STATE;
1440-
else
1441-
reg &= ~DSIM_FORCE_STOP_STATE;
1442-
1443-
samsung_dsim_write(dsi, DSIM_ESCMODE_REG, reg);
1444-
}
1445-
14461430
static int samsung_dsim_init(struct samsung_dsim *dsi)
14471431
{
14481432
const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -1492,9 +1476,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge,
14921476
ret = samsung_dsim_init(dsi);
14931477
if (ret)
14941478
return;
1495-
1496-
samsung_dsim_set_display_mode(dsi);
1497-
samsung_dsim_set_display_enable(dsi, true);
14981479
}
14991480
}
15001481

@@ -1503,12 +1484,8 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge,
15031484
{
15041485
struct samsung_dsim *dsi = bridge_to_dsi(bridge);
15051486

1506-
if (samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) {
1507-
samsung_dsim_set_display_mode(dsi);
1508-
samsung_dsim_set_display_enable(dsi, true);
1509-
} else {
1510-
samsung_dsim_set_stop_state(dsi, false);
1511-
}
1487+
samsung_dsim_set_display_mode(dsi);
1488+
samsung_dsim_set_display_enable(dsi, true);
15121489

15131490
dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
15141491
}
@@ -1521,9 +1498,6 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge,
15211498
if (!(dsi->state & DSIM_STATE_ENABLED))
15221499
return;
15231500

1524-
if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type))
1525-
samsung_dsim_set_stop_state(dsi, true);
1526-
15271501
dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
15281502
}
15291503

@@ -1828,8 +1802,6 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host,
18281802
if (ret)
18291803
return ret;
18301804

1831-
samsung_dsim_set_stop_state(dsi, false);
1832-
18331805
ret = mipi_dsi_create_packet(&xfer.packet, msg);
18341806
if (ret < 0)
18351807
return ret;

0 commit comments

Comments
 (0)