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 --run-forever --fullscreen --annotate 7 8elif [[ "$1" == "rk3328" ]]; then 9 glmark2-es2-wayland --run-forever --fullscreen --annotate 10 11elif [[ "$1" == "rk3399" ]]; then 12 glmark2-es2-wayland --run-forever --fullscreen --annotate 13 14elif [[ "$1" == "rk3399pro" ]]; then 15 glmark2-es2-wayland --run-forever --fullscreen --annotate 16 17elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then 18 glmark2-es2-wayland --run-forever --fullscreen --annotate 19 20elif [[ "$1" == "rk3562" ]]; then 21 glmark2-es2-wayland --run-forever --fullscreen --annotate 22 23elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then 24 glmark2-es2-wayland --run-forever --fullscreen --annotate 25 26elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then 27 glmark2-es2-wayland --run-forever --fullscreen --annotate 28 29elif [[ "$1" == "rk1808" || "$1" == "rk3308" ]]; then 30 echo "the chips didn't support gpu" 31 32elif [[ "$1" == "px3se" || "$1" == "rk312x" ]]; then 33 glmark2-es2-wayland --run-forever --fullscreen --annotate 34else 35 echo "please check if the linux support it!!!!!!!" 36fi 37} 38 39COMPATIBLE=$(cat /proc/device-tree/compatible) 40if [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then 41 CHIPNAME="rk3288" 42elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then 43 CHIPNAME="rk3308" 44elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then 45 CHIPNAME="rk3328" 46elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then 47 CHIPNAME="rk3399" 48elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then 49 CHIPNAME="rk3326" 50elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then 51 CHIPNAME="rk3399" 52elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then 53 CHIPNAME="rk3399pro" 54elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then 55 CHIPNAME="rk3562" 56elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then 57 CHIPNAME="rk3566" 58elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then 59 CHIPNAME="rk3568" 60elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then 61 CHIPNAME="rk3588" 62elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then 63 CHIPNAME="rk1808" 64elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then 65 CHIPNAME="px3se" 66elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then 67 CHIPNAME="px30" 68elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then 69 CHIPNAME="rk312x" 70elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then 71 CHIPNAME="rk312x" 72else 73 CHIPNAME="rk3399" 74fi 75COMPATIBLE=${COMPATIBLE#rockchip,} 76 77echo performance | tee $(find /sys/ -name *governor) /dev/null || true 78 79echo "run glmark2 wayland with fullscreen......" 80 81run_glmark2 ${CHIPNAME} 82 83echo "the governor is performance for now, please restart it........" 84