Skip to content

Commit b8f27ab

Browse files
committed
Add KMScube & WestonSimpleEGL Test for Graphics Public CI
Add weston check to functestlib & Remove stale Weston socket Signed-off-by: Maheswara Pappula <maheswa@qti.qualcomm.com>
1 parent 8ba9498 commit b8f27ab

File tree

6 files changed

+404
-58
lines changed

6 files changed

+404
-58
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
3+
SPDX-License-Identifier: BSD-3-Clause-Clear
4+
# KMSCube GraphicsTest Scripts for Qualcomm Linux based platform (Yocto)
5+
# Overview
6+
7+
Graphics scripts automates the validation of Graphics OpenGL ES 2.0 capabilities on the Qualcomm RB3 Gen2 platform running a Yocto-based Linux system. It utilizes kmscube test app which is publicly available at https://gitlab.freedesktop.org/mesa/kmscube
8+
9+
## Features
10+
11+
- Primarily uses OpenGL ES 2.0, but recent versions include headers for OpenGL ES 3.0 for compatibility
12+
- Uses Kernel Mode Setting (KMS) and Direct Rendering Manager (DRM) to render directly to the screen without a display server
13+
- Designed to be lightweight and minimal, making it ideal for embedded systems and validation environments.
14+
- Can be used to measure GPU performance or validate rendering pipelines in embedded Linux systems
15+
16+
## Prerequisites
17+
18+
Ensure the following components are present in the target Yocto build:
19+
20+
- kmscube (Binary Available in /usr/bin) - this test app can be compiled from https://gitlab.freedesktop.org/mesa/kmscube
21+
- Weston should be killed while running KMSCube Test
22+
- Write access to root filesystem (for environment setup)
23+
24+
## Directory Structure
25+
26+
```
27+
bash
28+
Runner/
29+
├── suites/
30+
│ ├── Multimedia/
31+
│ │ ├── Graphics/
32+
│ │ │ ├── KMSCube/
33+
│ │ │ │ ├── run.sh
34+
```
35+
36+
## Usage
37+
38+
Instructions
39+
40+
1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to any directory on the target device.
41+
42+
2. Verify Transfer: Ensure that the repo have been successfully copied to any directory on the target device.
43+
44+
3. Run Scripts: Navigate to the directory where these files are copied on the target device and execute the scripts as needed.
45+
46+
Run a Graphics KMSCube test using:
47+
---
48+
#### Quick Example
49+
```
50+
git clone <this-repo>
51+
cd <this-repo>
52+
scp -r common Runner user@target_device_ip:<Path in device>
53+
ssh user@target_device_ip
54+
cd <Path in device>/Runner && ./run-test.sh KMSCube
55+
```
56+
#### Sample output:
57+
```
58+
sh-5.2# cd <Path in device>/Runner/ && ./run-test.sh && ./run-test.sh KMSCube
59+
[Executing test case: KMSCube] 2025-01-08 19:54:40 -
60+
[INFO] 2025-01-08 19:54:40 - -------------------------------------------------------------------
61+
[INFO] 2025-01-08 19:54:40 - ------------------- Starting kmscube Testcase -------------------
62+
[INFO] 2025-01-08 19:54:40 - Stopping Weston...
63+
[INFO] 2025-01-08 19:54:42 - Weston stopped.
64+
[INFO] 2025-01-08 19:54:42 - Running kmscube test with --count=999...
65+
[PASS] 2025-01-08 19:54:59 - kmscube : Test Passed
66+
[INFO] 2025-01-08 19:55:02 - Weston started.
67+
[INFO] 2025-01-08 19:55:02 - ------------------- Completed kmscube Testcase ------------------
68+
[PASS] 2025-01-08 19:55:02 - KMSCube passed
69+
70+
[INFO] 2025-01-08 19:55:02 - ========== Test Summary ==========
71+
PASSED:
72+
KMSCube
73+
74+
FAILED:
75+
None
76+
[INFO] 2025-01-08 19:55:02 - ==================================
77+
sh-5.2#
78+
```
79+
## Notes
80+
81+
- It validates the graphics gles2 functionalities.
82+
- If any critical tool is missing, the script exits with an error message.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/sh
2+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3+
# SPDX-License-Identifier: BSD-3-Clause-Clear
4+
5+
# KMSCube Validator Script (Yocto-Compatible)
6+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7+
INIT_ENV=""
8+
SEARCH="$SCRIPT_DIR"
9+
while [ "$SEARCH" != "/" ]; do
10+
if [ -f "$SEARCH/init_env" ]; then
11+
INIT_ENV="$SEARCH/init_env"
12+
break
13+
fi
14+
SEARCH=$(dirname "$SEARCH")
15+
done
16+
17+
if [ -z "$INIT_ENV" ]; then
18+
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
19+
exit 1
20+
fi
21+
22+
if [ -z "$__INIT_ENV_LOADED" ]; then
23+
# shellcheck disable=SC1090
24+
. "$INIT_ENV"
25+
fi
26+
27+
# shellcheck disable=SC1090,SC1091
28+
. "$TOOLS/functestlib.sh"
29+
30+
TESTNAME="kmscube"
31+
FRAME_COUNT=999
32+
EXPECTED_FRAMES=$((FRAME_COUNT - 1))
33+
test_path=$(find_test_case_by_name "$TESTNAME")
34+
cd "$test_path" || exit 1
35+
RES_FILE="./$TESTNAME.res"
36+
LOG_FILE="./${TESTNAME}_run.log"
37+
rm -f "$RES_FILE" "$LOG_FILE"
38+
39+
log_info "-------------------------------------------------------------------"
40+
log_info "------------------- Starting $TESTNAME Testcase -------------------"
41+
42+
if check_dependencies "$TESTNAME"; then
43+
log_fail "$TESTNAME : kmscube binary not found"
44+
echo "$TESTNAME SKIP" > "$RES_FILE"
45+
exit 1
46+
fi
47+
48+
weston_was_running=0
49+
if weston_is_running; then
50+
weston_stop
51+
weston_was_running=1
52+
fi
53+
54+
log_info "Running kmscube test with --count=$FRAME_COUNT..."
55+
if kmscube --count="$FRAME_COUNT" > "$LOG_FILE" 2>&1; then
56+
if grep -q "Rendered $EXPECTED_FRAMES frames" "$LOG_FILE"; then
57+
log_pass "$TESTNAME : Test Passed"
58+
echo "$TESTNAME PASS" > "$RES_FILE"
59+
else
60+
log_fail "$TESTNAME : Expected output not found (Rendered $EXPECTED_FRAMES frames)"
61+
echo "$TESTNAME FAIL" > "$RES_FILE"
62+
fi
63+
else
64+
log_fail "$TESTNAME : Execution failed (non-zero exit code)"
65+
echo "$TESTNAME FAIL" > "$RES_FILE"
66+
fi
67+
68+
if [ "$weston_was_running" -eq 1 ]; then
69+
log_info "weston realuching after $TESTNAME completion"
70+
weston_start
71+
fi
72+
73+
log_info "------------------- Completed $TESTNAME Testcase ------------------"
74+
exit 0

