文章目录
Thermal框架概览
相关文章:
Modem2G/3G/4G/5G:功耗管理:高通Thermal架构与配置方法(一):Thermal Zone与Cooling Device
Thermal 引擎
Thermal引擎的代码位置:
vendor/qcom/proprietary/thermal-engine/
配置方法:
在thermal-engine.conf中配置thermal rules。该文件默认是空的,可以添加自定义rules,例如添加一个CPU0 的rules:
[CPU0_MONITOR]
algo_type monitor
sensor cpu0
sampling 1000
thresholds 90000 100000 110000 115000 120000
thresholds_clr 85000 95000 105000 110000 115000
actions battery battery battery battery shutdown
action_info 0 1 2 3 5000
除了修改源码,thermal-engine.conf还可以通过adb命令pull\push来替换。
例如:
Adb push < thermal-engine.conf路径> /system/etc/thermal-engine.conf
注意:替换后需要reboot.
算法类型:
动态管理(SS)
用于芯片温度和表面温度控制;
定义一个特定温度,由算法动态的限制特定的行为,例如CPU频率;
仅适用CPU和GPU的降耗,例如压低CPU的最大频率;
适用set_point和set_point_clr关键字来设置阈值。
例如下面是动态管理算法的CPU设置:
[SS-CPU0]
algo_type ss
sampling 50
sensor cpu0
device cluster1
set_point 85000
set_point_clr 65000
time_constant 0
monitor算法(重要,适用于modem)
定义了一组温度阈值,以及每个阈值对应的细微动作;
适用于LCD,modem,battery,camcoder;
不适用CPU和GPU(节点太多,不便于调教);
使用thresholds和threshold_clr关键字来设置阈值。
例如:
algo_type monitor
sensor tsens_tz_sensor3
sampling 1000
thresholds 50 65
thresholds_clr 45 60
actions gpu+lcd gpu+lcd
action_info 500000+255 333000+150
算法类型定义:
在inc/thermal_config.h中,定义了算法类型
enum algo_type {
UNKNOWN_ALGO_TYPE = -1,
MONITOR_ALGO_TYPE = 0,
PID_ALGO_TYPE,
SS_ALGO_TYPE,
TB_ALGO_TYPE,
EQUILIBRIUM_TYPE,
VIRTUAL_SENSOR_TYPE,
BWLM_ALGO_TYPE,
ALGO_IDX_MAX,
};
配置文件字段
基本字段
动态配置(DTM)字段
Monitor字段
推荐:
Modem2G/3G/4G/5G:功耗管理:高通Thermal架构与配置方法(一):Thermal Zone与Cooling Device