From ac43ed54bc735983d2bf8817f0c523df076574ef Mon Sep 17 00:00:00 2001 From: "Peter (YM)" Date: Wed, 26 Jun 2024 05:12:01 +0000 Subject: [PATCH] thermal: enable uclamp_max based thermal throttle Bug: 349035550 Test: - No stablilty issue under emul_temp from 25 ~ 52: b/349035550#comment3 - Perf CUJ test: b/335539352#comment48 - Thermal CUJ test: b/353432888#comment9 - Thermal Benchmark test: b/338314678#comment11 Flag: EXEMPT config update Signed-off-by: Peter (YM) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3a0764f50257fb34ee144dc89979009cf51bab9c) Merged-In: Idb3b17095a639a18fe86c2585e230aa81bff07c8 Change-Id: Idb3b17095a639a18fe86c2585e230aa81bff07c8 --- perf/powerhint-tegu.json | 30 +++++ thermal/thermal_info_config_tegu.json | 158 +++++++++++++++++++++++--- 2 files changed, 170 insertions(+), 18 deletions(-) diff --git a/perf/powerhint-tegu.json b/perf/powerhint-tegu.json index bd070c4..a5f1ea4 100644 --- a/perf/powerhint-tegu.json +++ b/perf/powerhint-tegu.json @@ -922,6 +922,18 @@ "ResetOnInit": true, "Type": "Property" }, + { + "Name": "VIRTUAL-SKIN-CPU-ODPM", + "Path": "vendor.thermal.VIRTUAL-SKIN-CPU-ODPM.profile", + "Values": [ + "", + "game", + "camera" + ], + "DefaultIndex": 0, + "ResetOnInit": true, + "Type": "Property" + }, { "Name": "VIRTUAL-SKIN-CPU-HIGH", "Path": "vendor.thermal.VIRTUAL-SKIN-CPU-HIGH.profile", @@ -2134,6 +2146,12 @@ "Duration": 0, "Value": "0x0" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "VIRTUAL-SKIN-CPU-ODPM", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "TNRMaxFreq", @@ -2320,6 +2338,12 @@ "Duration": 0, "Value": "0-6" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "VIRTUAL-SKIN-CPU-ODPM", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "VIRTUAL-SKIN-CPU-MID", @@ -3155,6 +3179,12 @@ "Duration": 0, "Value": "game" }, + { + "PowerHint": "GAME", + "Node": "VIRTUAL-SKIN-CPU-ODPM", + "Duration": 0, + "Value": "game" + }, { "PowerHint": "GAME", "Node": "VIRTUAL-SKIN-CPU-HIGH", diff --git a/thermal/thermal_info_config_tegu.json b/thermal/thermal_info_config_tegu.json index 8978a64..437810b 100644 --- a/thermal/thermal_info_config_tegu.json +++ b/thermal/thermal_info_config_tegu.json @@ -421,21 +421,21 @@ }, "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "CdevWeightForPID": [0.292, 0.292, 0.292, 0.292, 0.292, 0.292, 0.292], "MaxReleaseStep": 1, "MaxThrottleStep": 1, "CdevCeilingFrequency": [1950000, 1098000, 1098000, 1098000, 1098000, 1098000, 1098000] }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "CdevWeightForPID": [0.804, 0.804, 0.804, 0.804, 0.804, 0.804, 0.804], "MaxReleaseStep": 1, "MaxThrottleStep": 2, "CdevCeilingFrequency": [2600000, 1221000, 1221000, 1221000, 1221000, 1221000, 1221000] }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "CdevWeightForPID": [0.342, 0.342, 0.342, 0.342, 0.342, 0.342, 0.342], "MaxReleaseStep": 1, "MaxThrottleStep": 2, @@ -447,17 +447,17 @@ "Mode": "game", "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "MaxReleaseStep": 1, "Disabled":true } @@ -467,17 +467,17 @@ "Mode": "camera", "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "MaxReleaseStep": 1, "Disabled":true } @@ -485,6 +485,107 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-CPU-ODPM", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula":"MAXIMUM", + "Combination":["VIRTUAL-SKIN"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 41.0, "NAN", "NAN", "NAN", "NAN"], + "HotHysteresis":[0.0, 0.0, 1.9, 0.0, 0.0, 0.0, 0.0], + "Multiplier":0.001, + "PollingDelay":300000, + "PassiveDelay":7000, + "PIDInfo": { + "K_Po":["NAN", "NAN", 1000, "NAN", "NAN", "NAN", "NAN"], + "K_Pu":["NAN", "NAN", 1000, "NAN", "NAN", "NAN", "NAN"], + "K_I":["NAN", "NAN", 5, "NAN", "NAN", "NAN", "NAN"], + "K_D":["NAN", "NAN", 0, "NAN", "NAN", "NAN", "NAN"], + "I_Max":["NAN", "NAN", 2000, "NAN", "NAN", "NAN", "NAN"], + "S_Power":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "MinAllocPower":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "MaxAllocPower":["NAN", "NAN", 3800, "NAN", "NAN", "NAN", "NAN"], + "I_Cutoff":["NAN", "NAN", 2, "NAN", "NAN", "NAN", "NAN"], + "I_Default": 500 + }, + "BindedCdevInfo": [ + { + "CdevRequest": "thermal-cpufreq-0", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 1, + "BindedPowerRail": "S4M_VDD_CPUCL0", + "CdevCeilingFrequency": [1950000, 955000, 955000, 955000, 955000, 820000, 820000] + }, + { + "CdevRequest": "thermal-cpufreq-1", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 2, + "BindedPowerRail": "S2M_VDD_CPUCL1", + "CdevCeilingFrequency": [2600000, 648000, 648000, 648000, 648000, 357000, 357000] + }, + { + "CdevRequest": "thermal-cpufreq-2", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 2, + "BindedPowerRail": "S3M_VDD_CPUCL2", + "CdevCeilingFrequency": [3105000, 700000, 700000, 700000, 700000, 700000, 700000] + } + ], + "Profile": [ + { + "Mode": "game", + "BindedCdevInfo": [ + { + "CdevRequest": "thermal-cpufreq-0", + "BindedPowerRail": "S4M_VDD_CPUCL0", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-1", + "BindedPowerRail": "S2M_VDD_CPUCL1", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-2", + "BindedPowerRail": "S3M_VDD_CPUCL2", + "MaxReleaseStep": 1, + "Disabled":true + } + ] + }, + { + "Mode": "camera", + "BindedCdevInfo": [ + { + "CdevRequest": "thermal-cpufreq-0", + "BindedPowerRail": "S4M_VDD_CPUCL0", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-1", + "BindedPowerRail": "S2M_VDD_CPUCL1", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-2", + "BindedPowerRail": "S3M_VDD_CPUCL2", + "MaxReleaseStep": 1, + "Disabled":true + } + ] + } + ] + }, { "Name":"VIRTUAL-SKIN-CPU-HIGH", "Type":"UNKNOWN", @@ -512,21 +613,21 @@ }, "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "CdevWeightForPID": [0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156], "MaxReleaseStep": 1, "MaxThrottleStep": 1, "CdevCeilingFrequency": [1950000, 820000, 820000, 820000, 820000, 820000, 820000] }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "CdevWeightForPID": [0.428, 0.428, 0.428, 0.428, 0.428, 0.428, 0.428], "MaxReleaseStep": 1, "MaxThrottleStep": 2, "CdevCeilingFrequency": [2600000, 787000, 787000, 787000, 787000, 787000, 787000] }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, "MaxThrottleStep": 2, @@ -538,17 +639,17 @@ "Mode": "game", "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "MaxReleaseStep": 1, "Disabled":true }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "MaxReleaseStep": 1, "Disabled":true } @@ -558,21 +659,21 @@ "Mode": "camera", "BindedCdevInfo": [ { - "CdevRequest": "thermal-cpufreq-0", + "CdevRequest": "thermal-uclamp-0", "CdevWeightForPID": [0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156], "MaxReleaseStep": 1, "MaxThrottleStep": 1, "CdevCeilingFrequency": [1950000, 1696000, 1696000, 1696000, 1696000, 1696000, 1696000] }, { - "CdevRequest": "thermal-cpufreq-1", + "CdevRequest": "thermal-uclamp-4", "CdevWeightForPID": [0.428, 0.428, 0.428, 0.428, 0.428, 0.428, 0.428], "MaxReleaseStep": 1, "MaxThrottleStep": 2, "CdevCeilingFrequency": [2600000, 1795000, 1795000, 1795000, 1795000, 1795000, 1795000] }, { - "CdevRequest": "thermal-cpufreq-2", + "CdevRequest": "thermal-uclamp-7", "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, "MaxThrottleStep": 2, @@ -1053,6 +1154,27 @@ } ], "CoolingDevices":[ + { + "Name":"thermal-uclamp-0", + "Type":"CPU", + "WritePath":"/dev/thermal/cdev-by-name/thermal-uclamp-0/cur_state", + "ScalingAvailableFrequenciesPath": "/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies", + "State2Power":["652", "532", "408", "332", "276", "232", "172", "168" ,"156", "148"] + }, + { + "Name":"thermal-uclamp-4", + "Type":"CPU", + "WritePath":"/dev/thermal/cdev-by-name/thermal-uclamp-4/cur_state", + "ScalingAvailableFrequenciesPath": "/sys/devices/system/cpu/cpufreq/policy4/scaling_available_frequencies", + "State2Power":["3933", "3567", "3216", "2727", "2385", "1902", "1530", "1110", "927", "819", "723", "585", "462", "393", "309", "270", "162"] + }, + { + "Name":"thermal-uclamp-7", + "Type":"CPU", + "WritePath":"/dev/thermal/cdev-by-name/thermal-uclamp-7/cur_state", + "ScalingAvailableFrequenciesPath": "/sys/devices/system/cpu/cpufreq/policy7/scaling_available_frequencies", + "State2Power":["5041", "4525", "4287", "4150", "4008", "3503", "3092", "2380", "2027", "1874", "1579", "1317", "1181", "1020", "807", "670", "496", "266"] + }, { "Name":"thermal-cpufreq-0", "Type":"CPU",