summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2023-05-13 01:07:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-13 01:07:48 +0000
commit9e9933f21713872eb073c698e9bc4cde92af8f75 (patch)
treee0a6a25f2fdae980859d4565349f576a4df3f254
parent216dd8503bc6c96aed9ff3fde5b6d14828ffbe12 (diff)
parentafb6b50ee815108a6f5f290e1b3753069f3bd9d3 (diff)
Merge "Populate preferred frame timeline always" into udc-dev
-rw-r--r--services/surfaceflinger/Scheduler/EventThread.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp
index af9acf3346..281b0ae559 100644
--- a/services/surfaceflinger/Scheduler/EventThread.cpp
+++ b/services/surfaceflinger/Scheduler/EventThread.cpp
@@ -612,6 +612,15 @@ void EventThread::generateFrameTimeline(VsyncEventData& outVsyncEventData, nsecs
preferredExpectedPresentationTime + multiplier * frameInterval;
if (expectedPresentationTime >= preferredExpectedPresentationTime +
scheduler::VsyncConfig::kEarlyLatchMaxThreshold.count()) {
+ if (currentIndex == 0) {
+ ALOGW("%s: Expected present time is too far in the future but no timelines are "
+ "valid. preferred EPT=%" PRId64 ", Calculated EPT=%" PRId64
+ ", multiplier=%" PRId64 ", frameInterval=%" PRId64 ", threshold=%" PRId64,
+ __func__, preferredExpectedPresentationTime, expectedPresentationTime,
+ multiplier, frameInterval,
+ static_cast<int64_t>(
+ scheduler::VsyncConfig::kEarlyLatchMaxThreshold.count()));
+ }
break;
}
@@ -625,6 +634,20 @@ void EventThread::generateFrameTimeline(VsyncEventData& outVsyncEventData, nsecs
.expectedPresentationTime = expectedPresentationTime};
currentIndex++;
}
+
+ if (currentIndex == 0) {
+ ALOGW("%s: No timelines are valid. preferred EPT=%" PRId64 ", frameInterval=%" PRId64
+ ", threshold=%" PRId64,
+ __func__, preferredExpectedPresentationTime, frameInterval,
+ static_cast<int64_t>(scheduler::VsyncConfig::kEarlyLatchMaxThreshold.count()));
+ outVsyncEventData.frameTimelines[currentIndex] =
+ {.vsyncId = generateToken(timestamp, preferredDeadlineTimestamp,
+ preferredExpectedPresentationTime),
+ .deadlineTimestamp = preferredDeadlineTimestamp,
+ .expectedPresentationTime = preferredExpectedPresentationTime};
+ currentIndex++;
+ }
+
outVsyncEventData.frameTimelinesLength = currentIndex;
}