From 76236e1ece625b02f0875697ee61a1f53d212626 Mon Sep 17 00:00:00 2001 From: Xiang Wang Date: Tue, 22 Mar 2022 17:25:30 +0000 Subject: Disable normalization for power hint by default Bug: 223647468 Test: manual test Change-Id: Ifc38718d712a1f191fea780e790afdd7703f2de6 --- .../DisplayHardware/PowerAdvisor.cpp | 4 ++-- services/surfaceflinger/SurfaceFlinger.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp index 3dab38975c..44c086d7d3 100644 --- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp +++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp @@ -542,7 +542,7 @@ private: static constexpr double kAllowedTargetDeviationPercent = 0.05; // Target used for init and normalization, the actual value does not really matter static constexpr const std::chrono::nanoseconds kDefaultTarget = 50ms; - // amount of time after the last message was sent before the session goes stale + // Amount of time after the last message was sent before the session goes stale // actually 100ms but we use 80 here to ideally avoid going stale static constexpr const std::chrono::nanoseconds kStaleTimeout = 80ms; }; @@ -551,7 +551,7 @@ const bool AidlPowerHalWrapper::sTraceHintSessionData = base::GetBoolProperty(std::string("debug.sf.trace_hint_sessions"), false); const bool AidlPowerHalWrapper::sNormalizeTarget = - base::GetBoolProperty(std::string("debug.sf.normalize_hint_session_durations"), true); + base::GetBoolProperty(std::string("debug.sf.normalize_hint_session_durations"), false); PowerAdvisor::HalWrapper* PowerAdvisor::getPowerHal() { static std::unique_ptr sHalWrapper = nullptr; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 2edc05bc08..89594f22cb 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -721,15 +721,15 @@ void SurfaceFlinger::bootFinished() { } readPersistentProperties(); - std::optional renderEngineTid = getRenderEngine().getRenderEngineTid(); - std::vector tidList; - tidList.emplace_back(gettid()); - if (renderEngineTid.has_value()) { - tidList.emplace_back(*renderEngineTid); - } mPowerAdvisor.onBootFinished(); mPowerAdvisor.enablePowerHint(mFlagManager->use_adpf_cpu_hint()); if (mPowerAdvisor.usePowerHintSession()) { + std::optional renderEngineTid = getRenderEngine().getRenderEngineTid(); + std::vector tidList; + tidList.emplace_back(gettid()); + if (renderEngineTid.has_value()) { + tidList.emplace_back(*renderEngineTid); + } mPowerAdvisor.startPowerHintSession(tidList); } @@ -3729,8 +3729,8 @@ int SurfaceFlinger::flushPendingTransactionQueues( break; } transaction.traverseStatesWithBuffers([&](const layer_state_t& state) { - const bool frameNumberChanged = - state.bufferData->flags.test(BufferData::BufferDataChange::frameNumberChanged); + const bool frameNumberChanged = state.bufferData->flags.test( + BufferData::BufferDataChange::frameNumberChanged); if (frameNumberChanged) { bufferLayersReadyToPresent[state.surface] = state.bufferData->frameNumber; } else { @@ -3810,8 +3810,8 @@ bool SurfaceFlinger::flushTransactionQueues(int64_t vsyncId) { mPendingTransactionQueues[transaction.applyToken].push(std::move(transaction)); } else { transaction.traverseStatesWithBuffers([&](const layer_state_t& state) { - const bool frameNumberChanged = - state.bufferData->flags.test(BufferData::BufferDataChange::frameNumberChanged); + const bool frameNumberChanged = state.bufferData->flags.test( + BufferData::BufferDataChange::frameNumberChanged); if (frameNumberChanged) { bufferLayersReadyToPresent[state.surface] = state.bufferData->frameNumber; } else { @@ -3820,7 +3820,7 @@ bool SurfaceFlinger::flushTransactionQueues(int64_t vsyncId) { bufferLayersReadyToPresent[state.surface] = std::numeric_limits::max(); } - }); + }); transactions.emplace_back(std::move(transaction)); } mTransactionQueue.pop_front(); -- cgit v1.2.3-59-g8ed1b