mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
Audio (3-iteration DTS fix chain): - Removed duplicate pinctrl from codec node (pin conflict) - Fixed sound-dai to reference &rk817_codec (MFD of_node mismatch) - Removed DAPM routing/widgets (BSP codec has no DAPM widgets) - Added 7 missing battery BSP properties Runtime fixes: - unset_preload.so prevents gl4es LD_PRELOAD inheritance to subprocesses - ES Patch 5: getShOutput() null safety for popen() failure - Volume hotkeys: use 'DAC Playback Volume' (not enum 'Playback') - Brightness: 5% minimum clamp, persistence across reboots - current_volume: reads correct ALSA control - perfmax/perfnorm: guard DMC writes with file existence check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
1.9 KiB
Bash
38 lines
1.9 KiB
Bash
#!/bin/bash
|
|
# Arch R - Performance Governor (Max)
|
|
# Sets CPU, GPU, and DMC to maximum performance
|
|
# Based on dArkOS perfmax for RK3326
|
|
|
|
gpu="ff400000"
|
|
DMC_GOV="/sys/devices/platform/dmc/devfreq/dmc/governor"
|
|
|
|
# Make governor files writable
|
|
chmod 666 /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/governor 2>/dev/null
|
|
chmod 666 /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null
|
|
[ -f "$DMC_GOV" ] && chmod 666 "$DMC_GOV" 2>/dev/null
|
|
|
|
if [[ "$1" == "powersave" ]]; then
|
|
echo "userspace" > /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/governor
|
|
echo "400000000" > /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/userspace/set_freq 2>/dev/null
|
|
echo "userspace" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
|
|
echo "1008000" > /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed 2>/dev/null
|
|
[ -f "$DMC_GOV" ] && echo "userspace" > "$DMC_GOV"
|
|
echo "528000000" > /sys/devices/platform/dmc/devfreq/dmc/userspace/set_freq 2>/dev/null
|
|
elif [[ "$1" == "ondemand" ]]; then
|
|
echo simple_ondemand > /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/governor
|
|
echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
|
|
[ -f "$DMC_GOV" ] && echo dmc_ondemand > "$DMC_GOV"
|
|
if [ "$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)" == "ondemand" ]; then
|
|
echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold 2>/dev/null
|
|
echo 150 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor 2>/dev/null
|
|
fi
|
|
elif [[ -n "$1" ]]; then
|
|
echo "$1" > /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/governor
|
|
echo "$1" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
|
|
[ -f "$DMC_GOV" ] && echo "$1" > "$DMC_GOV"
|
|
else
|
|
echo "performance" > /sys/devices/platform/${gpu}.gpu/devfreq/${gpu}.gpu/governor
|
|
echo "performance" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
|
|
[ -f "$DMC_GOV" ] && echo "performance" > "$DMC_GOV"
|
|
fi
|