1#!/bin/bash -e 2 3PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 4function run_glmark2() { 5if [ "$1" == "rk3288" ]; then 6 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 7 8elif [[ "$1" == "rk3036" ]]; then 9 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 10 11elif [[ "$1" == "rk3328" ]]; then 12 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 13 14elif [[ "$1" == "rk3399" ]]; then 15 taskset -c 4-5 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 16 17elif [[ "$1" == "rk3399pro" ]]; then 18 taskset -c 4-5 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 19 20elif [[ "$1" == "rk3358" ]]; then 21 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 22 23elif [[ "$1" == "rk3528" ]]; then 24 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 25 26elif [[ "$1" == "rk3562" ]]; then 27 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 28 29elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then 30 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 31 32elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then 33 taskset -c 4-8 glmark2-es2-wayland --fullscreen --visual-config='a=0:buf=24' --annotate 34 35elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then 36 glmark2-es2-wayland --fullscreen --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 --fullscreen --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 : ".*rk3288") -ne 0 ]]; then 50 CHIPNAME="rk3288" 51elif [[ $(expr $COMPATIBLE : ".*rk3036") -ne 0 ]]; then 52 CHIPNAME="rk3036" 53elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then 54 CHIPNAME="rk3308" 55elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then 56 CHIPNAME="rk3328" 57elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then 58 CHIPNAME="rk3399" 59elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then 60 CHIPNAME="rk3326" 61elif [[ $(expr $COMPATIBLE : ".*rk3358") -ne 0 ]]; then 62 CHIPNAME="rk3358" 63elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then 64 CHIPNAME="rk3399" 65elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then 66 CHIPNAME="rk3399pro" 67elif [[ $(expr $COMPATIBLE : ".*rk3528") -ne 0 ]]; then 68 CHIPNAME="rk3528" 69elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then 70 CHIPNAME="rk3562" 71elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then 72 CHIPNAME="rk3566" 73elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then 74 CHIPNAME="rk3568" 75elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then 76 CHIPNAME="rk3588" 77elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then 78 CHIPNAME="rk1808" 79elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then 80 CHIPNAME="px3se" 81elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then 82 CHIPNAME="px30" 83elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then 84 CHIPNAME="rk312x" 85elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then 86 CHIPNAME="rk312x" 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