summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Jaesoo Lee <jaesoo@google.com> 2017-02-16 05:27:03 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-02-16 05:27:04 +0000
commit125c3ae33e284b09dede27a7e01b0b51d0653227 (patch)
tree72ea8f979d9b4eb63a8af42f293781ac41e95c48 /services/surfaceflinger/SurfaceFlinger.cpp
parent6bd7143ec726bb17ea6858836be7a59ea22d5354 (diff)
parent720a72479292406b821cbb17b93e6e1659ce0c3e (diff)
Merge changes from topic 'cfg_nsfbuf'
* changes: configstore: removing BoardConfig variables (NUM_FRAMEBUFFER_SURFACE_BUFFERS) configstore: use utility functions defined in ConfigStoreUtils.h
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index d2dddba27d..c21c81676b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -87,6 +87,7 @@
#include <cutils/compiler.h>
#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
+#include <configstore/Utils.h>
#define DISPLAY_COUNT 1
@@ -100,22 +101,9 @@ EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint na
namespace android {
+using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
-static sp<ISurfaceFlingerConfigs> getConfigs() {
- static sp<ISurfaceFlingerConfigs> configs
- = ISurfaceFlingerConfigs::getService();
- return configs;
-}
-
-static int64_t getVsyncEventPhaseOffsetNs() {
- int64_t ret = 1000000; // default value
- getConfigs()->vsyncEventPhaseOffsetNs([&](OptionalInt64 value) {
- if (value.specified) ret = value.value;
- });
- return ret;
-}
-
// This is the phase offset in nanoseconds of the software vsync event
// relative to the vsync event reported by HWComposer. The software vsync
// event is when SurfaceFlinger and Choreographer-based applications run each
@@ -136,7 +124,9 @@ static int64_t getVsyncEventPhaseOffsetNs() {
// the latency will end up being an additional vsync period, and animations
// will hiccup. Therefore, this latency should be tuned somewhat
// conservatively (or at least with awareness of the trade-off being made).
-static int64_t vsyncPhaseOffsetNs = getVsyncEventPhaseOffsetNs();
+static int64_t vsyncPhaseOffsetNs = getInt64<
+ ISurfaceFlingerConfigs,
+ &ISurfaceFlingerConfigs::vsyncEventPhaseOffsetNs>(1000000);
// This is the phase offset at which SurfaceFlinger's composition runs.
static constexpr int64_t sfVsyncPhaseOffsetNs = SF_VSYNC_EVENT_PHASE_OFFSET_NS;