From 7571b12f0ee630907dcefb5f84397ea743f40a11 Mon Sep 17 00:00:00 2001 From: Dmitry Skiba Date: Fri, 6 Dec 2024 07:16:02 +0000 Subject: [PATCH] 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 staying "false" and instead preferred_idle_mask_mid changing to 0x1ff during app launches Flag: NONE powerhint change does not support flags Change-Id: I85b5dc812132f229c2cc8583aaadd31d7eedc178 Signed-off-by: Dmitry Skiba --- device-husky.mk | 5 +++++ device-ripcurrent.mk | 5 +++++ device-shiba.mk | 5 +++++ perf/powerhint-husky.json | 36 ++++++++++++++++++++++++++-------- perf/powerhint-ripcurrent.json | 36 ++++++++++++++++++++++++++-------- perf/powerhint-shiba.json | 36 ++++++++++++++++++++++++++-------- 6 files changed, 99 insertions(+), 24 deletions(-) diff --git a/device-husky.mk b/device-husky.mk index 384e6cb..d53f746 100644 --- a/device-husky.mk +++ b/device-husky.mk @@ -535,3 +535,8 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/google/shusky/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-ripcurrent.mk b/device-ripcurrent.mk index c963f0b..d22ebca 100644 --- a/device-ripcurrent.mk +++ b/device-ripcurrent.mk @@ -279,3 +279,8 @@ PRODUCT_VENDOR_PROPERTIES += \ # PKVM Memory Reclaim PRODUCT_VENDOR_PROPERTIES += \ hypervisor.memory_reclaim.supported=1 + +# Enable APF by default +PRODUCT_VENDOR_PROPERTIES += \ + vendor.powerhal.apf_disabled=false \ + vendor.powerhal.apf_enabled=true diff --git a/device-shiba.mk b/device-shiba.mk index 9d1f018..f8bcaed 100644 --- a/device-shiba.mk +++ b/device-shiba.mk @@ -504,3 +504,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-husky.json b/perf/powerhint-husky.json index 973dd45..8a52086 100644 --- a/perf/powerhint-husky.json +++ b/perf/powerhint-husky.json @@ -917,6 +917,13 @@ "Duration": 5000, "Value": "0x1ff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0x1ff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "ReducePreferIdle", @@ -976,6 +983,13 @@ "Duration": 5000, "Value": "615" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1050,37 +1064,43 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "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": "570" + "Duration": 5000, + "Value": "570", + "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-ripcurrent.json b/perf/powerhint-ripcurrent.json index ff4043f..10b337a 100644 --- a/perf/powerhint-ripcurrent.json +++ b/perf/powerhint-ripcurrent.json @@ -945,6 +945,13 @@ "Duration": 5000, "Value": "0x1ff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0x1ff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "ReducePreferIdle", @@ -1004,6 +1011,13 @@ "Duration": 5000, "Value": "615" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1078,37 +1092,43 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "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": "570" + "Duration": 5000, + "Value": "570", + "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-shiba.json b/perf/powerhint-shiba.json index afdab3d..7435de5 100644 --- a/perf/powerhint-shiba.json +++ b/perf/powerhint-shiba.json @@ -918,6 +918,13 @@ "Duration": 5000, "Value": "0x1ff" }, + { + "PowerHint": "LAUNCH", + "Node": "TAPreferredIdleMaskMid", + "Duration": 5000, + "Value": "0x1ff", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "ReducePreferIdle", @@ -977,6 +984,13 @@ "Duration": 5000, "Value": "615" }, + { + "PowerHint": "LAUNCH", + "Node": "TAUClampBoost", + "Duration": 5000, + "Value": "765", + "EnableProperty": "vendor.powerhal.apf_disabled" + }, { "PowerHint": "LAUNCH", "Node": "FGUClampBoost", @@ -1051,37 +1065,43 @@ "PowerHint": "LAUNCH", "Node": "TAAutoPreferFit", "Duration": 5000, - "Value": "1" + "Value": "1", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "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": "570" + "Duration": 5000, + "Value": "570", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH", "Node": "TAUclampMinOnNiceMidPrio", "Duration": 5000, - "Value": "139" + "Value": "139", + "EnableProperty": "vendor.powerhal.apf_enabled" }, { "PowerHint": "LAUNCH",