# lock the gpu devfreq freq scaling to a single fixed freq as it does not seem to work stable
# resulting in gpu errors like "gpu sched timeout", "AS_ACTIVE bit stuck" or page faults
if [ -f /sys/class/devfreq/1800000.gpu/max_freq ]; then
  # for possible values see /sys/class/devfreq/1800000.gpu/available_frequencies
  echo 250000000 > /sys/class/devfreq/1800000.gpu/max_freq
  echo 250000000 > /sys/class/devfreq/1800000.gpu/min_freq
fi

# here it is possible to set a higher max cpu frequency before enabling
# the boost frequencies to step by step try out until which frequency
# the system still remains stable - possible values are:
# 1200000 1320000 1416000 1512000 1608000 1704000 1800000
# see: cat /sys/devices/system/cpu/cpufreq/policy0/scaling_boost_frequencies
if [ -f /sys/devices/system/cpu/cpufreq/boost ]; then
  echo 1 > /sys/devices/system/cpu/cpufreq/boost
  echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
fi
