hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
#!/bin/bash -e
 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function run_glmark2() {
if [ "$1" == "rk3288" ]; then
   glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk3328"  ]]; then
   glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk3399"  ]]; then
   taskset -c 4-5 glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk3399pro"  ]]; then
   taskset -c 4-5 glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "px30" || "$1" == "rk3326"  ]]; then
   glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk3566" || "$1" == "rk3568"  ]]; then
   glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk3588" || "$1" == "rk3588s"  ]]; then
   taskset -c 4-8 glmark2-es2-wayland --off-screen
 
elif [[  "$1" == "rk1808" || "$1" == "rk3308"  ]]; then
   echo "the chips didn't support gpu"
 
elif [[  "$1" == "px3se" || "$1" == "rk312x" ]]; then
   glmark2-es2-wayland --off-screen
else
   echo "please check if the linux support it!!!!!!!"
fi
}
 
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
    CHIPNAME="rk3288"
elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
    CHIPNAME="rk3308"
elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
    CHIPNAME="rk3328"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
    CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
    CHIPNAME="rk3326"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
    CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
    CHIPNAME="rk3566"
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
    CHIPNAME="rk3568"
elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
    CHIPNAME="rk3588"
elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
    CHIPNAME="rk3399pro"
elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
    CHIPNAME="rk1808"
elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
    CHIPNAME="px3se"
elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
    CHIPNAME="px30"
elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
   CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
   CHIPNAME="rk312x"
else
    CHIPNAME="rk3399"
fi
COMPATIBLE=${COMPATIBLE#rockchip,}
 
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
 
echo "run glmark2 wayland with offscreen......"
 
run_glmark2 ${CHIPNAME}
 
echo "the governor is performance for now, please restart it........"