summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DispSync.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-09-11 14:58:45 -0700
committerLajos Molnar <lajos@google.com>2014-09-18 17:03:20 -0700
commit67d8bd66aaf04805cb8f2616ba964141b865e3b9 (patch)
treedd9b895d2b143726b92abe10f3634dde28f4e49b /services/surfaceflinger/DispSync.cpp
parent5bbf73ced30c168176fbcf87b15021ecca2fb90e (diff)
downloadframeworks_native-67d8bd66aaf04805cb8f2616ba964141b865e3b9.zip
frameworks_native-67d8bd66aaf04805cb8f2616ba964141b865e3b9.tar.gz
frameworks_native-67d8bd66aaf04805cb8f2616ba964141b865e3b9.tar.bz2
surfaceflinger: add getDisplayStats() method
This is used by media service to schedule video frames at the proper time, based on precise vsync timings. Bug: 14659809 Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
Diffstat (limited to 'services/surfaceflinger/DispSync.cpp')
-rw-r--r--services/surfaceflinger/DispSync.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp
index 12da9a5..3738a55 100644
--- a/services/surfaceflinger/DispSync.cpp
+++ b/services/surfaceflinger/DispSync.cpp
@@ -408,6 +408,12 @@ void DispSync::setPeriod(nsecs_t period) {
mThread->updateModel(mPeriod, mPhase);
}
+nsecs_t DispSync::getPeriod() {
+ // lock mutex as mPeriod changes multiple times in updateModelLocked
+ Mutex::Autolock lock(mMutex);
+ return mPeriod;
+}
+
void DispSync::updateModelLocked() {
if (mNumResyncSamples >= MIN_RESYNC_SAMPLES_FOR_UPDATE) {
nsecs_t durationSum = 0;