Skip to content

Commit ab7a24c

Browse files
committed
Multimedia/Graphics: make weston-simple-egl robust across fresh flash and reruns
Autodetect Wayland socket and adopt XDG_RUNTIME_DIR/WAYLAND_DISPLAY reliably Add display + modetest + Wayland/Weston debug snapshots for CI visibility Run weston-simple-egl with timeout, capture logs, and parse FPS stats Enforce PASS/FAIL/SKIP semantics with optional FPS gating Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent e0c5e1b commit ab7a24c

File tree

1 file changed

+52
-7
lines changed
  • Runner/suites/Multimedia/Graphics/weston-simple-egl

1 file changed

+52
-7
lines changed

Runner/suites/Multimedia/Graphics/weston-simple-egl/run.sh

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ fi
3333

3434
# shellcheck disable=SC1091
3535
. "$TOOLS/functestlib.sh"
36+
# shellcheck disable=SC1091
37+
. "$TOOLS/lib_display.sh"
3638

3739
TESTNAME="weston-simple-egl"
3840
RES_FILE="./${TESTNAME}.res"
@@ -78,7 +80,19 @@ log_info "Config: DURATION=${DURATION} STOP_GRACE=${STOP_GRACE} EXPECT_FPS=${EXP
7880
if command -v display_debug_snapshot >/dev/null 2>&1; then
7981
display_debug_snapshot "pre-display-check"
8082
fi
81-
83+
84+
# Always print modetest as part of the snapshot (best-effort).
85+
# (Some lib_display.sh variants override display_debug_snapshot without modetest.)
86+
if command -v modetest >/dev/null 2>&1; then
87+
log_info "----- modetest -M msm -ac (capped at 200 lines) -----"
88+
modetest -M msm -ac 2>&1 | sed -n '1,200p' | while IFS= read -r l; do
89+
[ -n "$l" ] && log_info "[modetest] $l"
90+
done
91+
log_info "----- End modetest -M msm -ac -----"
92+
else
93+
log_warn "modetest not found in PATH skipping modetest snapshot."
94+
fi
95+
8296
have_connector=0
8397
if command -v display_connected_summary >/dev/null 2>&1; then
8498
sysfs_summary=$(display_connected_summary)
@@ -87,13 +101,12 @@ if command -v display_connected_summary >/dev/null 2>&1; then
87101
log_info "Connected display (sysfs): $sysfs_summary"
88102
fi
89103
fi
90-
104+
91105
if [ "$have_connector" -eq 0 ]; then
92106
log_warn "No connected DRM display found, skipping ${TESTNAME}."
93107
echo "${TESTNAME} SKIP" >"$RES_FILE"
94108
exit 0
95109
fi
96-
97110
# ---------------------------------------------------------------------------
98111
# Wayland / Weston environment (runtime detection, no hardcoded flavour)
99112
# ---------------------------------------------------------------------------
@@ -103,7 +116,7 @@ fi
103116

104117
sock=""
105118

106-
# 1) Try to find any existing Wayland socket (base or overlay)
119+
# Try to find any existing Wayland socket (base or overlay)
107120
if command -v discover_wayland_socket_anywhere >/dev/null 2>&1; then
108121
sock=$(discover_wayland_socket_anywhere | head -n 1 || true)
109122
fi
@@ -116,9 +129,13 @@ if [ -n "$sock" ] && command -v adopt_wayland_env_from_socket >/dev/null 2>&1; t
116129
fi
117130
fi
118131

119-
# 2) If no usable socket yet, try starting a private Weston (overlay-style helper)
132+
# If no usable socket yet, try starting a private Weston (overlay-style helper)
120133
if [ -z "$sock" ] && command -v overlay_start_weston_drm >/dev/null 2>&1; then
121134
log_info "No usable Wayland socket; trying overlay_start_weston_drm helper..."
135+
if command -v weston_force_primary_1080p60_if_not_60 >/dev/null 2>&1; then
136+
log_info "Pre-configuring primary output to ~60Hz before starting Weston (best-effort) ..."
137+
weston_force_primary_1080p60_if_not_60 || true
138+
fi
122139
if overlay_start_weston_drm; then
123140
# Re-scan for a socket after attempting to start Weston
124141
if command -v discover_wayland_socket_anywhere >/dev/null 2>&1; then
@@ -137,7 +154,7 @@ if [ -z "$sock" ] && command -v overlay_start_weston_drm >/dev/null 2>&1; then
137154
fi
138155
fi
139156

140-
# 3) Final decision: run or SKIP
157+
# Final decision: run or SKIP
141158
if [ -z "$sock" ]; then
142159
log_warn "No Wayland socket found after autodetection; skipping ${TESTNAME}."
143160
echo "${TESTNAME} SKIP" >"$RES_FILE"
@@ -152,7 +169,35 @@ if command -v wayland_connection_ok >/dev/null 2>&1; then
152169
fi
153170
log_info "Wayland connection test: OK"
154171
else
155-
log_warn "wayland_connection_ok helper not found; continuing without explicit Wayland probe."
172+
log_warn "wayland_connection_ok helper not found continuing without explicit Wayland probe."
173+
fi
174+
175+
# ---------------------------------------------------------------------------
176+
# Ensure primary output is ~60Hz (best-effort, no churn if already ~60Hz)
177+
# - Must NOT change weston.ini behavior: that remains inside lib_display.sh
178+
# - First checks current mode (modetest path) or config (weston.ini path)
179+
# - Only attempts changes when NOT ~60Hz
180+
# ---------------------------------------------------------------------------
181+
if command -v display_debug_snapshot >/dev/null 2>&1; then
182+
display_debug_snapshot "${TESTNAME}: before-ensure-60hz"
183+
fi
184+
if command -v wayland_debug_snapshot >/dev/null 2>&1; then
185+
wayland_debug_snapshot "${TESTNAME}: before-ensure-60hz"
186+
fi
187+
188+
if command -v weston_force_primary_1080p60_if_not_60 >/dev/null 2>&1; then
189+
log_info "Ensuring primary output is ~60Hz (best-effort) ..."
190+
if weston_force_primary_1080p60_if_not_60; then
191+
log_info "Primary output is ~60Hz (or was already ~60Hz)."
192+
else
193+
log_warn "Unable to force ~60Hz (continuing; not a hard failure)."
194+
fi
195+
else
196+
log_warn "weston_force_primary_1080p60_if_not_60 helper not found; skipping ~60Hz enforcement."
197+
fi
198+
199+
if command -v display_debug_snapshot >/dev/null 2>&1; then
200+
display_debug_snapshot "${TESTNAME}: after-ensure-60hz"
156201
fi
157202

158203
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)