summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/BufferStateLayer.cpp
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2019-04-29 15:40:03 -0700
committer Ady Abraham <adyabr@google.com> 2019-04-30 13:09:06 -0700
commitcd1580cb3fe40e225000a56c9b4ee43c0ce0a45d (patch)
treed222bdfd4de314246784a6f02908bbd3e658ab16 /services/surfaceflinger/BufferStateLayer.cpp
parentdde87c4a326d0480aef0420f04c160b9d5d5096e (diff)
SurfaceFlinger: fix deferred transactions for buffers with timestamps
A deferred transaction needs to wait until the buffer is ready to be latched. This means that the buffer needs to be: 1. Done with rendering (fence has signaled) 2. Present timestamp is within the boundary of the next vsync Test: Screen rotation with Chrome Bug: 130785247 Change-Id: I8def1f10ea3d5c253ab14fa3aa4445588fc2ba8b
Diffstat (limited to 'services/surfaceflinger/BufferStateLayer.cpp')
-rw-r--r--services/surfaceflinger/BufferStateLayer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index dabc683aa9..30848d6eb5 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -374,6 +374,14 @@ bool BufferStateLayer::fenceHasSignaled() const {
return getDrawingState().acquireFence->getStatus() == Fence::Status::Signaled;
}
+bool BufferStateLayer::framePresentTimeIsCurrent() const {
+ if (!hasFrameUpdate() || isRemovedFromCurrentState()) {
+ return true;
+ }
+
+ return mDesiredPresentTime <= mFlinger->mScheduler->expectedPresentTime();
+}
+
nsecs_t BufferStateLayer::getDesiredPresentTime() {
return mDesiredPresentTime;
}