Verdin imx8mm: suspend/resume of panel-simple failed

Hello,

I’m successfully using a 1920x1200 MIPI-DSI panel (MI1010AQT-1) on a Verdin iMX8MM with BSPv6.2 and a custom carrier board. Since the panel is factory-initialized and only requires a power supply I’m using the panel-simple driver (patch (2.1 KB)).

I have the problem when I want to resume the system after suspending, that the display remains black. When I look into dmesg I see the following error:

[  633.128709] imx_sec_dsim_drv 32e10000.mipi_dsi: panel prepare failed: -13

This error message is printed by sec_mipi_dsim_bridge_atomic_enable (sec-dsim.c « bridge « drm « gpu « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules) because panel_simple_prepare fails.

panel_simple_prepare calls pm_runtime_get_sync which calls rpm_resume (runtime.c « power « base « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules). This function returns -EACCES when several conditions aren’t met (disable_depth, power state, runtime_status).

When I restart weston with systemctl restart weston then the panel is initialized correctly. So I used ftrace to look into the function calls when restarting weston

     kworker/0:2-1138    [000] .....  3892.029188: panel_simple_disable <-drm_panel_disable
     kworker/0:2-1138    [000] .....  3892.029196: panel_simple_unprepare <-drm_panel_unprepare
         systemd-1       [000] .....  3892.169078: panel_simple_prepare <-drm_panel_prepare
         systemd-1       [000] .....  3892.169085: panel_simple_enable <-drm_panel_enable

vs. when the system suspends/resumes

   systemd-sleep-1200    [002] .....  3950.229790: panel_simple_suspend <-pm_generic_runtime_suspend
   systemd-sleep-1200    [003] .....  3950.361140: panel_simple_disable <-drm_panel_disable
   systemd-sleep-1200    [003] .....  3950.361147: panel_simple_unprepare <-drm_panel_unprepare
   systemd-sleep-1200    [000] .....  3950.380098: panel_simple_prepare <-drm_panel_prepare
   systemd-sleep-1200    [000] .....  3950.497089: panel_simple_resume <-pm_generic_runtime_resume

So basically weston calls the same functions (disable, unprepare, prepare & enable) in the same order as when the system suspend/resume. But why does prepare fail in the second case so that enable isn’t called?

Best regards,
Markus

Hello @Mowlwurf ,
Could you please share your dmesg output when this issue happens?

Best regards,
Josep

Hello @josep.tx,

thank you for your fast respone.
I made three logs:

  1. after finished boot: boot.log (31.9 KB)
  2. after restarted weston: weston_restart.log (32.5 KB)
  3. after suspend/resume: suspend_resume.log (34.5 KB)

Best regards,
Markus

Hello @josep.tx,

can you say something new about this?

Best regards,
Markus

Hello,

it is very important for me that this issue is solved.
Can somebody please help me that?

Best regards,
Markus

Hello @Mowlwurf ,
I have tried to reproduce your issue with the following configuration.

  • Dahlia carrier board v1.1C

  • DSI to LVDS adapter V1.1

  • Verdin iMX8MM Q 2GB WB IT V1.1B

  • BSP 6.2 Reference multimedia image

I suspend and resume the module using the following command:
echo +5 > /sys/class/rtc/rtc1/wakealarm; echo deep > /sys/power/mem_sleep; echo mem > /sys/power/state

The suspend → resume process happens without errors.

Is your issue consistently reproducible? Are you able to reproduce it using a Verdin Development Board?
In the meantime I have asked internally.

Best regards,
Josep

Hello @josep.tx,

thank you for your response.

Yes, the issue is consistently reproducible. In contrast to you I’m using a MIPI-DSI panel, not a LVDS panel. Therefore another driver is used (panel-simple) which brings the error during wakeup (please see my first post).

I will try to reproduce the issue on a Verdin Devolopment Board in the next days.

Best regards,
Markus

Hello @Mowlwurf ,
Have you also tried the solution mentioned in the NXP community?

The driver mentioned there can be found here:

Best regards,
Josep

Hello @josep.tx,

I was able to reproduce the issue with the following configuration:

  • Verdin Development Board V1.1C
  • Verdin iMX8MM Q 2GB WB IT V1.1B
  • BSP 6.2 Reference multimedia image with the following custom layer: meta-gemac.zip (3.9 KB)
  • MIPI-DSI panel MI1010AQT-1 connected to X48

When I use the DSI to LVDS or DSI to HDMI adapter the problem doesn’t occure because other drivers are used.

So far I haven’t tried the Raydium driver solution because it’s only a workaround that I would try as a last option due to its complexity.

I would like to stay with the panel-simple driver because it fits best for our panel and apart from the suspend/resume it works very well.

So I hope there is a solution for the resume problem. For our part, it would be possible to provide you with a display with connector suitable for the Verdin Development Board.

Best regards,
Markus

Hello @josep.tx,

so I tried to use the Raydium driver with this patch (13.6 KB) and
device tree overlay (1.2 KB).

Here is the dmesg of the bootup: bootup.log (31.3 KB)

The driver gets loaded and I can readout the resolution of the display

$ fb-test
fb-test 1.1.0 (rosetta)
fb res 1200x1920 virtual 1200x1920, line_len 4800, bpp 32

But the backlight is not on and there’s no image either.

Any tips?

Best regards,
Markus

Hello @Mowlwurf ,

Not on this Raydium driver, but if you have the display working with panel-simple you could try to do something like this:

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 00d66d563b8ed..c6721d10aa6da 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -482,12 +482,6 @@ static int panel_simple_prepare(struct drm_panel *panel)
        if (p->prepared)
                return 0;

-       ret = pm_runtime_get_sync(panel->dev);
-       if (ret < 0) {
-               pm_runtime_put_autosuspend(panel->dev);
-               return ret;
-       }
-
        p->prepared = true;

        return 0;

I assume then the prepare function should not fail and maybe the display works afterwards.
Please let us know about the results.

Best regards,
Josep

1 Like

Hello @josep.tx,

thank you for this patch. This works!

When going to suspend for the first time, I’m getting this error:

[   14.803239] imx_sec_dsim_drv 32e10000.mipi_dsi: panel unprepare failed: -13

But this error is no problem. The display gets shut off properly and the SOM is suspended. When it wakes up, the display is switched on again.

Thank you very much for your help.

Best regards,
Markus