From 25708fffba40ade8ee8469a869a2a99bc13f943e Mon Sep 17 00:00:00 2001 From: Bassem Khalife Date: Fri, 11 Feb 2022 22:57:17 +0000 Subject: [PATCH 1/4] Update Raven SVN to 24 Bug: 216579780 Change-Id: I720927230b25d9a531bc884d280c461e3ada0b74 (cherry picked from commit 6cb30bddceab8a23813264af40bf48f286b72934) Merged-In:I720927230b25d9a531bc884d280c461e3ada0b74 --- device-raven.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-raven.mk b/device-raven.mk index bd162df..543b740 100644 --- a/device-raven.mk +++ b/device-raven.mk @@ -183,7 +183,7 @@ endif # Increment the SVN for any official public releases PRODUCT_VENDOR_PROPERTIES += \ - ro.vendor.build.svn=22 + ro.vendor.build.svn=24 # Hide cutout overlays PRODUCT_PACKAGES += \ From 3db959003d260eb3ce4754a47aee74aef17deeb0 Mon Sep 17 00:00:00 2001 From: Bassem Khalife Date: Fri, 11 Feb 2022 22:56:46 +0000 Subject: [PATCH 2/4] Update Oriole SVN to 24 Bug: 216579780 Change-Id: Ia3cb387c957050ef6828e2d5a439965e8c060bcc (cherry picked from commit d9503819a343ca52a9c169d68ec00e7063cf0293) Merged-In:Ia3cb387c957050ef6828e2d5a439965e8c060bcc --- device-oriole.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-oriole.mk b/device-oriole.mk index bec8875..5120dc5 100644 --- a/device-oriole.mk +++ b/device-oriole.mk @@ -171,7 +171,7 @@ endif # Increment the SVN for any official public releases PRODUCT_VENDOR_PROPERTIES += \ - ro.vendor.build.svn=22 + ro.vendor.build.svn=24 # Hide cutout overlays PRODUCT_PACKAGES += \ From e593aaa350f80296127f3e1231ca6e5e1c0baa9d Mon Sep 17 00:00:00 2001 From: chungkai Date: Wed, 6 Apr 2022 10:11:12 +0000 Subject: [PATCH 3/4] fix path for i2c peripheral device paths are changed when we enable parallel module loading and reorder the initializtaion of devices. Test: without avc denial on B3 when booting Bug: 227541760 Signed-off-by: chungkai Change-Id: Ibc9f9138d5becc26d9fbf0c2df43e55dddd40a97 --- powerstats/oriole/service.cpp | 18 ++++++++++++++++-- powerstats/raven/service.cpp | 19 ++++++++++++++++--- powerstats/slider/service.cpp | 17 ++++++++++++++++- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/powerstats/oriole/service.cpp b/powerstats/oriole/service.cpp index 8331997..af936a3 100644 --- a/powerstats/oriole/service.cpp +++ b/powerstats/oriole/service.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider; using aidl::android::hardware::power::stats::EnergyConsumerType; @@ -75,6 +76,8 @@ void addDisplay(std::shared_ptr p) { } int main() { + struct stat buffer; + LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting."; // single thread @@ -84,8 +87,19 @@ int main() { addGs101CommonDataProviders(p); addDisplay(p); - addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats"); - + if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats"); + } else { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-8/i2c-st21nfc/power_stats"); + } const std::string instance = std::string() + PowerStats::descriptor + "/default"; binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str()); LOG_ALWAYS_FATAL_IF(status != STATUS_OK); diff --git a/powerstats/raven/service.cpp b/powerstats/raven/service.cpp index 579efa1..10bf17e 100644 --- a/powerstats/raven/service.cpp +++ b/powerstats/raven/service.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider; using aidl::android::hardware::power::stats::EnergyConsumerType; @@ -117,6 +118,8 @@ void addUwb(std::shared_ptr p) { } int main() { + struct stat buffer; + LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting."; // single thread @@ -126,9 +129,19 @@ int main() { addGs101CommonDataProviders(p); addDisplay(p); - addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats"); - addUwb(p); - + if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats"); + } else { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-8/i2c-st21nfc/power_stats"); + } const std::string instance = std::string() + PowerStats::descriptor + "/default"; binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str()); LOG_ALWAYS_FATAL_IF(status != STATUS_OK); diff --git a/powerstats/slider/service.cpp b/powerstats/slider/service.cpp index 5fe5332..6969cc0 100644 --- a/powerstats/slider/service.cpp +++ b/powerstats/slider/service.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using aidl::android::hardware::power::stats::DisplayStateResidencyDataProvider; using aidl::android::hardware::power::stats::EnergyConsumerType; @@ -58,6 +59,8 @@ void addDisplay(std::shared_ptr p) { } int main() { + struct stat buffer; + LOG(INFO) << "Pixel PowerStats HAL AIDL Service is starting."; // single thread @@ -67,7 +70,19 @@ int main() { addGs101CommonDataProviders(p); addDisplay(p); - + if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-3/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-4/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-5/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-6/i2c-st21nfc/power_stats"); + } else if (!stat("/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats", &buffer)) { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-7/i2c-st21nfc/power_stats"); + } else { + addNFC(p, "/sys/devices/platform/10960000.hsi2c/i2c-8/i2c-st21nfc/power_stats"); + } const std::string instance = std::string() + PowerStats::descriptor + "/default"; binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str()); LOG_ALWAYS_FATAL_IF(status != STATUS_OK); From 9512991739282971b6973a91605b07c42d7fa90b Mon Sep 17 00:00:00 2001 From: Taeju Park Date: Wed, 30 Mar 2022 05:53:25 +0000 Subject: [PATCH 4/4] Add powerhint nodes for PMU parameter tune Bug: 223688700 Change-Id: I3abcbd0b8efb696469468dfc190699ec3842db08 Signed-off-by: Taeju Park --- powerhint-oriole.json | 27 +++++++++++++++++++++++++++ powerhint-raven.json | 27 +++++++++++++++++++++++++++ powerhint-slider.json | 27 +++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/powerhint-oriole.json b/powerhint-oriole.json index a555bca..e76c7ad 100644 --- a/powerhint-oriole.json +++ b/powerhint-oriole.json @@ -413,6 +413,15 @@ "1" ], "DefaultIndex": 0 + }, + { + "Name": "PMU_POLL", + "Path": "/proc/vendor_sched/pmu_poll_enable", + "Values": [ + "0", + "1" + ], + "DefaultIndex": 0 } ], "Actions": [ @@ -1267,6 +1276,12 @@ "Duration": 0, "Value": "400000" }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", "Node": "BigControlTempSet", @@ -1375,6 +1390,12 @@ "Duration": 1000, "Value": "1" }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_EMERGENCY", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "THERMAL_VIRTUAL-SKIN_EMERGENCY", "Node": "CPU_LITTLE_TSKIN_BYPASS", @@ -1458,6 +1479,12 @@ "Node": "RestrictedCpuset", "Duration": 0, "Value": "0-3" + }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_LIGHT", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" } ] } diff --git a/powerhint-raven.json b/powerhint-raven.json index b776df9..69ec157 100644 --- a/powerhint-raven.json +++ b/powerhint-raven.json @@ -414,6 +414,15 @@ "1" ], "DefaultIndex": 0 + }, + { + "Name": "PMU_POLL", + "Path": "/proc/vendor_sched/pmu_poll_enable", + "Values": [ + "0", + "1" + ], + "DefaultIndex": 0 } ], "Actions": [ @@ -1284,6 +1293,12 @@ "Duration": 0, "Value": "400000" }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", "Node": "BigControlTempSet", @@ -1392,6 +1407,12 @@ "Duration": 1000, "Value": "1" }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_EMERGENCY", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "THERMAL_VIRTUAL-SKIN_EMERGENCY", "Node": "CPU_LITTLE_TSKIN_BYPASS", @@ -1475,6 +1496,12 @@ "Node": "RestrictedCpuset", "Duration": 0, "Value": "0-3" + }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_LIGHT", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" } ] } diff --git a/powerhint-slider.json b/powerhint-slider.json index d5eab6b..7ee9ab4 100644 --- a/powerhint-slider.json +++ b/powerhint-slider.json @@ -379,6 +379,15 @@ ], "DefaultIndex": 0, "ResetOnInit": false + }, + { + "Name": "PMU_POLL", + "Path": "/proc/vendor_sched/pmu_poll_enable", + "Values": [ + "0", + "1" + ], + "DefaultIndex": 0 } ], "Actions": [ @@ -1301,6 +1310,12 @@ "Duration": 0, "Value": "400000" }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, { "PowerHint": "THERMAL_VIRTUAL-SKIN_SEVERE", "Node": "BigControlTempSet", @@ -1378,6 +1393,18 @@ "Node": "MLUclampBoost", "Duration": 2000, "Value": "512" + }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_EMERGENCY", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" + }, + { + "PowerHint": "THERMAL_VIRTUAL-SKIN_LIGHT", + "Node": "PMU_POLL", + "Duration": 0, + "Value": "1" } ] }