From 22dcc3447baa8b2827e786f90ffe175d87ef4738 Mon Sep 17 00:00:00 2001 From: Dmitry Skiba Date: Wed, 27 Nov 2024 19:15:44 +0000 Subject: [PATCH 1/3] Add a way to disable auto prefer fit for launch. This change introduces "is APF enabled" system properties, and uses them as trigger conditions for APF nodes / pre-APF nodes. By default APF nodes are active, and pre-APF nodes are inactive, which maintains the situation before this change. A future experiment will flip "is APF enabled" system properties, deactivating APF nodes and activating pre-APF nodes. For more info see go/pixel-perf-apf-experiment. Bug: 365855872 Test: set vendor.powerhal.apf_enabled=false, vendor.powerhal.apf_disabled=true, observe auto_prefer_fit procfs value is never "1" Flag: NONE powerhint change does not support flags Change-Id: I919ad3ffe5f496df75bcb492bd3b4fa2285df65c Signed-off-by: Dmitry Skiba --- device-caiman.mk | 5 +++++ device-komodo.mk | 5 +++++ device-ripcurrentpro.mk | 5 +++++ device-tokay.mk | 5 +++++ perf/powerhint-caiman.json | 36 ++++++++++++++++++++++++------- perf/powerhint-komodo.json | 36 ++++++++++++++++++++++++------- perf/powerhint-ripcurrentpro.json | 36 ++++++++++++++++++++++++------- perf/powerhint-tokay.json | 36 ++++++++++++++++++++++++------- 8 files changed, 132 insertions(+), 32 deletions(-) diff --git a/device-caiman.mk b/device-caiman.mk index 73c1a53f..ad2f174a 100644 --- a/device-caiman.mk +++ b/device-caiman.mk @@ -502,3 +502,8 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/google/caimito/bluetooth/audio_set_configurations.json:$(TARGET_COPY_OUT_VENDOR)/etc/aidl/le_audio/aidl_audio_set_configurations.json + +# Enable APF by default +PRODUCT_VENDOR_PROPERTIES += \ + vendor.powerhal.apf_disabled=false \ + vendor.powerhal.apf_enabled=true diff --git a/device-komodo.mk b/device-komodo.mk index e7cc9dd5..7c3595bd 100644 --- a/device-komodo.mk +++ b/device-komodo.mk @@ -503,3 +503,8 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/google/caimito/bluetooth/audio_set_configurations.json:$(TARGET_COPY_OUT_VENDOR)/etc/aidl/le_audio/aidl_audio_set_configurations.json + +# Enable APF by default +PRODUCT_VENDOR_PROPERTIES += \ + vendor.powerhal.apf_disabled=false \ + vendor.powerhal.apf_enabled=true diff --git a/device-ripcurrentpro.mk b/device-ripcurrentpro.mk index 9434e674..d3d9ef8f 100644 --- a/device-ripcurrentpro.mk +++ b/device-ripcurrentpro.mk @@ -245,3 +245,8 @@ PRODUCT_VENDOR_PROPERTIES += \ # Thread HAL PRODUCT_PACKAGES += \ com.google.caimito.hardware.threadnetwork + +# Enable APF by default +PRODUCT_VENDOR_PROPERTIES += \ + vendor.powerhal.apf_disabled=false \ + vendor.powerhal.apf_enabled=true diff --git a/device-tokay.mk b/device-tokay.mk index 5413d69e..a3252833 100644 --- a/device-tokay.mk +++ b/device-tokay.mk @@ -472,3 +472,8 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/google/caimito/bluetooth/audio_set_configurations.json:$(TARGET_COPY_OUT_VENDOR)/etc/aidl/le_audio/aidl_audio_set_configurations.json + +# Enable APF by default +PRODUCT_VENDOR_PROPERTIES += \ + vendor.powerhal.apf_disabled=false \ + vendor.powerhal.apf_enabled=true diff --git a/perf/powerhint-caiman.json b/perf/powerhint-caiman.json index 0bed18b6..9d751f7a 100644 --- a/perf/powerhint-caiman.json +++ b/perf/powerhint-caiman.json @@ -1107,6 +1107,13 @@ "Duration": 5000, "Value": "512" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1181,7 +1188,8 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", @@ -1189,35 +1197,47 @@ "Duration": 5000, "Value": "0xff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0xff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceEnable", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighValue", - "Duration": 5000, - "Value": "765" + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighPrio", "Duration": 5000, - "Value": "110" + "Value": "110", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidValue", - "Duration": 5000, - "Value": "590" + "Duration": 5000, + "Value": "590", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidPrio", "Duration": 5000, - "Value": "139" + "Value": "139", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", diff --git a/perf/powerhint-komodo.json b/perf/powerhint-komodo.json index 0ccc1606..d35b21a3 100644 --- a/perf/powerhint-komodo.json +++ b/perf/powerhint-komodo.json @@ -1107,6 +1107,13 @@ "Duration": 5000, "Value": "512" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1181,7 +1188,8 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", @@ -1189,35 +1197,47 @@ "Duration": 5000, "Value": "0xff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0xff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceEnable", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighValue", - "Duration": 5000, - "Value": "765" + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighPrio", "Duration": 5000, - "Value": "110" + "Value": "110", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidValue", - "Duration": 5000, - "Value": "590" + "Duration": 5000, + "Value": "590", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidPrio", "Duration": 5000, - "Value": "139" + "Value": "139", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", diff --git a/perf/powerhint-ripcurrentpro.json b/perf/powerhint-ripcurrentpro.json index f970372a..274b0e9f 100644 --- a/perf/powerhint-ripcurrentpro.json +++ b/perf/powerhint-ripcurrentpro.json @@ -991,6 +991,13 @@ "Duration": 5000, "Value": "512" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1065,7 +1072,8 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", @@ -1073,35 +1081,47 @@ "Duration": 5000, "Value": "0xff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0xff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceEnable", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighValue", - "Duration": 5000, - "Value": "765" + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighPrio", "Duration": 5000, - "Value": "110" + "Value": "110", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidValue", - "Duration": 5000, - "Value": "590" + "Duration": 5000, + "Value": "590", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidPrio", "Duration": 5000, - "Value": "139" + "Value": "139", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", diff --git a/perf/powerhint-tokay.json b/perf/powerhint-tokay.json index 1bbab17a..b64c2eaf 100644 --- a/perf/powerhint-tokay.json +++ b/perf/powerhint-tokay.json @@ -1107,6 +1107,13 @@ "Duration": 5000, "Value": "512" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1181,7 +1188,8 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", @@ -1189,35 +1197,47 @@ "Duration": 5000, "Value": "0xff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0xff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceEnable", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighValue", - "Duration": 5000, - "Value": "765" + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceHighPrio", "Duration": 5000, - "Value": "110" + "Value": "110", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidValue", - "Duration": 5000, - "Value": "590" + "Duration": 5000, + "Value": "590", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidPrio", "Duration": 5000, - "Value": "139" + "Value": "139", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", From 756cd135786e8b77fa8355edc3f60e0c7240dc5f Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Thu, 5 Dec 2024 01:34:18 +0000 Subject: [PATCH 2/3] thermal: update policy for earlier USB port throttling/warning Bug: 377956961 Test: confirm usbc throttling and warning UI by emul_temp Flag: EXEMPT config update Change-Id: Ieb5f1bb93a9f96ba855c7ed05cdc8b9f033392ca --- thermal/thermal_info_config_caiman.json | 30 +++++++++++-------- .../thermal_info_config_charge_caiman.json | 19 ++++++++---- .../thermal_info_config_charge_komodo.json | 19 ++++++++---- thermal/thermal_info_config_charge_tokay.json | 19 ++++++++---- thermal/thermal_info_config_komodo.json | 30 +++++++++++-------- thermal/thermal_info_config_tokay.json | 30 +++++++++++-------- 6 files changed, 93 insertions(+), 54 deletions(-) diff --git a/thermal/thermal_info_config_caiman.json b/thermal/thermal_info_config_caiman.json index d1ec90fb..6369238a 100644 --- a/thermal/thermal_info_config_caiman.json +++ b/thermal/thermal_info_config_caiman.json @@ -1133,22 +1133,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1156,13 +1163,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true diff --git a/thermal/thermal_info_config_charge_caiman.json b/thermal/thermal_info_config_charge_caiman.json index f2ad61be..52174348 100644 --- a/thermal/thermal_info_config_charge_caiman.json +++ b/thermal/thermal_info_config_charge_caiman.json @@ -265,22 +265,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_charge_komodo.json b/thermal/thermal_info_config_charge_komodo.json index 1851ceb4..07150dae 100644 --- a/thermal/thermal_info_config_charge_komodo.json +++ b/thermal/thermal_info_config_charge_komodo.json @@ -276,22 +276,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_charge_tokay.json b/thermal/thermal_info_config_charge_tokay.json index 740ecfa1..e5cc66fd 100644 --- a/thermal/thermal_info_config_charge_tokay.json +++ b/thermal/thermal_info_config_charge_tokay.json @@ -243,22 +243,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_komodo.json b/thermal/thermal_info_config_komodo.json index 045e4ad8..e1ae5722 100644 --- a/thermal/thermal_info_config_komodo.json +++ b/thermal/thermal_info_config_komodo.json @@ -1156,22 +1156,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1179,13 +1186,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true diff --git a/thermal/thermal_info_config_tokay.json b/thermal/thermal_info_config_tokay.json index 05b1ead8..30a492c8 100644 --- a/thermal/thermal_info_config_tokay.json +++ b/thermal/thermal_info_config_tokay.json @@ -1090,22 +1090,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1113,13 +1120,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true From 0977e86695226d94eb6c1ea8dec296f35bb336d3 Mon Sep 17 00:00:00 2001 From: Dmitry Skiba Date: Fri, 6 Dec 2024 22:17:12 +0000 Subject: [PATCH 3/3] Add support for AMM experiment. See go/pixel-perf-amm-experiment for more info. Bug: 365855872 Test: build/flash; set .Perf__amm_experiment=true, observe auto_migration_margins_enable value changing 1->0; set .Perf__amm_experiment="", observe the value changing 0->1 Flag: NONE controlled by Mendel instead Change-Id: Iacd310c83821cce8f50cdb82ab39f714c50f0e42 Signed-off-by: Dmitry Skiba --- perf/powerhint-caiman.json | 18 ++++++++++++++++-- perf/powerhint-komodo.json | 18 ++++++++++++++++-- perf/powerhint-tokay.json | 18 ++++++++++++++++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/perf/powerhint-caiman.json b/perf/powerhint-caiman.json index 0bed18b6..108816d3 100644 --- a/perf/powerhint-caiman.json +++ b/perf/powerhint-caiman.json @@ -3472,13 +3472,15 @@ "PowerHint": "GAME", "Node": "AutoMigrationMarginsEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", "Node": "AutoDvfsHeadroomEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", @@ -3779,6 +3781,18 @@ "Node": "MIFTargetLoad", "Duration": 0, "Value": "20 80" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" } ], "GpuSysfsPath" : "/sys/devices/platform/1f000000.mali", diff --git a/perf/powerhint-komodo.json b/perf/powerhint-komodo.json index 0ccc1606..f9cd7605 100644 --- a/perf/powerhint-komodo.json +++ b/perf/powerhint-komodo.json @@ -3472,13 +3472,15 @@ "PowerHint": "GAME", "Node": "AutoMigrationMarginsEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", "Node": "AutoDvfsHeadroomEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", @@ -3779,6 +3781,18 @@ "Node": "MIFTargetLoad", "Duration": 0, "Value": "20 80" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" } ], "GpuSysfsPath" : "/sys/devices/platform/1f000000.mali", diff --git a/perf/powerhint-tokay.json b/perf/powerhint-tokay.json index 1bbab17a..a97bbeb0 100644 --- a/perf/powerhint-tokay.json +++ b/perf/powerhint-tokay.json @@ -3472,13 +3472,15 @@ "PowerHint": "GAME", "Node": "AutoMigrationMarginsEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", "Node": "AutoDvfsHeadroomEnable", "Duration": 0, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.amm_enabled" }, { "PowerHint": "GAME", @@ -3779,6 +3781,18 @@ "Node": "MIFTargetLoad", "Duration": 0, "Value": "20 80" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "DISABLE_AMM", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" } ], "GpuSysfsPath" : "/sys/devices/platform/1f000000.mali",