[SF] Use presentTimeOffset from configStore
Change-Id: If9c872c565e68e8abe552ee11d2c7d48f44aec4b
diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp
index 86cf17d..d7654f1 100644
--- a/services/surfaceflinger/DispSync.cpp
+++ b/services/surfaceflinger/DispSync.cpp
@@ -33,6 +33,7 @@
#include <ui/Fence.h>
#include "DispSync.h"
+#include "SurfaceFlinger.h"
#include "EventLog/EventLog.h"
using std::max;
@@ -54,10 +55,6 @@
// present time and the nearest software-predicted vsync.
static const nsecs_t kErrorThreshold = 160000000000; // 400 usec squared
-// This is the offset from the present fence timestamps to the corresponding
-// vsync event.
-static const int64_t kPresentTimeOffset = PRESENT_TIME_OFFSET_FROM_VSYNC_NS;
-
#undef LOG_TAG
#define LOG_TAG "DispSyncThread"
class DispSyncThread: public Thread {
@@ -381,6 +378,7 @@
mRefreshSkipCount(0),
mThread(new DispSyncThread(name)) {
+ mPresentTimeOffset = SurfaceFlinger::dispSyncPresentTimeOffset;
mThread->run("DispSync", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
// set DispSync to SCHED_FIFO to minimize jitter
struct sched_param param = {0};
@@ -433,7 +431,7 @@
nsecs_t t = f->getSignalTime();
if (t < INT64_MAX) {
mPresentFences[i].clear();
- mPresentTimes[i] = t + kPresentTimeOffset;
+ mPresentTimes[i] = t + mPresentTimeOffset;
}
}
}