sm6375-common: power-libperfmgr: remove Google-specific VR and camera hints
Change-Id: Iac0e65a16f660583d3400a35622113d35d8d1d27
This commit is contained in:
parent
db71b88a0b
commit
5e8377d9b9
2 changed files with 7 additions and 61 deletions
|
@ -44,7 +44,6 @@ constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering";
|
||||||
Power::Power(std::shared_ptr<HintManager> hm)
|
Power::Power(std::shared_ptr<HintManager> hm)
|
||||||
: mHintManager(hm),
|
: mHintManager(hm),
|
||||||
mInteractionHandler(nullptr),
|
mInteractionHandler(nullptr),
|
||||||
mVRModeOn(false),
|
|
||||||
mSustainedPerfModeOn(false) {
|
mSustainedPerfModeOn(false) {
|
||||||
mInteractionHandler = std::make_unique<InteractionHandler>(mHintManager);
|
mInteractionHandler = std::make_unique<InteractionHandler>(mHintManager);
|
||||||
mInteractionHandler->Init();
|
mInteractionHandler->Init();
|
||||||
|
@ -54,15 +53,6 @@ Power::Power(std::shared_ptr<HintManager> hm)
|
||||||
ALOGI("Initialize with SUSTAINED_PERFORMANCE on");
|
ALOGI("Initialize with SUSTAINED_PERFORMANCE on");
|
||||||
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
||||||
mSustainedPerfModeOn = true;
|
mSustainedPerfModeOn = true;
|
||||||
} else if (state == "VR") {
|
|
||||||
ALOGI("Initialize with VR on");
|
|
||||||
mHintManager->DoHint(state);
|
|
||||||
mVRModeOn = true;
|
|
||||||
} else if (state == "VR_SUSTAINED_PERFORMANCE") {
|
|
||||||
ALOGI("Initialize with SUSTAINED_PERFORMANCE and VR on");
|
|
||||||
mHintManager->DoHint("VR_SUSTAINED_PERFORMANCE");
|
|
||||||
mSustainedPerfModeOn = true;
|
|
||||||
mVRModeOn = true;
|
|
||||||
} else {
|
} else {
|
||||||
ALOGI("Initialize PowerHAL");
|
ALOGI("Initialize PowerHAL");
|
||||||
}
|
}
|
||||||
|
@ -88,43 +78,13 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
||||||
ATRACE_INT(toString(type).c_str(), enabled);
|
ATRACE_INT(toString(type).c_str(), enabled);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Mode::SUSTAINED_PERFORMANCE:
|
case Mode::SUSTAINED_PERFORMANCE:
|
||||||
if (enabled && !mSustainedPerfModeOn) {
|
if (enabled) {
|
||||||
if (!mVRModeOn) { // Sustained mode only.
|
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
||||||
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
|
||||||
} else { // Sustained + VR mode.
|
|
||||||
mHintManager->EndHint("VR");
|
|
||||||
mHintManager->DoHint("VR_SUSTAINED_PERFORMANCE");
|
|
||||||
}
|
|
||||||
mSustainedPerfModeOn = true;
|
|
||||||
} else if (!enabled && mSustainedPerfModeOn) {
|
|
||||||
mHintManager->EndHint("VR_SUSTAINED_PERFORMANCE");
|
|
||||||
mHintManager->EndHint("SUSTAINED_PERFORMANCE");
|
|
||||||
if (mVRModeOn) { // Switch back to VR Mode.
|
|
||||||
mHintManager->DoHint("VR");
|
|
||||||
}
|
|
||||||
mSustainedPerfModeOn = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Mode::VR:
|
|
||||||
if (enabled && !mVRModeOn) {
|
|
||||||
if (!mSustainedPerfModeOn) { // VR mode only.
|
|
||||||
mHintManager->DoHint("VR");
|
|
||||||
} else { // Sustained + VR mode.
|
|
||||||
mHintManager->EndHint("SUSTAINED_PERFORMANCE");
|
|
||||||
mHintManager->DoHint("VR_SUSTAINED_PERFORMANCE");
|
|
||||||
}
|
|
||||||
mVRModeOn = true;
|
|
||||||
} else if (!enabled && mVRModeOn) {
|
|
||||||
mHintManager->EndHint("VR_SUSTAINED_PERFORMANCE");
|
|
||||||
mHintManager->EndHint("VR");
|
|
||||||
if (mSustainedPerfModeOn) { // Switch back to sustained Mode.
|
|
||||||
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
|
||||||
}
|
|
||||||
mVRModeOn = false;
|
|
||||||
}
|
}
|
||||||
|
mSustainedPerfModeOn = true;
|
||||||
break;
|
break;
|
||||||
case Mode::LAUNCH:
|
case Mode::LAUNCH:
|
||||||
if (mVRModeOn || mSustainedPerfModeOn) {
|
if (mSustainedPerfModeOn) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
|
@ -142,14 +102,6 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Mode::AUDIO_STREAMING_LOW_LATENCY:
|
case Mode::AUDIO_STREAMING_LOW_LATENCY:
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Mode::CAMERA_STREAMING_SECURE:
|
|
||||||
[[fallthrough]];
|
|
||||||
case Mode::CAMERA_STREAMING_LOW:
|
|
||||||
[[fallthrough]];
|
|
||||||
case Mode::CAMERA_STREAMING_MID:
|
|
||||||
[[fallthrough]];
|
|
||||||
case Mode::CAMERA_STREAMING_HIGH:
|
|
||||||
[[fallthrough]];
|
|
||||||
default:
|
default:
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
mHintManager->DoHint(toString(type));
|
mHintManager->DoHint(toString(type));
|
||||||
|
@ -174,7 +126,7 @@ ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) {
|
||||||
ATRACE_INT(toString(type).c_str(), durationMs);
|
ATRACE_INT(toString(type).c_str(), durationMs);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Boost::INTERACTION:
|
case Boost::INTERACTION:
|
||||||
if (mVRModeOn || mSustainedPerfModeOn) {
|
if (mSustainedPerfModeOn) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mInteractionHandler->Acquire(durationMs);
|
mInteractionHandler->Acquire(durationMs);
|
||||||
|
@ -185,12 +137,8 @@ ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) {
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Boost::AUDIO_LAUNCH:
|
case Boost::AUDIO_LAUNCH:
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case Boost::CAMERA_LAUNCH:
|
|
||||||
[[fallthrough]];
|
|
||||||
case Boost::CAMERA_SHOT:
|
|
||||||
[[fallthrough]];
|
|
||||||
default:
|
default:
|
||||||
if (mVRModeOn || mSustainedPerfModeOn) {
|
if (mSustainedPerfModeOn) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (durationMs > 0) {
|
if (durationMs > 0) {
|
||||||
|
@ -220,9 +168,8 @@ constexpr const char *boolToString(bool b) {
|
||||||
binder_status_t Power::dump(int fd, const char **, uint32_t) {
|
binder_status_t Power::dump(int fd, const char **, uint32_t) {
|
||||||
std::string buf(::android::base::StringPrintf(
|
std::string buf(::android::base::StringPrintf(
|
||||||
"HintManager Running: %s\n"
|
"HintManager Running: %s\n"
|
||||||
"VRMode: %s\n"
|
|
||||||
"SustainedPerformanceMode: %s\n",
|
"SustainedPerformanceMode: %s\n",
|
||||||
boolToString(mHintManager->IsRunning()), boolToString(mVRModeOn),
|
boolToString(mHintManager->IsRunning()),
|
||||||
boolToString(mSustainedPerfModeOn)));
|
boolToString(mSustainedPerfModeOn)));
|
||||||
// Dump nodes through libperfmgr
|
// Dump nodes through libperfmgr
|
||||||
mHintManager->DumpToFd(fd);
|
mHintManager->DumpToFd(fd);
|
||||||
|
|
|
@ -49,7 +49,6 @@ class Power : public ::aidl::android::hardware::power::BnPower {
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<HintManager> mHintManager;
|
std::shared_ptr<HintManager> mHintManager;
|
||||||
std::unique_ptr<InteractionHandler> mInteractionHandler;
|
std::unique_ptr<InteractionHandler> mInteractionHandler;
|
||||||
std::atomic<bool> mVRModeOn;
|
|
||||||
std::atomic<bool> mSustainedPerfModeOn;
|
std::atomic<bool> mSustainedPerfModeOn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue