Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d7e31ee authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Create present timestamp offset for SF

Change-Id: Ic6435cca06739f749c6041c0925ca235dcc7f51e
parent dc314a30
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);
};
+10 −0
Original line number Diff line number Diff line
@@ -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 */) {
+1 −0
Original line number Diff line number Diff line
@@ -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.

+5 −0
Original line number Diff line number Diff line
@@ -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