sm6375-common: power-libperfmgr: ADPF: Use Adpf Profile for PID tunnables
1. Use Adpf Profile to replace system-property-based PID tunnables. 2. Add a tunable for switch PID on/off 3. Switch Adpf Profile by hint name (ex: REFRESH_120FPS) Bug: 202158746 Bug: 204444691 Bug: 206061061 Test: Build Change-Id: Ia673a6bf64d40128ca1797d1e26fe564b3b35ff1
This commit is contained in:
parent
c69f1e93fa
commit
a4ad8dc607
7 changed files with 123 additions and 150 deletions
|
|
@ -46,14 +46,10 @@ using ::android::perfmgr::HintManager;
|
|||
constexpr char kPowerHalStateProp[] = "vendor.powerhal.state";
|
||||
constexpr char kPowerHalAudioProp[] = "vendor.powerhal.audio";
|
||||
constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering";
|
||||
constexpr char kPowerHalAdpfRateProp[] = "vendor.powerhal.adpf.rate";
|
||||
constexpr int64_t kPowerHalAdpfRateDefault = -1;
|
||||
|
||||
Power::Power()
|
||||
: mInteractionHandler(nullptr),
|
||||
mSustainedPerfModeOn(false),
|
||||
mAdpfRateNs(
|
||||
::android::base::GetIntProperty(kPowerHalAdpfRateProp, kPowerHalAdpfRateDefault)) {
|
||||
mSustainedPerfModeOn(false) {
|
||||
mInteractionHandler = std::make_unique<InteractionHandler>();
|
||||
mInteractionHandler->Init();
|
||||
|
||||
|
|
@ -77,9 +73,6 @@ Power::Power()
|
|||
LOG(INFO) << "Initialize with EXPENSIVE_RENDERING on";
|
||||
HintManager::GetInstance()->DoHint("EXPENSIVE_RENDERING");
|
||||
}
|
||||
|
||||
// Now start to take powerhint
|
||||
LOG(INFO) << "PowerHAL ready to take hints, Adpf update rate: " << mAdpfRateNs;
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
||||
|
|
@ -205,7 +198,8 @@ ndk::ScopedAStatus Power::createHintSession(int32_t tgid, int32_t uid,
|
|||
const std::vector<int32_t> &threadIds,
|
||||
int64_t durationNanos,
|
||||
std::shared_ptr<IPowerHintSession> *_aidl_return) {
|
||||
if (mAdpfRateNs <= 0) {
|
||||
if (!HintManager::GetInstance()->GetAdpfProfile() ||
|
||||
HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs <= 0) {
|
||||
*_aidl_return = nullptr;
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
|
@ -215,14 +209,16 @@ ndk::ScopedAStatus Power::createHintSession(int32_t tgid, int32_t uid,
|
|||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
std::shared_ptr<IPowerHintSession> session = ndk::SharedRefBase::make<PowerHintSession>(
|
||||
tgid, uid, threadIds, durationNanos, nanoseconds(mAdpfRateNs));
|
||||
tgid, uid, threadIds, durationNanos);
|
||||
*_aidl_return = session;
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus Power::getHintSessionPreferredRate(int64_t *outNanoseconds) {
|
||||
*outNanoseconds = mAdpfRateNs;
|
||||
if (mAdpfRateNs <= 0) {
|
||||
*outNanoseconds = HintManager::GetInstance()->GetAdpfProfile()
|
||||
? HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs
|
||||
: 0;
|
||||
if (*outNanoseconds <= 0) {
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue