Create present timestamp offset for SF

Change-Id: Ic6435cca06739f749c6041c0925ca235dcc7f51e
This commit is contained in:
Fabien Sanglard
2017-03-14 13:16:30 -07:00
parent dc314a30ee
commit 8d7e31ee6a
4 changed files with 22 additions and 0 deletions

View File

@@ -70,4 +70,10 @@ interface ISurfaceFlingerConfigs {
* TARGET_HAS_HDR_DISPLAY to true in BoardConfig.mk
*/
hasHDRDisplay() generates (OptionalBool value);
/*
* Specify the offset in nanoseconds to add to vsync time when timestamping
* present fences.
*/
presentTimeOffsetFromVSyncNs() generates(OptionalInt64 value);
};

View File

@@ -69,6 +69,16 @@ Return<void> SurfaceFlingerConfigs::hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) {
return Void();
}
Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
#ifdef PRESENT_TIME_OFFSET_FROM_VSYNC_NS
_hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
LOG(INFO) << "SurfaceFlinger presentTimeStampOffsetNs = " << PRESENT_TIME_OFFSET_FROM_VSYNC_NS;
#else
_hidl_cb({false, 0});
#endif
return Void();
}
// Methods from ::android::hidl::base::V1_0::IBase follow.
ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* /* name */) {

View File

@@ -30,6 +30,7 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
Return<void> useContextPriority(useContextPriority_cb _hidl_cb) override;
Return<void> hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) override;
Return<void> hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) override;
Return<void> presentTimeOffsetFromVSyncNs(presentTimeOffsetFromVSyncNs_cb _hidl_cb) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.

View File

@@ -29,3 +29,8 @@ ifeq ($(TARGET_HAS_HDR_DISPLAY),true)
LOCAL_CFLAGS += -DHAS_HDR_DISPLAY
endif
ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
else
LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
endif