Skip to content

Commit

Permalink
mediatek/gpu: Add DCS Policy switch for gpufreqv2 platform
Browse files Browse the repository at this point in the history
Signed-off-by: Rem01Gaming <Rem01_Gaming@proton.me>
  • Loading branch information
Rem01Gaming committed Dec 13, 2024
1 parent f37d959 commit 3e7a46d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions share/utils/gpu/mtk_ged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,16 @@ mtk_ged_game_mode() {
Disable) apply 0 /sys/module/ged/parameters/gx_game_mode ;;
esac
}

mtk_ged_dcs_mode() {
if [[ $1 == "-exec" ]]; then
local selected=$2
else
local selected=$(fzf_select "Enable Disable" "DCS Policy mode: ")
command2db gpu.ged.dcs_mode "mtk_ged_dcs_mode -exec $selceted" FALSE
fi
case $selected in
Enable) apply 1 /sys/kernel/ged/hal/dcs_mode ;;
Disable) apply 0 /sys/kernel/ged/hal/dcs_mode ;;
esac
}
8 changes: 5 additions & 3 deletions share/utils/gpu/mtk_gpufreqv2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ mtk_gpufreqv2_menu() {
while true; do
unset_headvar
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"
"[] GPU: $gpu"
"[] GPU Scaling 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_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)"
"[] GED DCS Policy: $(cat /sys/kernel/ged/hal/dcs_mode)"
)

header "GPU Control"
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" "")"
selected="$(fzy_select "Set max freq\nSet min freq\nLock freq (NO DVFS)\nReset DVFS\nGED GPU DVFS\nGED Boost\nGED GPU boost\nDCS Policy mode\nBack to main menu" "")"

case "$selected" in
"Set max freq") ged_max_freq ;;
Expand All @@ -52,6 +53,7 @@ mtk_gpufreqv2_menu() {
"GED GPU DVFS") mtk_ged_dvfs ;;
"GED Boost") mtk_ged_boost ;;
"GED GPU boost") mtk_ged_gpu_boost ;;
"GED DCS Policy") mtk_ged_dcs_mode ;;
"Back to main menu") break ;;
esac
done
Expand Down

0 comments on commit 3e7a46d

Please sign in to comment.