Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f83570cb authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

SF: Fix threshold for next VSYNC

If debug.sf.phase_offset_threshold_for_next_vsync_ns is not set, the
threshold is set to the maximum nsecs_t value. A narrowing conversion
caused the value to overflow to -1, leading to garbage phase offsets.

Bug: 138813900
Bug: 139284671
Bug: 138942712
Test: dumpsys SurfaceFlinger --vsync
Test: atest google/perf/app-transition/app-transition-cold
Change-Id: Ib7f732be95d16d29f4a71602b56795bee09be37b
parent 13db07b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@


namespace {
namespace {


std::optional<int> getProperty(const char* name) {
std::optional<nsecs_t> getProperty(const char* name) {
    char value[PROPERTY_VALUE_MAX];
    char value[PROPERTY_VALUE_MAX];
    property_get(name, value, "-1");
    property_get(name, value, "-1");
    if (const int i = atoi(value); i != -1) return i;
    if (const int i = atoi(value); i != -1) return i;