Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Yocto images must provide the required client and Weston runtime. On Ubuntu and
- `./run.sh --base` selects the upstream MSM/freedreno stack and ensures the OS-specific Mesa package set.
- `./run.sh --overlay` selects the Qualcomm KGSL/Adreno stack and ensures the OS-specific overlay package set. Package or DKMS changes can require a reboot before validation continues.
- Debian uses `libgbm-msm1`, while Ubuntu uses `libgbm-msm`. Set `GPU_OVERLAY_GBM_PACKAGE` only when an explicit override is required.
- Desktop automatic mode runs `weston-simple-egl -b` when the client advertises that option. This is an unsynchronized EGL throughput benchmark with a minimum functional FPS gate, not a display-refresh measurement.
- Yocto, other image-based runs, and `--strict-refresh-fps` keep the compositor-synchronized client mode. FPS evidence remains required by default. Use `--no-require-fps` only when connectivity and EGL execution are the intended coverage.
- On Ubuntu, the test reuses an active GNOME Wayland session when Weston is not running. A root-launched test executes the client as the Wayland socket owner without stopping or restarting GDM.
- GDM can throttle an unfocused greeter client. That path validates compositor connectivity and EGL startup while recording, but not performance-gating, any FPS samples.

Expand Down
66 changes: 50 additions & 16 deletions Runner/suites/Multimedia/Graphics/weston-simple-egl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
# - default to the upstream MSM/freedreno base stack
# - --overlay selects the Qualcomm KGSL/Adreno package and boot stack
# - --auto validates the currently selected stack without changing it
# - use a 60 FPS functional cap in automatic FPS mode
# - keep the normal compositor-synchronized client path
# - use the unsynchronized client benchmark with a 60 FPS functional target in
# automatic FPS mode because packaged clients may not report synchronized
# redraws
#
# Yocto and other image-based distributions:
# - preserve the existing image-selected graphics and Weston flow
# - do not install/remove graphics packages or alter boot artifacts
# - preserve the existing detected-refresh FPS policy and client arguments
# - preserve the existing detected-refresh FPS policy and synchronized client
#
# PASS/FAIL/SKIP is written to the result file. After testcase execution, the
# runner exits 0 for compatibility with the existing LAVA flow.
Expand Down Expand Up @@ -126,6 +127,7 @@ while [ "$#" -gt 0 ]; do

--strict-refresh-fps)
FPS_EXPECT_MODE="detected"
REQUIRE_FPS=1
;;

--require-fps)
Expand Down Expand Up @@ -155,6 +157,11 @@ FPS options:
--require-fps Require FPS evidence, default
--no-require-fps Record FPS when available but do not gate on it

Defaults:
Desktop automatic mode uses the unsynchronized client benchmark and a
minimum-throughput gate. Image-based and strict-refresh runs remain
compositor-synchronized.

Other options:
-h, --help Show this help

Expand All @@ -166,6 +173,7 @@ Environment:
EXPECT_FPS_DEFAULT Fallback expected FPS, default: 60
FPS_TOL_PCT Fixed-mode tolerance, default: 10
MIN_FPS_PCT Minimum percentage, default: 85
REQUIRE_FPS 0 or 1, default: 1
DESKTOP_FUNCTIONAL_FPS_CAP Desktop auto-mode FPS cap, default: 60
TIME_SYNC_WAIT Clock sync wait bound in seconds, 0 disables, default: 20
CLOCK_STEP_TOLERANCE Wall-clock step tolerance in seconds, default: 2
Expand Down Expand Up @@ -593,7 +601,32 @@ log_info "Wayland session user, ${DISPLAY_WAYLAND_SESSION_USER:-current-user}"
log_info "XDG_RUNTIME_DIR, ${DISPLAY_WAYLAND_SESSION_RUNTIME_DIR:-${XDG_RUNTIME_DIR:-<unset>}}"
log_info "WAYLAND_DISPLAY, $(basename "${DISPLAY_WAYLAND_SOCKET:-${WAYLAND_DISPLAY:-<unset>}}")"

log_info "Client mode, compositor-synchronized weston-simple-egl"
SIMPLE_EGL_CLIENT_ARG=""
SIMPLE_EGL_LAUNCH_MODE="compositor-synchronized"
SIMPLE_EGL_FPS_SOURCE="client-synchronized"

if [ "${DISPLAY_TEST_FPS_POLICY:-shared}" = "desktop-functional-cap" ]; then
simple_egl_help="$("$BIN" -h 2>&1)"

if printf '%s\n' "$simple_egl_help" |
grep -Eq '(^|[[:space:]])-b([[:space:]]|$)'; then
SIMPLE_EGL_CLIENT_ARG="-b"
SIMPLE_EGL_LAUNCH_MODE="desktop-unsynchronized-benchmark"
SIMPLE_EGL_FPS_SOURCE="client-unsynchronized-benchmark"
log_info "Benchmark FPS is unsynchronized EGL throughput, not display refresh"
else
log_warn "weston-simple-egl does not advertise -b, keeping compositor-synchronized mode"
fi
fi

