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:
parent
4ce47872f0
commit
4f6e93f30a
9 changed files with 809 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue