2023-11-27 13:17:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
|
|
|
|
|
|
|
# Minimal OS variable loading for performance
|
|
|
|
. /etc/profile.d/001-functions
|
2023-12-04 01:26:09 +00:00
|
|
|
. /etc/profile.d/030-powerfunctions
|
2023-11-27 13:17:55 +00:00
|
|
|
. /etc/profile.d/099-freqfunctions
|
|
|
|
|
|
|
|
tocon "Setting performance mode..."
|
|
|
|
|
|
|
|
### Enable the desired number of threads.
|
|
|
|
tocon "Restoring cpu threads..."
|
|
|
|
NUMTHREADS=$(get_setting "system.threads")
|
|
|
|
if [ -n "${NUMTHREADS}" ]
|
|
|
|
then
|
|
|
|
onlinethreads ${NUMTHREADS} 0
|
|
|
|
else
|
|
|
|
onlinethreads all 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
### If we don't have a default governor set, set it
|
2024-01-15 03:14:48 +00:00
|
|
|
### to schedutil if the device supports it, otherwise
|
|
|
|
### set to performance, but don't enable it.
|
2023-11-27 13:17:55 +00:00
|
|
|
if [ -z "$(get_setting system.cpugovernor)" ]
|
|
|
|
then
|
2024-01-15 03:14:48 +00:00
|
|
|
GOVTEST="$(awk '/schedutil/ {print $1}' /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors)"
|
|
|
|
if [ -n "${GOVTEST}" ]
|
|
|
|
then
|
|
|
|
set_setting system.cpugovernor schedutil
|
|
|
|
else
|
|
|
|
set_setting system.cpugovernor performance
|
|
|
|
fi
|
2023-11-27 13:17:55 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
### Set the default GPU performance mode
|
|
|
|
GPUPERF=$(get_setting system.gpuperf)
|
|
|
|
if [ -n "${GPUPERF}" ]
|
|
|
|
then
|
|
|
|
gpu_performance_level ${GPUPERF}
|
|
|
|
fi
|