Runner/suites/Multimedia/Graphics/run.sh

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
3+
SPDX-License-Identifier: BSD-3-Clause-Clear
4+
# weston-simple-egl GraphicsTest Scripts for Qualcomm Linux based platform (Yocto)
5+
# Overview
6+
7+
Graphics scripts automates the validation of Graphics OpenGL ES 2.0 capabilities on the Qualcomm RB3 Gen2 platform running a Yocto-based Linux system. It utilizes Weston-Simple-EGL test app which is publicly available at https://github.com/krh/weston
8+
9+
## Features
10+
11+
- Wayland Client Integration , Uses wl_compositor, wl_shell, wl_seat, and wl_shm interfaces
12+
- OpenGL ES 2.0 Rendering
13+
- EGL Context Initialization
14+
15+
## Prerequisites
16+
17+
Ensure the following components are present in the target Yocto build:
18+
19+
- `weston-simple-egl` (Binary Available in /usr/bin) be default
20+
- Write access to root filesystem (for environment setup)
21+
22+
## Directory Structure
23+
24+
```
25+
bash
26+
Runner/
27+
├── suites/
28+
│ ├── Multimedia/
29+
│ │ ├── Graphics/
30+
│ │ │ ├── weston-simple-egl/
31+
│ │ │ │ ├── run.sh
32+
```
33+
34+
## Usage
35+
36+
Instructions
37+
38+
1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to any directory on the target device.
39+
40+
2. Verify Transfer: Ensure that the repo have been successfully copied to any directory on the target device.
41+
42+
3. Run Scripts: Navigate to the directory where these files are copied on the target device and execute the scripts as needed.
43+
44+
Run Graphics weston-simple-egl using:
45+
---
46+
#### Quick Example
47+
```
48+
git clone <this-repo>
49+
cd <this-repo>
50+
scp -r common Runner user@target_device_ip:<Path in device>
51+
ssh user@target_device_ip
52+
cd <Path in device>/Runner && ./run-test.sh weston-simple-egl
53+
```
54+
55+
#### Sample output:
56+
```
57+
sh-5.2# cd <Path in device>/Runner/ && ./run-test.sh weston-simple-egl
58+
[Executing test case: weston-simple-egl] 2025-01-08 19:57:17 -
59+
[INFO] 2025-01-08 19:57:17 - --------------------------------------------------------------------------
60+
[INFO] 2025-01-08 19:57:17 - ------------------- Starting weston-simple-egl Testcase --------------------------
61+
[INFO] 2025-01-08 19:57:17 - Weston already running.
62+
[INFO] 2025-01-08 19:57:17 - Running weston-simple-egl for 30 seconds...
63+
QUALCOMM build : 05b958b3c9, Ia7470d0c4c
64+
Build Date : 03/27/25
65+
OpenGL ES Shader Compiler Version:
66+
Local Branch :
67+
Remote Branch :
68+
Remote Branch :
69+
Reconstruct Branch :
70+
71+
Build Config : G ESX_C_COMPILER_OPT 3.3.0 AArch64
72+
Driver Path : /usr/lib/libGLESv2_adreno.so.2
73+
Driver Version : 0808.0.6
74+
Process Name : weston-simple-egl
75+
PFP: 0x016dc112, ME: 0x00000000
76+
Pre-rotation disabled !!!
77+
78+
EGL updater thread started
79+
80+
MSM_GEM_NEW returned handle[1] for drm_fd=5 buffer flag=65536 buffer size=266240
81+
Get fd[7] from GEM HANDLE[1]
82+
MSM_GEM_NEW returned handle[2] for drm_fd=5 buffer flag=65536 buffer size=266240
83+
Get fd[7] from GEM HANDLE[2]
84+
MSM_GEM_NEW returned handle[3] for drm_fd=5 buffer flag=65536 buffer size=266240
85+
Get fd[7] from GEM HANDLE[3]
86+
MSM_GEM_NEW returned handle[4] for drm_fd=5 buffer flag=65536 buffer size=266240
87+
Get fd[7] from GEM HANDLE[4]
88+
303 frames in 5 seconds: 60.599998 fps
89+
300 frames in 5 seconds: 60.000000 fps
90+
298 frames in 5 seconds: 59.599998 fps
91+
300 frames in 5 seconds: 60.000000 fps
92+
299 frames in 5 seconds: 59.799999 fps
93+
[PASS] 2025-01-08 19:57:49 - weston-simple-egl : Test Passed
94+
[INFO] 2025-01-08 19:57:49 - ------------------- Completed weston-simple-egl Testcase ------------------------
95+
[PASS] 2025-01-08 19:57:49 - weston-simple-egl passed
96+
97+
[INFO] 2025-01-08 19:57:49 - ========== Test Summary ==========
98+
PASSED:
99+
weston-simple-egl
100+
101+
FAILED:
102+
None
103+
[INFO] 2025-01-08 19:57:49 - ==================================
104+
sh-5.2#
105+
```
106+
## Notes
107+
108+
- It validates the graphics gles2 functionalities.
109+
- If any critical tool is missing, the script exits with an error message.

0 commit comments

Comments
 (0)