[高通平台小米4]的电源管理配置学习

2019-07-13 22:39发布

1.温控调频

/system/etc/thermal-engine-8974.conf sampling 5000 [CPU0_MONITOR] algo_type monitor sensor cpu0 sampling 1000 thresholds 55000 60000 65000 70000 85000 105000 115000 thresholds_clr 50000 55000 60000 66000 80000 90000 110000 actions cpu cpu cpu cpu cpu cpu shutdown action_info 1728000 1497600 1190400 1036800 960000 6528000 0 [CPU1_MONITOR] algo_type monitor sensor cpu1 sampling 65 thresholds 115000 thresholds_clr 110000 actions shutdown action_info 0 [CPU2_MONITOR] …… [CPU3_MONITOR] …… -(温度阈值) thresholds 55000 60000 65000 70000 85000 105000 115000
-(条件解除阈值)thresholds_clr 50000 55000 60000 66000 80000 90000 110000
- (CPU频率)action_info 1728000 1497600 1190400 1036800 960000 6528000 0 例如 55 ℃ 则调节CPU频率为1728000Hz,50 ℃ 时解除CPU频率设置

2.CPU 高性能模式

/system/bin/changepowermode.sh #!/system/bin/sh target=`getprop ro.product.model` powermode=`getprop persist.sys.aries.power_profile` dev_governor=`ls /sys/class/devfreq/qcom,cpubw*/governor` case "$target" in …… "LEO "* | "MI 4"* | "MI NOTE"* | "VIRGO"*) case "$powermode" in "high") stop mpdecision sleep 1 echo 1 > /sys/devices/system/cpu/cpu1/online echo 1 > /sys/devices/system/cpu/cpu2/online echo 1 > /sys/devices/system/cpu/cpu3/online echo 1 > /sys/devices/system/cpu/cpu1/online echo 1 > /sys/devices/system/cpu/cpu2/online echo 1 > /sys/devices/system/cpu/cpu3/online echo 2457600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo 20 > /sys/module/cpu_boost/parameters/boost_ms echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms echo 255 > /sys/class/leds/lcd-backlight/max_brightness echo 578000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor echo "msm_cpufreq" > $dev_governor ;; "middle") echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo interactive > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo interactive > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo interactive > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo 2457600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq echo 2457600 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo "85 1500000:99" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 20 > /sys/module/cpu_boost/parameters/boost_ms echo 1497600 > /sys/module/cpu_boost/parameters/sync_threshold echo 1190400 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms echo 255 > /sys/class/leds/lcd-backlight/max_brightness echo 578000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk echo msm-adreno-tz > /sys/class/kgsl/kgsl-3d0/devfreq/governor echo "cpubw_hwmon" > $dev_governor start mpdecision ;; esac ;; esac 上述主要通过开核,升频率,设置performance模式,和场景调频完成高性能的切换

3.小结

原文地址
https://www.zhihu.com/question/31281881?sort=created 感觉这样的高通平台设置简直是low,这里贴出MTK的CPU场景调频进行对比 CMD_SET_SCN_VALID, SCN_SW_FRAME_UPDATE, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_SWITCH, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_SWITCH, 0, 3000000 CMD_SET_TA_BOOST_VALUE, SCN_APP_SWITCH, 1100 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_PACKAGE_SWITCH, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_PACKAGE_SWITCH, 0, 3000000 CMD_SET_VCORE_MIN, SCN_PACKAGE_SWITCH, 0 CMD_SET_TA_BOOST_VALUE, SCN_PACKAGE_SWITCH, 1100 CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_PACKAGE_SWITCH, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_PROCESS_CREATE, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_PROCESS_CREATE, 0, 3000000 CMD_SET_VCORE_MIN, SCN_PROCESS_CREATE, 0 CMD_SET_TA_BOOST_VALUE, SCN_PROCESS_CREATE, 1100 CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_PROCESS_CREATE, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_LAUNCH, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_LAUNCH, 0, 3000000 CMD_SET_VCORE_MIN, SCN_APP_LAUNCH, 0 CMD_SET_TA_BOOST_VALUE, SCN_APP_LAUNCH, 1100 CMD_SET_FPSGO_ENABLE, SCN_APP_LAUNCH, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_INSTALL, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_INSTALL, 0, 3000000 CMD_SET_VCORE_MIN, SCN_APP_INSTALL, 0 CMD_SET_TA_BOOST_VALUE, SCN_APP_INSTALL, 1100 CMD_SET_FPSGO_ENABLE, SCN_APP_INSTALL, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_ROTATE, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_ROTATE, 0, 3000000 CMD_SET_VCORE_MIN, SCN_APP_ROTATE, 0 CMD_SET_TA_BOOST_VALUE, SCN_APP_ROTATE, 1100 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_GAME_LAUNCH, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_GAME_LAUNCH, 0, 3000000 CMD_SET_VCORE_MIN, SCN_GAME_LAUNCH, 0 CMD_SET_TA_BOOST_VALUE, SCN_GAME_LAUNCH, 1100 CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_GAME_LAUNCH, 0 CMD_SET_FPSGO_ENABLE, SCN_GAME_LAUNCH, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_GALLERY_BOOST, 0, 4 CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_GALLERY_BOOST, 0, 3000000 CMD_SET_TA_BOOST_VALUE, SCN_GALLERY_BOOST, 1100 CMD_SET_GX_BOOST, SCN_GLSURFACE, 1 CMD_SET_SCN_VALID, SCN_GLSURFACE, 1 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_SP_MODE, 0, 0 CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_VR_MODE, 0, 0 MTK提供各个使用场景的动态调频,比如切换应用场景,游戏场景,自旋转切换等开核,频率数,模式,温控调节