From 0a40d744bac5644122b76e88ee18c5f9909e4cce Mon Sep 17 00:00:00 2001 From: "Peter (YM)" Date: Thu, 21 Mar 2024 07:22:02 +0000 Subject: [PATCH] thermal: Add VSKIN-MODEL - Enable vskin-model but not apply thermal throttle - Capture model abnormal value when it's outside -20 and 60 degC Bug: 330247219 Test: Build and boot to home Change-Id: Ibfa26713129b0e22305ca4ed147b9cebd05858b6 Signed-off-by: Peter (YM) --- device-tegu.mk | 9 ++++ thermal/thermal_info_config_tegu.json | 58 ++++++++++++++++++++++-- thermal/vt_estimation_model_tegu.tflite | Bin 0 -> 2929 bytes 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 thermal/vt_estimation_model_tegu.tflite diff --git a/device-tegu.mk b/device-tegu.mk index 539970c..4c9fa83 100644 --- a/device-tegu.mk +++ b/device-tegu.mk @@ -82,6 +82,15 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.se.omapi.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.se.omapi.uicc.xml \ device/google/tegu/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf +# Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + +# Thermal Model +TARGET_VENDOR_THERMAL_CONFIG_PATH := device/google/tegu/thermal +PRODUCT_COPY_FILES += \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_tegu.tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \ + # Bluetooth HAL PRODUCT_COPY_FILES += \ device/google/tegu/bluetooth/bt_vendor_overlay_tegu.conf:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth/bt_vendor_overlay.conf diff --git a/thermal/thermal_info_config_tegu.json b/thermal/thermal_info_config_tegu.json index 16542cc..a03fc47 100644 --- a/thermal/thermal_info_config_tegu.json +++ b/thermal/thermal_info_config_tegu.json @@ -310,16 +310,46 @@ "Multiplier":0.001 }, { - "Name":"VIRTUAL-SKIN", - "Type":"SKIN", - "Version":"5.0", + "Name":"VIRTUAL-SKIN-LEGACY", + "Type":"UNKNOWN", "VirtualSensor":true, - "TriggerSensor":["north_therm", "rfpa_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm"], "Formula":"MAXIMUM", "Combination":["VIRTUAL-SKIN-SUB-0", "VIRTUAL-SKIN-SUB-1", "VIRTUAL-SKIN-SUB-2", "VIRTUAL-SKIN-SUB-3", "VIRTUAL-SKIN-SUB-4", "VIRTUAL-SKIN-SUB-5", "VIRTUAL-SKIN-SUB-6", "VIRTUAL-SKIN-SUB-7", "VIRTUAL-SKIN-SUB-8", "VIRTUAL-SKIN-SUB-9", "VIRTUAL-SKIN-SUB-10"], "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + "Multiplier": 0.001 + }, + { + "Name": "VIRTUAL-SKIN-MODEL", + "Type": "UNKNOWN", + "VirtualSensor":true, + "ModelPath": "vt_estimation_model.tflite", + "Formula": "USE_ML_MODEL", + "Combination": ["battery", "btmspkr_therm", "charging_therm", "disp_therm", "north_therm", "quiet_therm", "rfpa_therm", "soc_therm", "usb_pwr_therm"], + "Coefficient": [1.0], + "Multiplier": 0.001 + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "Type": "UNKNOWN", + "Hidden":true, + "VirtualSensor": true, + "Formula": "WEIGHTED_AVG", + "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, -1.0], + "SendPowerHint":true, + "Multiplier": 1 + }, + { + "Name":"VIRTUAL-SKIN", + "Type":"SKIN", + "Version":"1.0", + "VirtualSensor":true, + "TriggerSensor":["north_therm", "rfpa_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm"], + "Formula":"MAXIMUM", + "Combination":["VIRTUAL-SKIN-LEGACY"], + "Coefficient":[1.0], "HotThreshold":["NAN", 49.0, 53.0, 55.0, 56.5, 62.0, 75.0], "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], "Multiplier":0.001, @@ -910,8 +940,26 @@ { "Name": "VIRTUAL-SKIN-SUB-7", "Thresholds": [41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 75] + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "LoggingName": "MODEL-LEGACY-1", + "Thresholds": [ + -10000, -9000, -8000, -7000, -6000, -5000, -4000, -3000, -2000, -1000, + 0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000 + ] } - ] + ], + "Abnormality": { + "Outlier": { + "Configs": [ + { + "Monitor": ["VIRTUAL-SKIN-MODEL"], + "TempRange": [-20.0, 55.0] + } + ] + } + } }, "CoolingDevices": { "RecordVotePerSensor": { diff --git a/thermal/vt_estimation_model_tegu.tflite b/thermal/vt_estimation_model_tegu.tflite new file mode 100644 index 0000000000000000000000000000000000000000..1b131b1754100bf6fc794d632b53099901c018a0 GIT binary patch literal 2929 zcmZ`*YfKbZ6u!u+h(v3J7Aw{XA&Ml-vH}sUJ1iuZWL8OL&1Hp^r$u?+Cim;+-59%H>gMhav5XE1gM$WLc16+EyYO}}(= z6|KRPxt`XQ0doOOQoH0(hu1H)i%~^4*Ezt~6Nv=WVHIOD0lyT|B(H01e%hl%g63wA z&B>uiR5xw6fR_)@d<=TXE{(|^;;Cw?^ww53RjjLMs$kbKKg*t<54v_!U2|naW7Vd* zXEJH(9sUEY00$gLLLxu_XazjL^=X!# z^L8BP@J)HCEh=(N%(rDRneRNvC;;U>o7Mmk0A`qrFXD?pHvkn8(HD@o8resQ%%_ee^i9+1?as1$15 zg}NjLJssh2ha&O5a1bJ6_0BLWZ1srME0(|157zg@Tv8u6fqGT)%RXJ>V210GRXr*y zoYpCaI9&=xIMCoase|)LiY7-jp3TFW=BkFKw<>B18>_48xF(2!M|QFS#$LAj&iufi z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