summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/BufferQueueLayer.cpp
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2019-02-07 15:28:54 -0800
committerRobert Carr <racarr@google.com>2019-02-14 15:41:49 -0800
commita062923432d7e283f26cba8d09d93d2200c9152d (patch)
tree156ae5e5ecf80fa1c88e37702134c3676f262212 /services/surfaceflinger/BufferQueueLayer.cpp
parentf6d3044c4db6d928a19007bd8ab056c6ee52b7b0 (diff)
downloadandroid_frameworks_native-a062923432d7e283f26cba8d09d93d2200c9152d.tar.gz
android_frameworks_native-a062923432d7e283f26cba8d09d93d2200c9152d.tar.bz2
android_frameworks_native-a062923432d7e283f26cba8d09d93d2200c9152d.zip
SurfaceFlinger: Rework buffer latching when removing from current state
When removed from current state we want to latch and release buffers independent of their present time as we may not get another chance later (once we are disconnected from the VSync pulse). Bug: 123284777 Test: Manual Change-Id: Ie46ff6199e6648ca9a15cf92048219715ffe26f4
Diffstat (limited to 'services/surfaceflinger/BufferQueueLayer.cpp')
-rw-r--r--services/surfaceflinger/BufferQueueLayer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index cdcbcd94f..5a60fcd30 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -237,10 +237,14 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t
getProducerStickyTransform() != 0, mName.string(), mOverrideScalingMode,
getTransformToDisplayInverse(), mFreezeGeometryUpdates);
- const nsecs_t expectedPresentTime = mFlinger->mUseScheduler
+ nsecs_t expectedPresentTime = mFlinger->mUseScheduler
? mFlinger->mScheduler->expectedPresentTime()
: mFlinger->mPrimaryDispSync->expectedPresentTime();
+ if (isRemovedFromCurrentState()) {
+ expectedPresentTime = 0;
+ }
+
// updateTexImage() below might drop the some buffers at the head of the queue if there is a
// buffer behind them which is timely to be presented. However this buffer may not be signaled
// yet. The code below makes sure that this wouldn't happen by setting maxFrameNumber to the
@@ -259,6 +263,7 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t
}
const uint64_t maxFrameNumberToAcquire =
std::min(mLastFrameNumberReceived.load(), lastSignaledFrameNumber);
+
status_t updateResult =
mConsumer->updateTexImage(&r, expectedPresentTime, &mAutoRefresh, &queuedBuffer,
maxFrameNumberToAcquire, releaseFence);