Merge pull request #594 from fewtarius/dev
Apply AMD GPU performance profiles, thanks to @0_game_it on twitter.
This commit is contained in:
commit
5d5d001214
4 changed files with 27 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
np2kai # Last major commit before hiatus is broken
|
||||
vicesa # Doesn't support updating with the script.
|
||||
duckstationsa # Latest commits break device patching. Need to research.
|
||||
ewolf
|
||||
ecwolf
|
||||
|
|
|
@ -8,7 +8,7 @@ PKG_VERSION="b821ece0527188d51475fdbaa9d8e0d21ccb3d5a"
|
|||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/flyinghead/flycast"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa SDL2 libzip zip"
|
||||
PKG_DEPENDS_TARGET="toolchain alsa SDL2 libzip zip curl"
|
||||
PKG_LONGDESC="Flycast is a multiplatform Sega Dreamcast, Naomi and Atomiswave emulator"
|
||||
PKG_TOOLCHAIN="cmake"
|
||||
PKG_PATCH_DIRS+="${DEVICE}"
|
||||
|
|
|
@ -8,38 +8,58 @@
|
|||
set_cpu_gov() {
|
||||
for POLICY in ${CPU_FREQ[@]}
|
||||
do
|
||||
echo $1 >${POLICY}/scaling_governor 2>/dev/null
|
||||
if [ -e "${POLICY}/scaling_governor" ]
|
||||
then
|
||||
echo $1 >${POLICY}/scaling_governor 2>/dev/null
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
set_dmc_gov() {
|
||||
echo $1 >${DMC_FREQ}/governor 2>/dev/null || echo dmc_$1 >${DMC_FREQ}/governor 2>/dev/null
|
||||
if [ -e "${DMC_FREQ}/governor" ]
|
||||
then
|
||||
echo $1 >${DMC_FREQ}/governor 2>/dev/null || echo dmc_$1 >${DMC_FREQ}/governor 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
set_gpu_gov() {
|
||||
echo $1 >${GPU_FREQ}/governor 2>/dev/null || echo dmc_$1 >${GPU_FREQ}/governor 2>/dev/null
|
||||
if [ -e "${GPU_FREQ}/governor" ]
|
||||
then
|
||||
echo $1 >${GPU_FREQ}/governor 2>/dev/null || echo dmc_$1 >${GPU_FREQ}/governor 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
set_amdgpu_perf() {
|
||||
if [ -e "${AMDGPU_PERF}" ]
|
||||
then
|
||||
echo $1 >${AMDGPU_PERF} 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
performance() {
|
||||
set_cpu_gov performance
|
||||
set_amdgpu_perf profile_peak
|
||||
set_gpu_gov performance
|
||||
set_dmc_gov performance
|
||||
}
|
||||
|
||||
ondemand() {
|
||||
set_cpu_gov ondemand
|
||||
set_amdgpu_perf auto
|
||||
set_gpu_gov ondemand
|
||||
set_dmc_gov ondemand
|
||||
}
|
||||
|
||||
interactive() {
|
||||
set_cpu_gov interactive
|
||||
set_amdgpu_perf auto
|
||||
set_gpu_gov ondemand
|
||||
set_dmc_gov ondemand
|
||||
}
|
||||
|
||||
powersave() {
|
||||
set_cpu_gov powersave
|
||||
set_amdgpu_perf low
|
||||
set_gpu_gov powersave
|
||||
set_dmc_gov powersave
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ CPU_FREQ=("/sys/devices/system/cpu/cpufreq/policy0" \
|
|||
"/sys/devices/system/cpu/cpufreq/policy2" \
|
||||
"/sys/devices/system/cpu/cpufreq/policy3")
|
||||
|
||||
AMDGPU_PERF="/sys/class/drm/card0/device/power_dpm_force_performance_level"
|
||||
|
||||
# Affinity
|
||||
SLOW_CORES="taskset -c 0-3"
|
||||
FAST_CORES="${SLOW_CORES}"
|
||||
|
|
Loading…
Reference in a new issue