aidl: power: Remove Lineage perf profiles remnants

Change-Id: Id57c582c1d3619d1231890f5a20f1c899a6a6a67
tirimbino
Michael Benedict 3 years ago committed by Bruno Martins
parent 7ede54b6a3
commit a17ddacd50
  1. 65
      aidl/power-libperfmgr/Power.cpp
  2. 11
      aidl/power-libperfmgr/Power.h

@ -40,14 +40,12 @@ namespace pixel {
constexpr char kPowerHalStateProp[] = "vendor.powerhal.state";
constexpr char kPowerHalAudioProp[] = "vendor.powerhal.audio";
constexpr char kPowerHalRenderingProp[] = "vendor.powerhal.rendering";
constexpr char kPowerHalProfileProp[] = "vendor.powerhal.perf_profile";
Power::Power(std::shared_ptr<HintManager> hm)
: mHintManager(hm),
mInteractionHandler(nullptr),
mVRModeOn(false),
mSustainedPerfModeOn(false),
mCurrentPerfProfile(PowerProfile::BALANCED) {
mSustainedPerfModeOn(false) {
mInteractionHandler = std::make_unique<InteractionHandler>(mHintManager);
mInteractionHandler->Init();
@ -81,21 +79,6 @@ Power::Power(std::shared_ptr<HintManager> hm)
mHintManager->DoHint("EXPENSIVE_RENDERING");
}
state = ::android::base::GetProperty(kPowerHalProfileProp, "");
if (state == "POWER_SAVE") {
ALOGI("Initialize with POWER_SAVE profile");
setProfile(PowerProfile::POWER_SAVE);
} else if (state == "BIAS_POWER_SAVE") {
ALOGI("Initialize with BIAS_POWER_SAVE profile");
setProfile(PowerProfile::BIAS_POWER_SAVE);
} else if (state == "BIAS_PERFORMANCE") {
ALOGI("Initialize with BIAS_PERFORMANCE profile");
setProfile(PowerProfile::BIAS_PERFORMANCE);
} else if (state == "HIGH_PERFORMANCE") {
ALOGI("Initialize with HIGH_PERFORMANCE profile");
setProfile(PowerProfile::HIGH_PERFORMANCE);
}
// Now start to take powerhint
ALOGI("PowerHAL ready to process hints");
}
@ -207,52 +190,6 @@ ndk::ScopedAStatus Power::isModeSupported(Mode type, bool *_aidl_return) {
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Power::setProfile(PowerProfile profile) {
if (mCurrentPerfProfile == profile) {
return ndk::ScopedAStatus::ok();
}
// End previous perf profile hints
switch (mCurrentPerfProfile) {
case PowerProfile::POWER_SAVE:
mHintManager->EndHint("PROFILE_POWER_SAVE");
break;
case PowerProfile::BIAS_POWER_SAVE:
mHintManager->EndHint("PROFILE_BIAS_POWER_SAVE");
break;
case PowerProfile::BIAS_PERFORMANCE:
mHintManager->EndHint("PROFILE_BIAS_PERFORMANCE");
break;
case PowerProfile::HIGH_PERFORMANCE:
mHintManager->EndHint("PROFILE_HIGH_PERFORMANCE");
break;
default:
break;
}
// Apply perf profile hints
switch (profile) {
case PowerProfile::POWER_SAVE:
mHintManager->DoHint("PROFILE_POWER_SAVE");
break;
case PowerProfile::BIAS_POWER_SAVE:
mHintManager->DoHint("PROFILE_BIAS_POWER_SAVE");
break;
case PowerProfile::BIAS_PERFORMANCE:
mHintManager->DoHint("PROFILE_BIAS_PERFORMANCE");
break;
case PowerProfile::HIGH_PERFORMANCE:
mHintManager->DoHint("PROFILE_HIGH_PERFORMANCE");
break;
default:
break;
}
mCurrentPerfProfile = profile;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) {
LOG(DEBUG) << "Power setBoost: " << toString(type) << " duration: " << durationMs;
ATRACE_INT(toString(type).c_str(), durationMs);

@ -36,21 +36,11 @@ using ::aidl::android::hardware::power::Boost;
using ::aidl::android::hardware::power::Mode;
using ::android::perfmgr::HintManager;
enum PowerProfile {
POWER_SAVE = 0,
BALANCED,
HIGH_PERFORMANCE,
BIAS_POWER_SAVE,
BIAS_PERFORMANCE,
MAX
};
class Power : public ::aidl::android::hardware::power::BnPower {
public:
Power(std::shared_ptr<HintManager> hm);
ndk::ScopedAStatus setMode(Mode type, bool enabled) override;
ndk::ScopedAStatus isModeSupported(Mode type, bool *_aidl_return) override;
ndk::ScopedAStatus setProfile(PowerProfile profile);
ndk::ScopedAStatus setBoost(Boost type, int32_t durationMs) override;
ndk::ScopedAStatus isBoostSupported(Boost type, bool *_aidl_return) override;
binder_status_t dump(int fd, const char **args, uint32_t numArgs) override;
@ -60,7 +50,6 @@ class Power : public ::aidl::android::hardware::power::BnPower {
std::unique_ptr<InteractionHandler> mInteractionHandler;
std::atomic<bool> mVRModeOn;
std::atomic<bool> mSustainedPerfModeOn;
std::atomic<PowerProfile> mCurrentPerfProfile;
};
} // namespace pixel

Loading…
Cancel
Save