Due to semantic changes in the bridge core, panels cannot send
any DSI commands in the prepare/unprepare callbacks: there is
no guarantee that the DSI transmitter is available at this
point.

Tested on the Samsung Skomer (GT-S7710).

Cc: Aradhya Bhatia <[email protected]>
Fixes: c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable and 
post-disable")
Signed-off-by: Linus Walleij <[email protected]>
---
 drivers/gpu/drm/panel/panel-novatek-nt35510.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c 
b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
index 3189d89c7ca0..ecd3fb09f9fc 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
@@ -971,6 +971,13 @@ static int nt35510_power_off(struct nt35510 *nt)
 }
 
 static int nt35510_unprepare(struct drm_panel *panel)
+{
+       struct nt35510 *nt = panel_to_nt35510(panel);
+
+       return nt35510_power_off(nt);
+}
+
+static int nt35510_disable(struct drm_panel *panel)
 {
        struct nt35510 *nt = panel_to_nt35510(panel);
        struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
@@ -993,23 +1000,22 @@ static int nt35510_unprepare(struct drm_panel *panel)
        /* Wait 4 frames, how much is that 5ms in the vendor driver */
        usleep_range(5000, 10000);
 
-       ret = nt35510_power_off(nt);
-       if (ret)
-               return ret;
-
        return 0;
 }
 
 static int nt35510_prepare(struct drm_panel *panel)
+{
+       struct nt35510 *nt = panel_to_nt35510(panel);
+
+       return nt35510_power_on(nt);
+}
+
+static int nt35510_enable(struct drm_panel *panel)
 {
        struct nt35510 *nt = panel_to_nt35510(panel);
        struct mipi_dsi_device *dsi = to_mipi_dsi_device(nt->dev);
        int ret;
 
-       ret = nt35510_power_on(nt);
-       if (ret)
-               return ret;
-
        /* Exit sleep mode */
        ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
        if (ret) {
@@ -1078,6 +1084,8 @@ static int nt35510_get_modes(struct drm_panel *panel,
 static const struct drm_panel_funcs nt35510_drm_funcs = {
        .unprepare = nt35510_unprepare,
        .prepare = nt35510_prepare,
+       .disable = nt35510_disable,
+       .enable = nt35510_enable,
        .get_modes = nt35510_get_modes,
 };
 

-- 
2.51.0

Reply via email to