From 4ec9b3c959f89919ff5de2eec2f0897636baff61 Mon Sep 17 00:00:00 2001 From: Rem01Gaming Date: Sun, 22 Sep 2024 18:54:13 +0700 Subject: [PATCH] mediatek/gpu: Drop lock volt in gpufreqv2 * fix_custom_freq_volt is and always unstable Signed-off-by: Rem01Gaming --- share/utils/gpu/mtk_gpufreqv2.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/share/utils/gpu/mtk_gpufreqv2.sh b/share/utils/gpu/mtk_gpufreqv2.sh index 52a4d90..11d629b 100644 --- a/share/utils/gpu/mtk_gpufreqv2.sh +++ b/share/utils/gpu/mtk_gpufreqv2.sh @@ -20,21 +20,12 @@ source /data/data/com.termux/files/usr/share/origami-kernel/utils/gpu/mtk_ged.sh mtk_gpufreqv2_lock_freq() { local freq=$(fzf_select "$gpu_available_freqs" "Set frequency for GPU (NO DVFS): ") - local voltage=$(awk -v freq="$freq" '$0 ~ freq {gsub(/.*, volt: /, ""); gsub(/,.*/, ""); print}' /proc/gpufreqv2/gpu_working_opp_table) - apply "$freq $voltage" /proc/gpufreqv2/fix_custom_freq_volt -} - -mtk_gpufreqv2_lock_volt() { - if [[ $(cat /proc/gpufreqv2/fix_custom_freq_volt) == *disabled* ]]; then - echo -e "\n\033[38;5;196merror:\033[0m Set fixed freq first !" - read -r -s - return 1 - fi - apply "$(awk '{print $4}' /proc/gpufreqv2/fix_custom_freq_volt) $(fzf_select "$(awk '{print $5}' /proc/gpufreqv2/gpu_working_opp_table | sed 's/,//g' | sort -nu)" "Select GPU voltage: ")" /proc/gpufreq/gpufreq_fixed_freq_volt + local index=$(grep $freq /proc/gpufreqv2/gpu_working_opp_table | awk -F'[][]' '{print $2}') + apply "$index" /proc/gpufreqv2/fix_target_opp_index } mtk_gpufreqv2_reset_dvfs() { - apply "0 0" /proc/gpufreqv2/fix_custom_freq_volt + apply "-1" /proc/gpufreqv2/fix_target_opp_index } mtk_gpufreqv2_menu() { @@ -45,19 +36,18 @@ mtk_gpufreqv2_menu() { header_info=( "[] GPU: ${gpu}" "[] GPU Scalling freq: $(cat /sys/module/ged/parameters/gpu_cust_boost_freq)KHz - $(cat /sys/module/ged/parameters/gpu_cust_upbound_freq)KHz" - "[] Fixed freq & volt: $(if [[ $(awk '{print $2}' /proc/gpufreqv2/fix_custom_freq_volt) == "fix" ]]; then echo "Enabled"; else echo "Disabled"; fi)" + "[] Fixed freq & volt: $(if [[ $(awk '{print $2}' /proc/gpufreqv2/fix_target_opp_index) == "fix" ]]; then echo "Enabled"; else echo "Disabled"; fi)" "[] GPU DVFS: $(cat /sys/module/ged/parameters/gpu_dvfs_enable)" "[ϟ] GED Boosting: $(cat /sys/module/ged/parameters/ged_boost_enable)" ) header "GPU Control" - selected="$(fzy_select "Set max freq\nSet min freq\nLock freq (NO DVFS)\nLock voltage (NO DVFS)\nReset DVFS\nGED GPU DVFS\nGED Boost\nGED GPU boost\nBack to main menu" "")" + selected="$(fzy_select "Set max freq\nSet min freq\nLock freq (NO DVFS)\nReset DVFS\nGED GPU DVFS\nGED Boost\nGED GPU boost\nBack to main menu" "")" case "$selected" in "Set max freq") ged_max_freq ;; "Set min freq") ged_min_freq ;; "Lock freq (NO DVFS)") mtk_gpufreqv2_lock_freq ;; - "Lock voltage (NO DVFS)") mtk_gpufreqv2_lock_volt ;; "Reset DVFS") mtk_gpufreqv2_reset_dvfs ;; "GED GPU DVFS") mtk_ged_dvfs ;; "GED Boost") mtk_ged_boost ;;