-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.sh
216 lines (171 loc) · 4.26 KB
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/bin/sh
SYSFS_CPU=/sys/devices/system/cpu
usage()
{
echo "Usage: $1 [options] test-case"
echo "Options:"
echo " --disable-vsync Disable synchronization to VBLANK."
echo " --hdmi Run tests on HDMI output."
echo " --lvds Run tests on LVDS output."
echo " --performance Run CPUs at maximum frequency."
echo " --regenerate Regenerate test pattern for every frame."
echo " -s, --subdivisions NUM Use NUM subdivisions for geometric adaption."
echo " --transform Simulate geometric adaption."
echo " -h, --help Display help screen and exit."
}
summarize()
{
while read line; do
echo " $line"
done
}
xserver_args=
disable_vsync=no
performance=no
regenerate=no
subdivs=
transform=no
depth=24
hdmi=no
lvds=no
while test $# -gt 0; do
if test -n "$prev"; then
eval $prev=$1
prev=; shift
continue
fi
case $1 in
--depth)
prev=depth
shift
;;
--disable-vsync)
disable_vsync=yes
shift
;;
--hdmi)
hdmi=yes
shift
;;
-h | --help)
usage $(basename $0)
exit 0
;;
--lvds)
lvds=yes
shift
;;
--performance)
performance=yes
shift
;;
--regenerate)
regenerate=yes
shift
;;
-s | --subdivisions)
prev=subdivs
shift
;;
--transform)
transform=yes
shift
;;
*)
usage $(basename $0)
exit 0
;;
esac
done
if test "$hdmi" = "yes" -a "$lvds" = "yes"; then
echo "Conflicting options --hdmi and --lvds"
exit 1
fi
export LD_LIBRARY_PATH=/usr/lib
if test -z "$DISPLAY"; then
export DISPLAY=:0
fi
if test -f /tmp/.X0-lock; then
echo "An X server is already running on display :0, aborting..."
exit 1
fi
echo "=============================================="
echo " Avionic Design GL Pipeline Benchmark"
echo "=============================================="
if test "$disable_vsync" = "yes"; then
if test -f /sys/module/window/parameters/no_vsync; then
echo -n " Disabling synchronization to VBLANK..."
echo 1 | sudo tee /sys/module/window/parameters/no_vsync > /dev/null
echo "done"
fi
fi
if test "$performance" = "yes"; then
echo -n " Running CPU at maximum frequency..."
echo performance | sudo tee $SYSFS_CPU/cpu0/cpufreq/scaling_governor > /dev/null
echo "done"
fi
echo " Using depth: $depth"
if test "$depth" = "16" -o "$depth" = "24"; then
xserver_args="-depth $depth"
else
xserver_args="-depth 24"
fi
test_args="--depth $depth"
if test "$regenerate" = "yes"; then
test_args="$test_args --regenerate"
fi
if test -n "$subdivs"; then
test_args="$test_args --subdivisions $subdivs"
fi
if test "$transform" = "yes"; then
test_args="$test_args --transform"
fi
echo -n " Starting X server..."
/usr/bin/X $xserver_args > /dev/null 2>&1 &
X_PID=$!
while ! test -f /tmp/.X0-lock; do
sleep 1
done
echo "done (PID:$X_PID)"
if test "$hdmi" = "yes"; then
echo -n " Enabling HDMI..."
xrandr --output LVDS-1 --off --output HDMI-1 --auto
echo "done"
fi
if test "$lvds" = "yes"; then
echo -n " Enabling LVDS..."
xrandr --output LVDS-1 --auto --output HDMI-1 --off
echo "done"
fi
echo "=============================================="
echo " Test 1: 1 to 1 Texture Copy"
./src/gles-standalone $test_args fill copy | summarize
echo "=============================================="
echo " Test 2: 1 to All Texture copy"
./src/gles-standalone $test_args fill copyone | summarize
echo "=============================================="
echo " Test 3: 3-Line Linear Blend"
./src/gles-standalone $test_args fill deinterlace | summarize
echo "=============================================="
echo " Test 4: GL Color Clearing (no shaders)"
./src/gles-standalone $test_args clear | summarize
echo "=============================================="
echo -n " Stopping X server..."
kill $X_PID
while test -f /tmp/.X0-lock; do
sleep 1
done
echo "done"
if test "$performance" = "yes"; then
echo -n " Restoring CPU frequency scaling..."
echo ondemand | sudo tee $SYSFS_CPU/cpu0/cpufreq/scaling_governor > /dev/null
echo "done"
fi
if test "$disable_vsync" = "yes"; then
if test -f /sys/module/window/parameters/no_vsync; then
echo -n " Enabling synchronization to VBLANK..."
echo 0 | sudo tee /sys/module/window/parameters/no_vsync > /dev/null
echo "done"
fi
fi
echo "=============================================="