From 66d98f41ed1c8aa16067fd74d2e390479ec3afa1 Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Wed, 5 Jul 2023 15:03:43 -0700 Subject: [PATCH] thermal: Provide smooth transient when switch VSKIN OPEN/CLOSE equation If the since_last_update time < 14s, apply the 20% stepRatio when VSKIN switch between open/close to prevent the sudden VSKIN thermal change Bug: 260531200 Test: on/off innser dispaly and check thermal log Change-Id: I00bd748b203dd8a2edae278503d8ddf1a914d3aa --- thermal_info_config_charge_felix.json | 42 ++++-------- thermal_info_config_felix.json | 42 ++++-------- thermal_info_config_proactive_skin_felix.json | 64 ++++++++++--------- 3 files changed, 60 insertions(+), 88 deletions(-) diff --git a/thermal_info_config_charge_felix.json b/thermal_info_config_charge_felix.json index ceb9181..fe7ce1e 100644 --- a/thermal_info_config_charge_felix.json +++ b/thermal_info_config_charge_felix.json @@ -60,23 +60,26 @@ "Multiplier":1 }, { - "Name":"IS_OPEN", + "Name":"OPEN_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, "Formula":"COUNT_THRESHOLD", + "StepRatio":0.2, "Combination":["inner-disp"], "Coefficient":[1.0], - "Multiplier":1 + "Multiplier":1, + "PassiveDelay":7000 }, { - "Name":"IS_CLOSE", + "Name":"CLOSE_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "Combination":["inner-disp"], - "Coefficient":[-1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["1", "OPEN_WEIGHT"], + "CombinationType":["CONSTANT", "SENSOR"], + "Coefficient":[1.0, -1.0], "Multiplier":1 }, { @@ -144,16 +147,6 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-CLOSE", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["CLOSE-SUB-MAX", "IS_OPEN"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"OPEN-SUB1", "Type":"UNKNOWN", @@ -219,16 +212,6 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-OPEN", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["OPEN-SUB-MAX", "IS_CLOSE"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"VIRTUAL-SKIN-CHARGE", "Type":"UNKNOWN", @@ -236,9 +219,10 @@ "Hidden":true, "VirtualSensor":true, "TriggerSensor":"skin_therm", - "Formula":"MAXIMUM", - "Combination":["VIRTUAL-SKIN-CLOSE", "VIRTUAL-SKIN-OPEN"], - "Coefficient":[1.0, 1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["OPEN-SUB-MAX", "CLOSE-SUB-MAX"], + "Coefficient":["OPEN_WEIGHT", "CLOSE_WEIGHT"], + "CoefficientType":["SENSOR", "SENSOR"], "HotThreshold":["NAN", 25.0, 39.0, 41.0, 45.0, 46.5, 54.0], "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 1.4, 1.9], "Multiplier":0.001, diff --git a/thermal_info_config_felix.json b/thermal_info_config_felix.json index 6bbb5b0..1c3fbd3 100644 --- a/thermal_info_config_felix.json +++ b/thermal_info_config_felix.json @@ -66,23 +66,26 @@ "Multiplier":1 }, { - "Name":"IS_OPEN", + "Name":"OPEN_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, "Formula":"COUNT_THRESHOLD", + "StepRatio":0.2, "Combination":["inner-disp"], "Coefficient":[1.0], - "Multiplier":1 + "Multiplier":1, + "PassiveDelay":7000 }, { - "Name":"IS_CLOSE", + "Name":"CLOSE_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "Combination":["inner-disp"], - "Coefficient":[-1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["1", "OPEN_WEIGHT"], + "CombinationType":["CONSTANT", "SENSOR"], + "Coefficient":[1.0, -1.0], "Multiplier":1 }, { @@ -150,16 +153,6 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-CLOSE", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["CLOSE-SUB-MAX", "IS_OPEN"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"OPEN-SUB1", "Type":"UNKNOWN", @@ -225,25 +218,16 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-OPEN", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["OPEN-SUB-MAX", "IS_CLOSE"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"VIRTUAL-SKIN", "Type":"SKIN", "Version":"0.5", "VirtualSensor":true, "TriggerSensor":"skin_therm", - "Formula":"MAXIMUM", - "Combination":["VIRTUAL-SKIN-CLOSE", "VIRTUAL-SKIN-OPEN"], - "Coefficient":[1.0, 1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["OPEN-SUB-MAX", "CLOSE-SUB-MAX"], + "Coefficient":["OPEN_WEIGHT", "CLOSE_WEIGHT"], + "CoefficientType":["SENSOR", "SENSOR"], "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 51.0, 54.0], "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], "Multiplier":0.001, diff --git a/thermal_info_config_proactive_skin_felix.json b/thermal_info_config_proactive_skin_felix.json index 1b7c446..2ae76fc 100644 --- a/thermal_info_config_proactive_skin_felix.json +++ b/thermal_info_config_proactive_skin_felix.json @@ -66,23 +66,26 @@ "Multiplier":1 }, { - "Name":"IS_OPEN", + "Name":"OPEN_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, "Formula":"COUNT_THRESHOLD", + "StepRatio":0.2, "Combination":["inner-disp"], "Coefficient":[1.0], - "Multiplier":1 + "Multiplier":1, + "PassiveDelay":7000 }, { - "Name":"IS_CLOSE", + "Name":"CLOSE_WEIGHT", "Type":"UNKNOWN", "Hidden":true, "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "Combination":["inner-disp"], - "Coefficient":[-1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["1", "OPEN_WEIGHT"], + "CombinationType":["CONSTANT", "SENSOR"], + "Coefficient":[1.0, -1.0], "Multiplier":1 }, { @@ -150,16 +153,6 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-CLOSE", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["CLOSE-SUB-MAX", "IS_OPEN"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"OPEN-SUB1", "Type":"UNKNOWN", @@ -225,25 +218,16 @@ "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0], "Multiplier":0.001 }, - { - "Name":"VIRTUAL-SKIN-OPEN", - "Type":"UNKNOWN", - "Hidden":true, - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "Combination":["OPEN-SUB-MAX", "IS_CLOSE"], - "Coefficient":[1.0, -1000000], - "Multiplier":0.001 - }, { "Name":"VIRTUAL-SKIN", "Type":"SKIN", "Version":"0.5", "VirtualSensor":true, "TriggerSensor":"skin_therm", - "Formula":"MAXIMUM", - "Combination":["VIRTUAL-SKIN-CLOSE", "VIRTUAL-SKIN-OPEN"], - "Coefficient":[1.0, 1.0], + "Formula":"WEIGHTED_AVG", + "Combination":["OPEN-SUB-MAX", "CLOSE-SUB-MAX"], + "Coefficient":["OPEN_WEIGHT", "CLOSE_WEIGHT"], + "CoefficientType":["SENSOR", "SENSOR"], "HotThreshold":["NAN", 37.0, 41.0, 45.0, 46.5, 51.0, 54.0], "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], "Multiplier":0.001, @@ -966,5 +950,25 @@ "PowerSampleDelay":60000, "PowerSampleCount":1 } - ] + ], + "Stats": { + "Sensors": { + "RecordWithDefaultThreshold": ["VIRTUAL-SKIN"], + "RecordWithThreshold": [ + { + "Name": "VIRTUAL-SKIN", + "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Thresholds": [2.0] + } + ] + }, + "CoolingDevices": { + "RecordVotePerSensor": { + "DefaultThresholdEnableAll": true + } + } + } }