log_info "Client mode, $SIMPLE_EGL_LAUNCH_MODE"

set -- "$BIN"

if [ -n "$SIMPLE_EGL_CLIENT_ARG" ]; then
set -- "$@" "$SIMPLE_EGL_CLIENT_ARG"
fi

# Retain the existing environment on Yocto. Upstream weston-simple-egl prints
# FPS unconditionally, while vendor builds may also honor these variables.
SIMPLE_EGL_FPS=1
Expand Down Expand Up @@ -626,15 +659,15 @@ if command -v run_with_timeout >/dev/null 2>&1; then
stdbuf \
-oL \
-eL \
"$BIN" >>"$RUN_LOG" 2>&1
"$@" >>"$RUN_LOG" 2>&1
rc=$?
else
log_warn "stdbuf is unavailable, running the client without line buffering"

display_run_in_wayland_session \
timeout \
"$DURATION" \
"$BIN" >>"$RUN_LOG" 2>&1
"$@" >>"$RUN_LOG" 2>&1
rc=$?
fi
elif command -v stdbuf >/dev/null 2>&1; then
Expand All @@ -644,15 +677,15 @@ if command -v run_with_timeout >/dev/null 2>&1; then
stdbuf \
-oL \
-eL \
"$BIN" >>"$RUN_LOG" 2>&1
"$@" >>"$RUN_LOG" 2>&1
rc=$?
else
log_warn "stdbuf is unavailable, running the client without line buffering"

run_with_timeout \
"$DURATION" \
display_run_in_wayland_session \
"$BIN" >>"$RUN_LOG" 2>&1
"$@" >>"$RUN_LOG" 2>&1
rc=$?
fi
else
Expand All @@ -671,7 +704,7 @@ else
[ -n "$duration_secs" ] || duration_secs=30
[ -n "$stop_grace_secs" ] || stop_grace_secs=3

display_run_in_wayland_session "$BIN" >>"$RUN_LOG" 2>&1 &
display_run_in_wayland_session "$@" >>"$RUN_LOG" 2>&1 &
APP_PID=$!
run_elapsed=0

Expand Down Expand Up @@ -759,13 +792,13 @@ if [ "$fps_count" -eq 0 ]; then
fi

if [ "${DISPLAY_TEST_FPS_POLICY:-shared}" = "desktop-functional-cap" ]; then
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=desktop-functional refresh=${DISPLAY_TEST_FPS_REFRESH:-unknown}Hz target=${DISPLAY_TEST_FPS_EXPECTED:-unknown} min_ok=${DISPLAY_TEST_FPS_MIN_OK:-unknown} graphics=${DISPLAY_BUILD_FLAVOUR} source=client-synchronized"
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=desktop-functional target=${DISPLAY_TEST_FPS_EXPECTED:-unknown} min_ok=${DISPLAY_TEST_FPS_MIN_OK:-unknown} graphics=${DISPLAY_BUILD_FLAVOUR} source=${SIMPLE_EGL_FPS_SOURCE}"
elif [ "${DISPLAY_TEST_FPS_POLICY:-shared}" = "desktop-session-connectivity" ]; then
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=desktop-session-connectivity graphics=${DISPLAY_BUILD_FLAVOUR} source=client-synchronized"
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=desktop-session-connectivity graphics=${DISPLAY_BUILD_FLAVOUR} source=${SIMPLE_EGL_FPS_SOURCE}"
elif [ "${DISPLAY_FPS_MODE:-}" = "detected" ]; then
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=${DISPLAY_FPS_MODE} refresh=${DISPLAY_FPS_DETECTED_HZ}Hz expected=${DISPLAY_FPS_EXPECTED} min_ok=${DISPLAY_FPS_MIN_OK} graphics=${DISPLAY_BUILD_FLAVOUR} source=client-synchronized"
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=${DISPLAY_FPS_MODE} refresh=${DISPLAY_FPS_DETECTED_HZ}Hz expected=${DISPLAY_FPS_EXPECTED} min_ok=${DISPLAY_FPS_MIN_OK} graphics=${DISPLAY_BUILD_FLAVOUR} source=${SIMPLE_EGL_FPS_SOURCE}"
else
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=${DISPLAY_FPS_MODE} expected=${DISPLAY_FPS_EXPECTED} range=[${DISPLAY_FPS_MIN_OK},${DISPLAY_FPS_MAX_OK}] graphics=${DISPLAY_BUILD_FLAVOUR} source=client-synchronized"
log_info "Result summary, rc=${rc} elapsed=${elapsed}s fps=${fps_for_summary} mode=${DISPLAY_FPS_MODE} expected=${DISPLAY_FPS_EXPECTED} range=[${DISPLAY_FPS_MIN_OK},${DISPLAY_FPS_MAX_OK}] graphics=${DISPLAY_BUILD_FLAVOUR} source=${SIMPLE_EGL_FPS_SOURCE}"
fi

