From d4032aaaa30b2706b4c22952edada8ecdfd4e566 Mon Sep 17 00:00:00 2001 From: Sayanna Chandula Date: Thu, 7 Dec 2023 11:28:58 -0800 Subject: [PATCH] thermal: enable virtual-skin-model Bug: 298225131 Test: Build and boot on device Change-Id: Iaff3795474b66ff7345a9c5236e6dff4da69de01 Signed-off-by: Sayanna Chandula --- device-caiman.mk | 4 ++++ device-caimito-common.mk | 3 ++- device-komodo.mk | 4 ++++ device-tokay.mk | 4 ++++ thermal/thermal_info_config_caiman.json | 16 ++++++++++++++++ thermal/thermal_info_config_caiman_proto.json | 16 ++++++++++++++++ thermal/thermal_info_config_komodo.json | 16 ++++++++++++++++ thermal/thermal_info_config_komodo_proto.json | 16 ++++++++++++++++ thermal/thermal_info_config_tokay.json | 16 ++++++++++++++++ thermal/thermal_info_config_tokay_proto.json | 17 ++++++++++++++++- thermal/vt_estimation_model_caiman.tflite | Bin 0 -> 1920 bytes thermal/vt_estimation_model_komodo.tflite | Bin 0 -> 1920 bytes thermal/vt_estimation_model_tokay.tflite | Bin 0 -> 1920 bytes 13 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 thermal/vt_estimation_model_caiman.tflite create mode 100644 thermal/vt_estimation_model_komodo.tflite create mode 100644 thermal/vt_estimation_model_tokay.tflite diff --git a/device-caiman.mk b/device-caiman.mk index 5142e82e..c7e429df 100644 --- a/device-caiman.mk +++ b/device-caiman.mk @@ -213,6 +213,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/device-caimito-common.mk b/device-caimito-common.mk index 164bc639..9077f607 100644 --- a/device-caimito-common.mk +++ b/device-caimito-common.mk @@ -26,7 +26,8 @@ PRODUCT_COPY_FILES += \ ifneq (,$(filter $(TARGET_DEVICE),komodo caiman tokay)) PRODUCT_COPY_FILES += \ - $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite endif # Power HAL config diff --git a/device-komodo.mk b/device-komodo.mk index 2da4511c..e301e941 100644 --- a/device-komodo.mk +++ b/device-komodo.mk @@ -229,6 +229,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/device-tokay.mk b/device-tokay.mk index 38160696..c53e0fe3 100644 --- a/device-tokay.mk +++ b/device-tokay.mk @@ -213,6 +213,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/thermal/thermal_info_config_caiman.json b/thermal/thermal_info_config_caiman.json index 35be56b8..bb56b09b 100644 --- a/thermal/thermal_info_config_caiman.json +++ b/thermal/thermal_info_config_caiman.json @@ -255,6 +255,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_caiman_proto.json b/thermal/thermal_info_config_caiman_proto.json index ff7166b2..35b426f8 100644 --- a/thermal/thermal_info_config_caiman_proto.json +++ b/thermal/thermal_info_config_caiman_proto.json @@ -245,6 +245,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_komodo.json b/thermal/thermal_info_config_komodo.json index 92f7c67f..b337229f 100644 --- a/thermal/thermal_info_config_komodo.json +++ b/thermal/thermal_info_config_komodo.json @@ -288,6 +288,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_komodo_proto.json b/thermal/thermal_info_config_komodo_proto.json index 35fdc999..e6be4d59 100644 --- a/thermal/thermal_info_config_komodo_proto.json +++ b/thermal/thermal_info_config_komodo_proto.json @@ -278,6 +278,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_tokay.json b/thermal/thermal_info_config_tokay.json index 39d571db..8f7491a8 100644 --- a/thermal/thermal_info_config_tokay.json +++ b/thermal/thermal_info_config_tokay.json @@ -233,6 +233,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_tokay_proto.json b/thermal/thermal_info_config_tokay_proto.json index 781be927..0013a582 100644 --- a/thermal/thermal_info_config_tokay_proto.json +++ b/thermal/thermal_info_config_tokay_proto.json @@ -197,7 +197,6 @@ "Offset": 4130.0, "Multiplier": 0.001 }, - { "Name":"VIRTUAL-SKIN", "Type":"SKIN", @@ -224,6 +223,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/vt_estimation_model_caiman.tflite b/thermal/vt_estimation_model_caiman.tflite new file mode 100644 index 0000000000000000000000000000000000000000..dd6d8bebb02170324acafe39763942bbab0621e3 GIT binary patch literal 1920 zcmZ`)e@ss1-DO=e8u<`r(gNj9R&@Z10b@tjx@S*XMiR59ec@?Q_59e$V-S zzUO<+_j`_sF;=~?JSUMQGZRZo{DMT`vtYZfyG!J>c!fU!8; zifrQWNA_g*9Pk*>t~htw9gS9-(jdE4mu?pW{h;6PkAm_)p*VF_#D2kr9uslWyzKO>ob*h_=7apim6e`Hs&Mn%_xq0lE9L`hScQ?FroYgB zoINfo?`BDRCiiI@ij3m=3vWtm#!{srQyqUf_pJBr-g8n-(549oI5;Y44f{^Tq+?=b`%^l=-Ixq9)(h=@)j*D#im5XC+8$WdAF89^Wcu&{e z5t~j#i=TOp3d^5Wc}r}M*!9jQ1s_etN_7{u2wyffXfX#&lK5McR@0rx_hkOV^HY8m zGjooM&s^Ff_E){O?&wpgQr;z1w4HEEZEZ({Yrju=H(QPTXZ5~!?^jnZe)wm!w?~N6 z&d8Jey=DEpPsx_97oGHG_f(00+$s|$2J$3fQ>tj0sn=$VmwC_B$GpJRA!QE?c)PAo zit$5z+UV$*Fn?CzLnkd_a#yA{@z>Ylr^r(}Upl8QpK(2e-lPM2HR{}cdQRGU?}$YG zl(`md<@xn?p#7p8 z^1vs>63K1N3VOv@C>G*rj^LqvO9f`YvkWqlC&WS=WKVbOTM-;|UbM$1=vP86;0Q*P zQK`tb8rf-=UsRQfHvN2wlObd1#R+7MLD$g9Q68a%W2QCGTha|bX^@eA5cB_d0tpcT zTJg$gaj^@lb~Ucd9bKhDQ`+wYzGoqNyk z+;i_a_armM8p9q-9?uCNZPmMnXEBqwm?F+4 zee2FBj}_6S@%+1~Fkw8HsGcm&Nef)MeJMiSdM95^7+sZyZ)Z+)&V{H=@AMU9jvSNL-ML;U9U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