summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCallbackInvoker.cpp
diff options
context:
space:
mode:
author Sally Qi <sallyqi@google.com> 2023-01-03 11:11:25 -0800
committer Sally Qi <sallyqi@google.com> 2023-01-09 16:23:52 -0800
commit4b9e7c46bbf40a0888962cdeb65a81cea0000f43 (patch)
tree8b278f9565192726e86747ae3a330d474c3bc172 /services/surfaceflinger/TransactionCallbackInvoker.cpp
parentc567ddd4e3aab23fad6cb5b44c2ac962d71f09e9 (diff)
Fix flicker issue on external display.
Relnote: when primary and virtual display fences are already signaled while external one is still pending, external display fence should be overridden by merged fence of primary and virtual. Bug: 264002998 Test: atest libsurfaceflinger_unittest Change-Id: Ia1ac1fcc20cfd96d148c549c06777be387df1bde
Diffstat (limited to 'services/surfaceflinger/TransactionCallbackInvoker.cpp')
-rw-r--r--services/surfaceflinger/TransactionCallbackInvoker.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/surfaceflinger/TransactionCallbackInvoker.cpp b/services/surfaceflinger/TransactionCallbackInvoker.cpp
index e5de7591ef..3da98d4247 100644
--- a/services/surfaceflinger/TransactionCallbackInvoker.cpp
+++ b/services/surfaceflinger/TransactionCallbackInvoker.cpp
@@ -137,7 +137,6 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
sp<Fence> currentFence = future.get().value_or(Fence::NO_FENCE);
if (prevFence == nullptr && currentFence->getStatus() != Fence::Status::Invalid) {
prevFence = std::move(currentFence);
- handle->previousReleaseFence = prevFence;
} else if (prevFence != nullptr) {
// If both fences are signaled or both are unsignaled, we need to merge
// them to get an accurate timestamp.
@@ -147,8 +146,7 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
snprintf(fenceName, 32, "%.28s", handle->name.c_str());
sp<Fence> mergedFence = Fence::merge(fenceName, prevFence, currentFence);
if (mergedFence->isValid()) {
- handle->previousReleaseFence = std::move(mergedFence);
- prevFence = handle->previousReleaseFence;
+ prevFence = std::move(mergedFence);
}
} else if (currentFence->getStatus() == Fence::Status::Unsignaled) {
// If one fence has signaled and the other hasn't, the unsignaled
@@ -158,10 +156,11 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
// by this point, they will have both signaled and only the timestamp
// will be slightly off; any dependencies after this point will
// already have been met.
- handle->previousReleaseFence = std::move(currentFence);
+ prevFence = std::move(currentFence);
}
}
}
+ handle->previousReleaseFence = prevFence;
handle->previousReleaseFences.clear();
FrameEventHistoryStats eventStats(handle->frameNumber,