final="PASS"
Expand Down Expand Up @@ -822,10 +855,11 @@ fi
printf '%s\n' "os_id=$OS_ID"
printf '%s\n' "runtime_model=${DISPLAY_RUNTIME_MODEL:-unknown}"
printf '%s\n' "wayland_socket=${DISPLAY_WAYLAND_SOCKET:-unknown}"
printf '%s\n' "simple_egl_launch_mode=compositor-synchronized"
printf '%s\n' "simple_egl_client_arg=none"
printf '%s\n' "fps_sample_source=client-synchronized"
printf '%s\n' "simple_egl_launch_mode=$SIMPLE_EGL_LAUNCH_MODE"
printf '%s\n' "simple_egl_client_arg=${SIMPLE_EGL_CLIENT_ARG:-none}"
printf '%s\n' "fps_sample_source=$SIMPLE_EGL_FPS_SOURCE"
printf '%s\n' "fps_gate_policy=${DISPLAY_TEST_FPS_POLICY:-shared}"
printf '%s\n' "fps_required=$REQUIRE_FPS"
printf '%s\n' "fps_gate_refresh=${DISPLAY_TEST_FPS_REFRESH:-unknown}"
printf '%s\n' "fps_gate_expected=${DISPLAY_TEST_FPS_EXPECTED:-unknown}"
printf '%s\n' "fps_gate_minimum=${DISPLAY_TEST_FPS_MIN_OK:-unknown}"
Expand Down
23 changes: 16 additions & 7 deletions Runner/utils/lib_display.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5971,6 +5971,10 @@ display_resolve_test_fps_gate_policy() {
return 0
}

# Apply the resolved FPS policy to one test result.
# Arguments: average FPS, sample count, and 0 or 1 indicating whether FPS is required.
# Returns: 0 when the selected policy passes or is diagnostic, 1 on a required FPS failure.
# Side effects: emits the policy decision through the shared logging helpers.
display_apply_test_fps_gate_policy() {
datfgp_avg="${1:--}"
datfgp_count="${2:-0}"
Expand Down Expand Up @@ -6007,16 +6011,21 @@ display_apply_test_fps_gate_policy() {
return 0
fi

if [ "$datfgp_count" -eq 0 ]; then
if [ "$datfgp_require" -ne 0 ]; then
log_fail "Desktop functional FPS gate enabled but no FPS samples were found"
return 1
if [ "$datfgp_require" -eq 0 ]; then
if [ "$datfgp_count" -eq 0 ]; then
log_warn "No FPS samples were produced by the desktop client, compositor connectivity and EGL execution were validated"
else
log_info "Recording desktop FPS samples without performance gating, samples=$datfgp_count avg=$datfgp_avg"
fi

log_warn "No FPS samples were found, FPS gating was not requested"
return 0
fi

if [ "$datfgp_count" -eq 0 ]; then
log_fail "Desktop functional FPS gate enabled but no FPS samples were found"
return 1
fi

if ! printf '%s\n' "$datfgp_avg" |
awk -v min="${DISPLAY_TEST_FPS_MIN_OK:-1}" '
$1 ~ /^[0-9]+([.][0-9]+)?$/ && ($1 + 0.0) >= (min + 0.0) {
Expand All @@ -6028,14 +6037,14 @@ display_apply_test_fps_gate_policy() {
awk -v value="$datfgp_avg" 'BEGIN { printf "%.0f", value + 0.0 }'
)"

log_fail "Average FPS below desktop functional threshold, avg=$datfgp_avg (~$datfgp_rounded) < ${DISPLAY_TEST_FPS_MIN_OK:-1} (target=${DISPLAY_TEST_FPS_EXPECTED:-unknown}, output=${DISPLAY_TEST_FPS_REFRESH:-unknown}Hz)"
log_fail "Average FPS below desktop functional threshold, avg=$datfgp_avg (~$datfgp_rounded) < ${DISPLAY_TEST_FPS_MIN_OK:-1} (target=${DISPLAY_TEST_FPS_EXPECTED:-unknown})"
return 1
fi

datfgp_rounded="$(
awk -v value="$datfgp_avg" 'BEGIN { printf "%.0f", value + 0.0 }'
)"

log_info "Desktop functional FPS gate passed, avg=$datfgp_avg (~$datfgp_rounded) >= ${DISPLAY_TEST_FPS_MIN_OK:-1} (target=${DISPLAY_TEST_FPS_EXPECTED:-unknown}, output=${DISPLAY_TEST_FPS_REFRESH:-unknown}Hz)"
log_info "Desktop functional FPS gate passed, avg=$datfgp_avg (~$datfgp_rounded) >= ${DISPLAY_TEST_FPS_MIN_OK:-1} (target=${DISPLAY_TEST_FPS_EXPECTED:-unknown})"
return 0
}
Loading