summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DispSync.h
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2014-04-25 16:58:34 -0700
committerAndy McFadden <fadden@android.com>2014-05-02 10:56:54 -0700
commit41d67d7ab4da1c393497a620a116a854b3c618e7 (patch)
tree82c09ea2fd772f1c8e0b527f8bb45948ab9b92d8 /services/surfaceflinger/DispSync.h
parentc526c35e7398ad06185ea0575a976933b433441d (diff)
downloadframeworks_native-41d67d7ab4da1c393497a620a116a854b3c618e7.zip
frameworks_native-41d67d7ab4da1c393497a620a116a854b3c618e7.tar.gz
frameworks_native-41d67d7ab4da1c393497a620a116a854b3c618e7.tar.bz2
Improve SurfaceFlinger PTS estimation
Get the next refresh time from DispSync instead of guessing based on the current time. Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
Diffstat (limited to 'services/surfaceflinger/DispSync.h')
-rw-r--r--services/surfaceflinger/DispSync.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/surfaceflinger/DispSync.h b/services/surfaceflinger/DispSync.h
index c2ae135..5826a78 100644
--- a/services/surfaceflinger/DispSync.h
+++ b/services/surfaceflinger/DispSync.h
@@ -83,7 +83,7 @@ public:
bool addResyncSample(nsecs_t timestamp);
void endResync();
- // The setPreiod method sets the vsync event model's period to a specific
+ // The setPeriod method sets the vsync event model's period to a specific
// value. This should be used to prime the model when a display is first
// turned on. It should NOT be used after that.
void setPeriod(nsecs_t period);
@@ -102,6 +102,12 @@ public:
// DispSync object.
status_t removeEventListener(const sp<Callback>& callback);
+ // computeNextRefresh computes when the next refresh is expected to begin.
+ // The periodOffset value can be used to move forward or backward; an
+ // offset of zero is the next refresh, -1 is the previous refresh, 1 is
+ // the refresh after next. etc.
+ nsecs_t computeNextRefresh(int periodOffset) const;
+
private:
void updateModelLocked();