sm6375-common: power-libperfmgr: ADPF: use PID algorithm to control cpu resource

The patch includes:
1. Move from folder adpf to aidl.
2. Add PowerSessionManager class to maintain hint status.
   And PowerHintMointor looper thread for monitoring or updating
   PowerHintSession status.
3. Use PID algorithm to replace the step-wise alogrithm for cpu resource
   control.

Test: build, boot to home, trace analysis
Bug: 177493042
Change-Id: Ib7d3f414225b18954350341ca22b7be87a6202e7
This commit is contained in:
Jimmy Shiu 2024-07-18 12:56:42 +05:30 committed by Anand S
commit 4f6e93f30a
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
9 changed files with 809 additions and 4 deletions

View file

@ -25,9 +25,12 @@
#include "Power.h"
#include "PowerExt.h"
#include "PowerSessionManager.h"
using aidl::google::hardware::power::impl::pixel::Power;
using aidl::google::hardware::power::impl::pixel::PowerExt;
using aidl::google::hardware::power::impl::pixel::PowerHintMonitor;
using aidl::google::hardware::power::impl::pixel::PowerSessionManager;
using ::android::perfmgr::HintManager;
constexpr std::string_view kPowerHalInitProp("vendor.powerhal.init");
@ -65,6 +68,11 @@ int main() {
CHECK(status == STATUS_OK);
LOG(INFO) << "Power HAL AIDL Service for moto_sm6375 is started.";
if (::android::base::GetIntProperty("vendor.powerhal.adpf.rate", -1) != -1) {
PowerHintMonitor::getInstance().start();
PowerSessionManager::getInstance().setHintManager(hm);
}
std::thread initThread([&]() {
::android::base::WaitForProperty(kPowerHalInitProp.data(), "1");
hm->Start();