xref: /OK3568_Linux_fs/external/rockchip-test/gpu/test_normal_glmark2.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash -e
2
3PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
4function run_glmark2() {
5if [ "$1" == "rk312x" ]; then
6	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
7
8elif [ "$1" == "rk3288" ]; then
9	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
10
11elif [[  "$1" == "rk3036"  ]]; then
12	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
13
14elif [[  "$1" == "rk3328"  ]]; then
15	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
16
17elif [[  "$1" == "rk3399"  ]]; then
18	taskset -c 4-5 glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
19
20elif [[  "$1" == "rk3399pro"  ]]; then
21	taskset -c 4-5 glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
22
23elif [[  "$1" == "rk3528"  ]]; then
24	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
25
26elif [[  "$1" == "rk3562" ]]; then
27	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
28
29elif [[  "$1" == "rk3566" || "$1" == "rk3568"  ]]; then
30	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
31
32elif [[  "$1" == "rk3588" || "$1" == "rk3588s"  ]]; then
33	taskset -c 4-8 glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
34
35elif [[  "$1" == "px30" || "$1" == "rk3326"  ]]; then
36	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
37
38elif [[  "$1" == "rk1808" || "$1" == "rk3308"  ]]; then
39	echo "the chips didn't support gpu"
40
41elif [[  "$1" == "px3se" || "$1" == "rk312x" ]]; then
42	glmark2-es2-wayland --visual-config='a=0:buf=24' --annotate
43else
44	echo "please check if the linux support it!!!!!!!"
45fi
46}
47
48COMPATIBLE=$(cat /proc/device-tree/compatible)
49if [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
50	CHIPNAME="rk312x"
51elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
52	CHIPNAME="rk312x"
53elif [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
54    CHIPNAME="rk3288"
55elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
56    CHIPNAME="rk3308"
57elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
58    CHIPNAME="rk3326"
59elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
60    CHIPNAME="rk3328"
61elif [[ $(expr $COMPATIBLE : ".*rk3358") -ne 0 ]]; then
62    CHIPNAME="rk3358"
63elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
64    CHIPNAME="rk3399"
65elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
66    CHIPNAME="rk3399"
67elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
68    CHIPNAME="rk3399pro"
69elif [[ $(expr $COMPATIBLE : ".*rk3528") -ne 0 ]]; then
70    CHIPNAME="rk3528"
71elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
72    CHIPNAME="rk3562"
73elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
74    CHIPNAME="rk3566"
75elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
76    CHIPNAME="rk3568"
77elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
78    CHIPNAME="rk3588"
79elif [[ $(expr $COMPATIBLE : ".*rk3036") -ne 0 ]]; then
80    CHIPNAME="rk3036"
81elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
82    CHIPNAME="rk1808"
83elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
84    CHIPNAME="px3se"
85elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
86    CHIPNAME="px30"
87else
88    CHIPNAME="rk3399"
89fi
90COMPATIBLE=${COMPATIBLE#rockchip,}
91
92echo performance | tee $(find /sys/ -name *governor) /dev/null || true
93
94echo "run glmark2 wayland with fullscreen......"
95
96run_glmark2 ${CHIPNAME}
97
98echo "the governor is performance for now, please restart it........"
99