diff --git a/conf/init.comet.rc b/conf/init.comet.rc index 70c2c0c..3c88556 100644 --- a/conf/init.comet.rc +++ b/conf/init.comet.rc @@ -77,7 +77,7 @@ on property:vendor.thermal.link_ready=1 # ODPM on early-boot && property:ro.boot.hardware.sku=GC15S - write /sys/bus/iio/devices/iio:device0/enabled_rails "CH11=BUCK12S" + write /sys/bus/iio/devices/iio:device1/enabled_rails "CH11=BUCK12S" # SFPS Fingerprint on post-fs-data diff --git a/device-comet.mk b/device-comet.mk index 6098a15..0483db1 100644 --- a/device-comet.mk +++ b/device-comet.mk @@ -126,6 +126,10 @@ 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/comet/nfc/libse-gto-hal.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libse-gto-hal.conf +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Thermal Config ifeq (,$(TARGET_VENDOR_THERMAL_CONFIG_PATH)) TARGET_VENDOR_THERMAL_CONFIG_PATH := device/google/comet/thermal @@ -135,6 +139,7 @@ PRODUCT_COPY_FILES += \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_charge_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_backup_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_backup.json \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_comet.tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \ PRODUCT_PACKAGES += \ init_thermal_config diff --git a/powerhint-comet.json b/powerhint-comet.json index 052208e..100bc21 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -240,7 +240,7 @@ "2048 1280 1280", "1280", "1100", - "1100 1078 1024" + "1100 1024 1100" ], "DefaultIndex": 0, "ResetOnInit": true @@ -251,7 +251,7 @@ "Values": [ "1280", "1100", - "1100 1078 1024" + "1280 1100 1055" ], "DefaultIndex": 0, "ResetOnInit": true @@ -1729,7 +1729,7 @@ "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "CPUDVFSHeadroom", "Duration": 0, - "Value": "1100 1078 1024" + "Value": "1100" }, { "PowerHint": "CAMERA_STREAMING_HIGH", @@ -1803,12 +1803,6 @@ "Duration": 0, "Value": "700000" }, - { - "PowerHint": "CAMERA_STREAMING_STANDARD", - "Node": "CPUDVFSHeadroom", - "Duration": 0, - "Value": "1280" - }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "PowerHALCameraRunning", @@ -1881,6 +1875,18 @@ "Duration": 0, "Value": "cam2" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "CPUUtilThreshold", + "Duration": 0, + "Value": "1100 1024 1100" + }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "CPUDVFSHeadroom", + "Duration": 0, + "Value": "1280 1100 1055" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "CDPreferHighCap", @@ -2464,72 +2470,6 @@ "Duration": 0, "Value": "419000" }, - { - "PowerHint": "GAME", - "Node": "VIRTUAL-SKIN-CPU-LIGHT-ODPM", - "Duration": 0, - "Value": "game" - }, - { - "PowerHint": "GAME", - "Node": "VIRTUAL-SKIN-CPU-MID", - "Duration": 0, - "Value": "game" - }, - { - "PowerHint": "GAME", - "Node": "VIRTUAL-SKIN-CPU-HIGH", - "Duration": 0, - "Value": "game" - }, - { - "PowerHint": "GAME", - "Node": "CPUDVFSHeadroom", - "Duration": 0, - "Value": "1100" - }, - { - "PowerHint": "GAME", - "Node": "CPUTaperedDVFSHeadroomEnable", - "Duration": 0, - "Value": "1" - }, - { - "PowerHint": "GAME", - "Node": "CPULittleClusterDownRateLimitUs", - "Duration": 0, - "Value": "500" - }, - { - "PowerHint": "GAME", - "Node": "CPUMidClusterDownRateLimitUs", - "Duration": 0, - "Value": "3000" - }, - { - "PowerHint": "GAME", - "Node": "CPUBigClusterDownRateLimitUs", - "Duration": 0, - "Value": "3000" - }, - { - "PowerHint": "GAME", - "Node": "TAPreferIdle", - "Duration": 0, - "Value": "0" - }, - { - "PowerHint": "GAME", - "Node": "FGPreferIdle", - "Duration": 0, - "Value": "0" - }, - { - "PowerHint": "GAME", - "Node": "NPITaskPacking", - "Duration": 0, - "Value": "1" - }, { "PowerHint": "THERMAL_VIRTUAL-SKIN-HINT_LIGHT", "Node": "PMU_POLL", @@ -2638,6 +2578,72 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "GAME", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "GAME", + "Node": "VIRTUAL-SKIN-CPU-LIGHT-ODPM", + "Duration": 0, + "Value": "game" + }, + { + "PowerHint": "GAME", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "game" + }, + { + "PowerHint": "GAME", + "Node": "VIRTUAL-SKIN-CPU-HIGH", + "Duration": 0, + "Value": "game" + }, + { + "PowerHint": "GAME", + "Node": "CPUTaperedDVFSHeadroomEnable", + "Duration": 0, + "Value": "1" + }, + { + "PowerHint": "GAME", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "500" + }, + { + "PowerHint": "GAME", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "3000" + }, + { + "PowerHint": "GAME", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "3000" + }, + { + "PowerHint": "GAME", + "Node": "TAPreferIdle", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "GAME", + "Node": "FGPreferIdle", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "GAME", + "Node": "NPITaskPacking", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "FACE_UNLOCK_BOOST", "Node": "CPUBigClusterMaxFreq", diff --git a/thermal/thermal_info_config_charge_comet.json b/thermal/thermal_info_config_charge_comet.json index d248325..e8b7e55 100644 --- a/thermal/thermal_info_config_charge_comet.json +++ b/thermal/thermal_info_config_charge_comet.json @@ -279,6 +279,7 @@ "Name": "USB-MINUS-CHARGER", "Type": "UNKNOWN", "VirtualSensor": true, + "Hidden": true, "TriggerSensor": "usb_conn_therm", "Formula": "WEIGHTED_AVG", "Combination": ["usb_conn_therm", "charger_therm"], diff --git a/thermal/thermal_info_config_comet.json b/thermal/thermal_info_config_comet.json index 8b33b72..ad8eee6 100644 --- a/thermal/thermal_info_config_comet.json +++ b/thermal/thermal_info_config_comet.json @@ -221,15 +221,64 @@ "Multiplier": 0.001 }, { - "Name": "VIRTUAL-SKIN", - "Type": "SKIN", + "Name": "VIRTUAL-SKIN-LEGACY", + "Type": "UNKNOWN", "Version": "2.0", "VirtualSensor": true, - "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Hidden": true, "Formula": "WEIGHTED_AVG", "Combination": ["VIRTUAL-SKIN-OPEN", "VIRTUAL-SKIN-CLOSE"], "Coefficient": ["OPEN_WEIGHT", "CLOSE_WEIGHT"], "CoefficientType": ["SENSOR", "SENSOR"], + "Multiplier": 0.001 + }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "Version": "1.0", + "VirtualSensor":true, + "Hidden": true, + "ModelPath":"vt_estimation_model.tflite", + "Formula": "USE_ML_MODEL", + "Combination":["soc_therm", "rffe_therm", "charger_therm", "usb_conn_therm", "modem_therm", "inner_display_therm", "display_therm", "gnss_tcxo_therm", "maxfg_base", "maxfg_secondary", "inner_brightness"], + "Multiplier":0.001, + "PreviousSampleCount": 3, + "BackupSensor": "VIRTUAL-SKIN-LEGACY", + "ValidateInput": true + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Hidden": true, + "Formula": "WEIGHTED_AVG", + "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, -1.0], + "Multiplier": 1 + }, + { + "Name": "STATS-UPDATOR", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Hidden": true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula": "WEIGHTED_AVG", + "Combination": ["VIRTUAL-SKIN-MODEL", "VIRTUAL-SKIN-LEGACY", "VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], + "Coefficient": [0.0, 0.0, 0.0], + "Multiplier": 1, + "SendPowerHint": true, + "PollingDelay": 300000, + "PassiveDelay": 7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "2.1", + "VirtualSensor": true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0], "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 53.0, 57.0], "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], "Multiplier": 0.001, @@ -849,6 +898,7 @@ "Name": "USB-MINUS-CHARGER", "Type": "UNKNOWN", "VirtualSensor": true, + "Hidden": true, "TriggerSensor": "usb_conn_therm", "Formula": "WEIGHTED_AVG", "Combination": ["usb_conn_therm", "charger_therm"], @@ -896,9 +946,9 @@ "Hidden": true, "VirtualSensor": true, "Formula": "WEIGHTED_AVG", - "Combination": ["usb_conn_therm"], - "Coefficient": [0.561], - "Offset": 10729, + "Combination": ["display_therm", "maxfg_secondary"], + "Coefficient": [0.516, 0.535], + "Offset": -26, "Multiplier": 0.001 }, { @@ -907,9 +957,9 @@ "Hidden": true, "VirtualSensor": true, "Formula": "WEIGHTED_AVG", - "Combination": ["soc_therm"], - "Coefficient": [0.799], - "Offset": 1620, + "Combination": ["usb_conn_therm", "maxfg_base"], + "Coefficient": [0.045, 0.849], + "Offset": 2975, "Multiplier": 0.001 }, { @@ -1056,6 +1106,26 @@ "Name": "VIRTUAL-SKIN", "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 55] }, + { + "Name": "VIRTUAL-SKIN-MODEL", + "Thresholds": [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 55] + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "LoggingName": "MODEL-LEGACY-0.5", + "Thresholds": [ + -4500, -4000, -3500, -3000, -2500, -2000, -1500, -1000, -500, 0, + 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500 + ] + }, + { + "Name": "VIRTUAL-SKIN-MODEL-LEGACY-DIFF", + "LoggingName": "MODEL-LEGACY-1", + "Thresholds": [ + -13000, -12000, -11000, -10000, -9000, -8000, -7000, -6000, -5000, + -4000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000 + ] + }, { "Name": "VIRTUAL-SKIN-SPEAKER", "Thresholds": [35, 37] @@ -1065,8 +1135,16 @@ "Outlier": { "Configs": [ { - "Monitor": ["VIRTUAL-SKIN"], - "TempRange": [0.0, 55.0] + "Monitor": ["VIRTUAL-SKIN-LEGACY"], + "TempRange": [0.0, 57.0] + }, + { + "Monitor": ["VIRTUAL-SKIN-MODEL"], + "TempRange": [0.0, 57.0] + }, + { + "Monitor": ["VIRTUAL-SKIN-MODEL-LEGACY-DIFF"], + "TempRange": [-12000, 12000] } ] }, diff --git a/thermal/vt_estimation_model_comet.tflite b/thermal/vt_estimation_model_comet.tflite new file mode 100644 index 0000000..4283a30 Binary files /dev/null and b/thermal/vt_estimation_model_comet.tflite differ