mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-03 12:07:58 +00:00
Create present timestamp offset for SF
Change-Id: Ic6435cca06739f749c6041c0925ca235dcc7f51e
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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 */) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user