Skip to content

Comments

Graphics: harden weston-simple-egl test and Weston overlay helpersDisplay#221

Merged
abbajaj806 merged 2 commits intoqualcomm-linux:mainfrom
smuppand:Display
Dec 4, 2025
Merged

Graphics: harden weston-simple-egl test and Weston overlay helpersDisplay#221
abbajaj806 merged 2 commits intoqualcomm-linux:mainfrom
smuppand:Display

Conversation

@smuppand
Copy link
Contributor

@smuppand smuppand commented Dec 3, 2025

Why this PR

  • Make weston-simple-egl test robust by using run_with_timeout + stdbuf, and parsing FPS reliably from stdout.
  • Compute average FPS across all samples, with optional REQUIRE_FPS gating against EXPECT_FPS±tolerance.
  • Improve overlay_start_weston_drm() to use /dev/socket/weston, poll for sockets, and clean up failed Weston spawns.
  • Add Weston/Wayland helpers (discover_wayland_socket_anywhere, adopt_wayland_env_from_socket, wayland_connection_ok, weston_pick_env_or_start).
  • Fix is_process_running() to prefer pgrep for name-based checks while retaining PID handling and existing return codes.

Use run_with_timeout with stdbuf -oL -eL so weston-simple-egl output is line-buffered
and FPS lines reliably land in weston-simple-egl_run.log.

Log weston-simple-egl output into weston-simple-egl_run.log and compute average FPS
across all "N frames in M seconds: X fps" lines instead of relying on a single sample.
Record min, max and average FPS and include them in the result summary for easier
performance debugging.

Gate PASS/FAIL primarily on run duration and optional FPS requirement (REQUIRE_FPS),
using EXPECT_FPS and FPS_TOL_PCT when FPS gating is enabled. Default REQUIRE_FPS=1
to enable FPS checks by default, while keeping behaviour configurable via the
environment.

Keep the .res file format unchanged, still emitting a simple
"weston-simple-egl PASS/FAIL" line so the existing Runner harness continues to work
without changes.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Make the Weston/Wayland overlay helpers more robust for the weston-simple-egl
test and similar graphics workloads.

- Rework overlay_start_weston_drm() to:
  - Use /dev/socket/weston as a private XDG_RUNTIME_DIR.
  - Create and chmod the runtime dir safely.
  - Start Weston with --continue-without-input and an explicit log file.
  - Poll for the Wayland socket up to a fixed timeout and return non-zero if
    no socket appears.
  - Avoid leaving stray Weston processes running when startup fails.

- Add and wire up Weston helpers used by the Graphics suite:
  - discover_wayland_socket_anywhere() to locate existing Wayland sockets.
  - adopt_wayland_env_from_socket() to set XDG_RUNTIME_DIR and WAYLAND_DISPLAY
    based on a discovered socket.
  - wayland_connection_ok() to sanity-check Wayland connectivity using
    wayland-info when available.
  - weston_pick_env_or_start() to prefer existing Weston sessions and only
    spawn a new one when needed, with detailed logging and socket dumps.

- Ensure the overlay path plays nicely with the base path by logging the
  suggested env exports so manual reproduction is straightforward.

Also fix ShellCheck SC2009 in is_process_running() by:

- Preferring pgrep -x <name> for name-based checks when pgrep is present.
- Falling back to a ps -e | awk pipeline in minimal environments without pgrep.
- Keeping numeric-input behaviour (kill -0 on PID) intact.
- Preserving existing log messages and 0/1 return codes so current callers
  continue to work unchanged.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Copy link
Contributor

@abbajaj806 abbajaj806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abbajaj806 abbajaj806 merged commit 3f7165c into qualcomm-linux:main Dec 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants