aidl: power: Remove Lineage perf profiles remnants
authorMichael Benedict <michaelbt@live.com>
Thu, 13 Jan 2022 18:09:21 +0000 (01:09 +0700)
committerBruno Martins <bgcngm@gmail.com>
Thu, 13 Jan 2022 18:47:25 +0000 (19:47 +0100)
Change-Id: Id57c582c1d3619d1231890f5a20f1c899a6a6a67

aidl/power-libperfmgr/Power.cpp
aidl/power-libperfmgr/Power.h

index 7e51945a48a8575bd68d1a96d4da0310ff4ff1d6..b7a51d9fc89be0d4c875ede6c518873edabd39e6 100644 (file)
@@ -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);
index 3d76fa712b70b147b414d8546ae42e2e3e1bfcc0..932c76ad4394c667c487cc7b0722108085aeef75 100644 (file)
@@ -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