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

Commit 54e33aa7 authored by Jesse Hall's avatar Jesse Hall Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of 6f7ca9f1 to...

Merge "resolve merge conflicts of 6f7ca9f1 to pi-dev-plus-aosp" into pi-dev-plus-aosp
parents 296172fa f73567e4
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -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);
}