PROCESSOR-SDK-AM62X: Weston Fails to Wake from idle-time Sleep, Restarts After SIGTERM

Part Number: PROCESSOR-SDK-AM62X
Other Parts Discussed in Thread: AM625

Tool/software:

Hardware:

  • Board: TI AM62xx-EVM (AM625 SK)

  • Peripherals: HDMI Monitor, Logitech USB Optical Mouse, Dell KB216 Wired Keyboard

Software:

  • TI SDK Version: Processor SDK Linux 10.x/11.x (Yocto-based Arago distribution)

  • Weston Version: 13.0.1

  • Kernel Version: 6.12.35-ti-00915-ge3e551586dfa

  • Graphics Driver: PowerVR (pvrsrvkm) with GLES 3.1 support

  • Display Driver: tidss

Goal:
My goal is to use Weston's standard idle-sleep functionality. The display should blank after a configured period of inactivity and wake up immediately upon keyboard or mouse input.


Problem Description:

I have configured Weston to enter an idle state after 20 seconds by setting idle-time=20 in /etc/xdg/weston/weston.ini.

The system behaves as follows:

  1. After 20 seconds of inactivity, the HDMI display correctly blanks.

  2. When I move the mouse or press a key on the keyboard, the display does not wake up. It remains blank.

  3. After approximately 2.5 minutes of the screen being blank, the weston process receives a SIGTERM (signal 15) and is terminated.

  4.  now i have to manually restart the service via systemd so that the GUI returns

This cycle makes the idle-time feature unusable. Disabling the feature by setting idle-time=0 works, but I require the power-saving sleep functionality.

Steps to Reproduce:

  1. Flash an AM62xx-EVM with a standard Processor SDK Linux image.

  2. Connect an HDMI monitor and standard USB input devices.

  3. Boot the device and edit /etc/xdg/weston/weston.ini.

  4. Under the [core] section, add or modify the line: idle-time=20

  5. Reboot the device or restart the service with systemctl restart weston.

  6. Allow the device to sit idle for 20 seconds until the screen blanks.

  7. Attempt to wake the device by moving the mouse or pressing a keyboard key.

Log Analysis:

The journal log confirms that Weston receives "caught signal 15" which leads to the deactivation of the service.

This strongly suggests the underlying issue is the driver stack's failure to wake the display, which makes the Weston compositor unresponsive, eventually causing systemd-logind to time out and terminate the idle session.

No errors are reported from the tidss or PowerVR drivers during the attempted wake-up.

i joined the journalctl -xe  | grep weston below:

WESTON_LOG

