From c67a4b790b612423f761ec9f60f6a8cef40e0ad5 Mon Sep 17 00:00:00 2001
From: ZyCromerZ <neetroid97@gmail.com>
Date: Sun, 18 Sep 2022 12:17:26 +0700
Subject: [PATCH] update - auto update value inside
 /sys/module/zyc_gpu/parameters folder - always set input_boost_ms to 0 when
 module is off

Signed-off-by: ZyCromerZ <neetroid97@gmail.com>
---
 system/etc/ZyC-Core/misc/funclist.sh | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/system/etc/ZyC-Core/misc/funclist.sh b/system/etc/ZyC-Core/misc/funclist.sh
index 9a8cba6..8456eca 100644
--- a/system/etc/ZyC-Core/misc/funclist.sh
+++ b/system/etc/ZyC-Core/misc/funclist.sh
@@ -232,6 +232,12 @@ SetOn(){
 
     [[ -f /proc/sys/kernel/sched_boost ]] && WriteOnly "1" /proc/sys/kernel/sched_boost
 
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_old_check_gpuaddr ]] && WriteOnly "Y" /sys/module/zyc_gpu/parameters/kgsl_old_check_gpuaddr
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_old_close ]] && WriteOnly "Y" /sys/module/zyc_gpu/parameters/kgsl_old_close
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_thermal_limit ]] && WriteOnly "N" /sys/module/zyc_gpu/parameters/kgsl_thermal_limit
+
+    [[ -f /sys/module/cpu_boost/parameters/input_boost_ms ]] && WriteOnly "120" /sys/module/cpu_boost/parameters/input_boost_ms
+
     [[ "$NoLogs" == "n" ]] && SendLogs "Module Tweak: Enabled"
     [[ "$NoLogs" == "n" ]] && SendLogs "When Use App: $AppName"
     WriteOnly "2" $PMConfig/status.conf
@@ -291,6 +297,13 @@ SetOff(){
 
     [[ "$NoLogs" == "n" ]] && SendLogs "Module Tweak: Disabled"
     WriteOnly "1" $PMConfig/status.conf
+
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_old_check_gpuaddr ]] && WriteOnly "N" /sys/module/zyc_gpu/parameters/kgsl_old_check_gpuaddr
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_old_close ]] && WriteOnly "N" /sys/module/zyc_gpu/parameters/kgsl_old_close
+    [[ -f /sys/module/zyc_gpu/parameters/kgsl_thermal_limit ]] && WriteOnly "Y" /sys/module/zyc_gpu/parameters/kgsl_thermal_limit
+
+    [[ -f /sys/module/cpu_boost/parameters/input_boost_ms ]] && WriteOnly "0" /sys/module/cpu_boost/parameters/input_boost_ms
+
     GetErrorMsg "SetOff"
 } 2>>$RLOGsE
 
@@ -1148,21 +1161,6 @@ SetFreqCpu(){
         [[ "$TotalClusters" -ge "2" ]] && WriteOnly "1 $ForBg" "/proc/ppm/policy/hard_userlimit_${mode}_cpu_freq" && SendLogs "Set $mode Big Cluster To $2"
         [[ "$TotalClusters" -ge "3" ]] && WriteOnly "2 $ForPm" "/proc/ppm/policy/hard_userlimit_${mode}_cpu_freq" && SendLogs "Set $mode Prime Cluster To $3"
     fi
-    # ls  /sys/module/cpu_boost/parameters/
-    # input_boost_freq  input_boost_ms  sched_boost_on_input
-    if [[ -d /sys/module/cpu_boost/parameters ]];then
-        if [[ "$RunModules" == "2" ]];then
-            if [[ "$mode" == "max" ]];then
-                WriteOnly "$prepCmd" /sys/module/cpu_boost/parameters/input_boost_freq
-                WriteOnly "120" /sys/module/cpu_boost/parameters/input_boost_ms
-            fi
-        else
-            if [[ "$mode" == "min" ]];then
-                WriteOnly "$prepCmd" /sys/module/cpu_boost/parameters/input_boost_freq
-                WriteOnly "0" /sys/module/cpu_boost/parameters/input_boost_ms
-            fi
-        fi
-    fi
     GetErrorMsg "SetFreqCpu"
 } 2>>$RLOGsE
 
-- 
GitLab