Skip to content

Commit

Permalink
SF: Scheduler: relax measurements for heuristic mode
Browse files Browse the repository at this point in the history
30 frames for 300ms is quite enough for approximated calculation.

As an added bonus, the device reacts quicker when a higher refresh rate
should be used.

Change-Id: Id8930ab7343cc4e974b78929615e6efdd1c2b27e
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
  • Loading branch information
arter97 authored and neobuddy89 committed Jun 12, 2022
1 parent 8e4937b commit 3555399
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/surfaceflinger/Scheduler/LayerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class LayerInfo {
// the refresh rate calculated is consistent with past values
class RefreshRateHistory {
public:
static constexpr auto HISTORY_SIZE = 90;
static constexpr std::chrono::nanoseconds HISTORY_DURATION = 2s;
static constexpr auto HISTORY_SIZE = 30;
static constexpr std::chrono::nanoseconds HISTORY_DURATION = 300ms;

RefreshRateHistory(const std::string& name) : mName(name) {}

Expand Down Expand Up @@ -253,7 +253,7 @@ class LayerInfo {
const std::string mName;
mutable std::optional<HeuristicTraceTagData> mHeuristicTraceTagData;
std::deque<RefreshRateData> mRefreshRates;
static constexpr float MARGIN_CONSISTENT_FPS = 1.0;
static constexpr float MARGIN_CONSISTENT_FPS = 5.0;
};

bool isFrequent(nsecs_t now) const;
Expand Down

0 comments on commit 3555399

Please sign in to comment.