Any guidance on how to resolve this wake-up failure would be greatly appreciated. Thank you.

  • Hi,

    I am checking with our dev team and will get back to you.

    Regards,
    Krunal

  • Thanks, Krunal. I look forward to hearing from you.

  • Hi,

    Is it possible for you to remove the GPU module and relaunch weston with CPU. We would like to isolate the issue between GPU and DSS.

    Regards,
    Krunal

  • Hi,

    Thank you for the suggestion. As requested, I disabled the GPU module (pvrsrvkm) and relaunched Weston using CPU-based rendering (Pixman) to isolate whether the issue is related to the GPU or DSS. Below, I'll detail the steps I followed, the configurations used, the observed behavior, and key logs. I've attached a PDF document ("weston-log") containing the full logs.

    System details:

    • uname -a: Linux am62xx-evm 6.12.35-ti-00915-ge3e551586dfa #1 SMP PREEMPT Tue Jul 1 21:17:52 UTC 2025 aarch64 GNU/Linux
    • cat /etc/os-release: Arago 2025.01

    Steps Taken to Disable GPU and Use CPU Rendering

    1. Disabled GPU Module:

      • Verified loaded modules with lsmod (pvrsrvkm was present).
      • Removed the module: rmmod pvrsrvkm.
      • Confirmed removal with lsmod (pvrsrvkm no longer listed).

    2. Modifed Weston Configuration for CPU Rendering:(weston.ini)

      • Edited /etc/xdg/weston/weston.ini to force software rendering by adding use-pixman=true under the [drm] section. This disables GPU acceleration and uses Pixman (CPU-based).
    3. Launched Weston with Strace for Debugging:(strace)

      • Ran strace -f -o /tmp/weston.strace weston to capture traces.
      • Allowed idle for 20 seconds → screen blanked.
      • Attempted wake-up with mouse/keyboard → no wake-up; Weston crashed after ~2.5 minutes with SIGABRT (signal 6).

    Observed Behavior

    • Idle Entry: After 20 seconds, the screen blanks correctly (HDMI signal stops, monitor enters sleep mode).
    • Wake Attempt: Mouse movement or key press does not restore the display. Screen remains blank.
    • Crash: After  wake-up with mouse/keyboard Weston aborts with an assertion failure: weston: /usr/src/debug/weston/13.0.1/libweston/compositor.c:3730: weston_output_finish_frame: Assertion timespec_sub_to_nsec(stamp, &output->frame_time) >= 0' failed.`
    • No GPU Involvement: The crash still occurs in pure CPU rendering mode, confirming the GPU (pvrsrvkm) is not the root cause.
    • Manual Restart Required: Had to restart Weston via systemctl restart weston to recover the GUI.

    This matches the original issue, but now isolated to CPU/DSS paths.

    Logs from Strace Run

    • Weston starts successfully in DRM backend with Pixman renderer.
    • Detects HDMI-A-1 output, sets mode 1024x768@60.0.
    • Enters sleep mode after idle.
    • Upon wake attempt: Assertion failure due to negative timestamp delta.
    • Full startup log excerpt:
       
      Date: 2025-05-29 UTC
      [21:54:02.191] weston 13.0.1
      ...
      [21:54:02.316] Using Pixman renderer
      ...
      [21:54:08.111] DRM: head 'HDMI-A-1' found, connector 41 is connected...
      [21:54:08.125] Output HDMI-A-1 (crtc 39) video modes: 1024x768@60.0, current...
      ...
      Enters sleep mode
      ...
      weston: ... Assertion `timespec_sub_to_nsec(stamp, &output->frame_time) >= 0' failed.
      Aborted (core dumped)
    • Audit logs show SIG6 (ABRT) on Weston PID.

    Additional Tests with Modetest 

    To further isolate DSS behavior:

    • modetest -M tidss -s 41@39:1024x768-60: Sets mode; screen shows colored display until Enter pressed (returns to black).
    • modetest -M tidss -w 41:DPMS:3: Screen darkens briefly, then back to black (expected low-power state, but HDMI signal doesn't fully stop as monitor doesn't enter standby).
    • modetest -M tidss -w 41:DPMS:0: No change; screen remains black (should restore signal and wake monitor, but doesn't).

    Expected vs. Actual for DPMS:

    • DPMS:3 (Off): HDMI signal should stop fully (monitor to standby), low power engaged. Actual: Brief darken, no full signal stop.
    • DPMS:0 (On): Signal restored, monitor wakes, image reappears without mode reset. Actual: No change; indicates bug in atomic commit or encoder enable logic in tidss driver.

    Key Findings 

    • Crash persists in software rendering → GPU not root cause; likely DSS 

    Let me know if you need any additional tests or logs. Thanks for your assistance!

    Best regards,

    Eya

  • When I tried to apply the patch file directly with the patch tool on my tidss_dispc.c, the application failed. This indicates my kernel tree’s tidss_dispc.c didn’t match exactly the context expected by the patch (likely due to version differences) i got this do-patch error message( error-do-patch-bitbake).

    i specifically could not apply this part of [patch 1/2]:

    @@ -1244,7 +1231,10 @@ void dispc_vp_enable(struct dispc_device *dispc, u32 hw_videoport,
    mode->crtc_hdisplay - 1) |
    FIELD_PREP(DISPC_VP_SIZE_SCREEN_VDISPLAY_MASK,
    mode->crtc_vdisplay - 1));
    +}

    i can't find the highlighted part in my  tidss_dispc.c file 
    i can't find any information about the version of vernel module the patch applies to

    i tried to apply it manualy  

    What I did manually

    • update tidss_crtc.c and tidss_crtc.c  with no problem

    • Merged the contents of dispc_vp_enable() into dispc_vp_prepare() (except the final enable bit).

    • Simplified dispc_vp_enable() to only set the enable bit.

    • Created a patched tidss_dispc.c successfully.

      the manual modification didn't solve the problem and still got an error at kernel module compilation here is the log attached: do-compile-kernel-modules-log

    Request for help:

    • Is there a recommended TI kernel branch or version where this patch applies cleanly? im using the 6.12.35 kernel version

  • Hi,

    I am checking with our driver team and I will get back to you.

    Regards,
    Krunal

  • Thank you for providing the initial patch to address the Weston wake-up issue.

     I successfully adapted it for Kernel 6.12 and confirmed that it resolves the problem on my AM62x platform.

    Since the original patch wasn't directly compatible with kernel 6.12, I created a modified version. I’m sharing my process and the final patch here in case other developers using a similar kernel version encounter the same issue.

    Steps I Followed:

    1. Created a Custom Meta-Layer: I set up a custom Yocto meta-layer to manage my kernel modifications cleanly.
    1. Added a bbappend File: I created the file recipes-kernel/linux/linux-ti-staging_%.bbappend in my meta-layer with the following content to apply my custom patch

    2. Placed the Patch: I placed my adapted patch file, tidss-update.patch, in the directory recipes-kernel/linux/linux-ti-staging/ within my meta-layer.

    3. Rebuilt and Deployed: After rebuilding the image with bitbake, the patch was applied, and the resulting system now wakes up from idle/sleep correctly without restarting Weston.

      The Patches:

      For transparency and to help others understand the changes i joined the patch that worked for me (tidss-update.patch)

      Thanks again for your support. I hope this helps others in the community!

  • Hi,

    Apologies for the delay and thank you for sharing your patch + results with the community. As you stated, the patch we shared was for upstream Kernel and our team has back ported the patch to tiL6.12-11.01.13. I have attached it for your reference.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_drm_2D00_tidss_2D00_Set_2D00_vblank_2D00_event_2D00_time_2D00_at_2D00_crtc_5F00_atomic_5F00_enabl.patch

    Regards,
    Krunal