From a17ddacd506e14b76e146abe67b7c3aad3f1aa4f Mon Sep 17 00:00:00 2001 From: Michael Benedict Date: Fri, 14 Jan 2022 01:09:21 +0700 Subject: [PATCH] aidl: power: Remove Lineage perf profiles remnants Change-Id: Id57c582c1d3619d1231890f5a20f1c899a6a6a67 --- aidl/power-libperfmgr/Power.cpp | 65 +-------------------------------- aidl/power-libperfmgr/Power.h | 11 ------ 2 files changed, 1 insertion(+), 75 deletions(-) diff --git a/aidl/power-libperfmgr/Power.cpp b/aidl/power-libperfmgr/Power.cpp index 7e51945a..b7a51d9f 100644 --- a/aidl/power-libperfmgr/Power.cpp +++ b/aidl/power-libperfmgr/Power.cpp @@ -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 hm) : mHintManager(hm), mInteractionHandler(nullptr), mVRModeOn(false), - mSustainedPerfModeOn(false), - mCurrentPerfProfile(PowerProfile::BALANCED) { + mSustainedPerfModeOn(false) { mInteractionHandler = std::make_unique(mHintManager); mInteractionHandler->Init(); @@ -81,21 +79,6 @@ Power::Power(std::shared_ptr 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); diff --git a/aidl/power-libperfmgr/Power.h b/aidl/power-libperfmgr/Power.h index 3d76fa71..932c76ad 100644 --- a/aidl/power-libperfmgr/Power.h +++ b/aidl/power-libperfmgr/Power.h @@ -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 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 mInteractionHandler; std::atomic mVRModeOn; std::atomic mSustainedPerfModeOn; - std::atomic mCurrentPerfProfile; }; } // namespace pixel