summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jesse Hall <jessehall@google.com> 2018-05-18 15:58:23 -0700
committer Jesse Hall <jessehall@google.com> 2018-05-18 15:58:23 -0700
commite158ca7e4afa05058fa5290f54f26363b3cee46c (patch)
treef94ab973d0fe42999d5616c5184e8613aa8eabd5
parent0f263e9d0a98765d21d084fc25a318ac0bad3530 (diff)
Fence: use modern sync info API
The old sync info API based on the legacy staging Android sync uapi is deprecated; stop using it here so it can eventually be removed. Bug: 35326015 Test: adb shell dumpsys SurfaceFlinger --latency Change-Id: Ida58adb0f0057485d3768b959697b4d583abd80b
-rw-r--r--libs/ui/Fence.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp
index ff53aa8f25..ed7ccb0bed 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -109,25 +109,25 @@ nsecs_t Fence::getSignalTime() const {
return SIGNAL_TIME_INVALID;
}
- struct sync_fence_info_data* finfo = sync_fence_info(mFenceFd);
+ struct sync_file_info* finfo = sync_file_info(mFenceFd);
if (finfo == NULL) {
- ALOGE("sync_fence_info returned NULL for fd %d", mFenceFd.get());
+ ALOGE("sync_file_info returned NULL for fd %d", mFenceFd.get());
return SIGNAL_TIME_INVALID;
}
if (finfo->status != 1) {
- sync_fence_info_free(finfo);
+ sync_file_info_free(finfo);
return SIGNAL_TIME_PENDING;
}
- struct sync_pt_info* pinfo = NULL;
uint64_t timestamp = 0;
- while ((pinfo = sync_pt_info(finfo, pinfo)) != NULL) {
- if (pinfo->timestamp_ns > timestamp) {
- timestamp = pinfo->timestamp_ns;
+ struct sync_fence_info* pinfo = sync_get_fence_info(finfo);
+ for (size_t i = 0; i < finfo->num_fences; i++) {
+ if (pinfo[i].timestamp_ns > timestamp) {
+ timestamp = pinfo[i].timestamp_ns;
}
}
- sync_fence_info_free(finfo);
+ sync_file_info_free(finfo);
return nsecs_t(timestamp);
}