summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCallbackInvoker.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2021-02-22 14:35:15 -0800
committer Vishnu Nair <vishnun@google.com> 2021-03-17 15:58:29 +0000
commit1506b181085e1f2156283d0e7b62fe94a918427f (patch)
treee712ebf2d2f90c5c76600b29f9637ddb1955573d /services/surfaceflinger/TransactionCallbackInvoker.cpp
parent3fabf687ee63461d1aad186ae540156aa7765b25 (diff)
Introduce release buffer callback for BufferStateLayer
Currently BLAST clients use the TransactionCompleted callbacks to determine when to release buffers. The TransactionCompleted callback is overloaded. For transactions without buffers, the callback is called when the transaction is applied on the server. If the Transaction contains one or more buffers, the callback is called when all the buffers are latched and ready to be presented. If we have multiple buffers on multiple transactions, where one or more buffers maybe dropped, the pending callbacks are called together. This may delay signaling the client when a buffer can be released. To fix this, we introduce a new buffer release callback that is called as soon as a buffer is dropped by the server or when a new buffer has been latched and the buffer will no longer be presented. This new callback provides a graphic bufferid to identify the buffer that can be released and a release fence to wait on. BlastBufferQueue has been switched to use this new callback. Other BLAST users continue to use the existing callback. Test: go/wm-smoke Test: atest ReleaseBufferCallbackTest Bug: 178385281 Change-Id: Idd88e4994e543443198a5a8cfa0e3f5f67d5d482
Diffstat (limited to 'services/surfaceflinger/TransactionCallbackInvoker.cpp')
-rw-r--r--services/surfaceflinger/TransactionCallbackInvoker.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/TransactionCallbackInvoker.cpp b/services/surfaceflinger/TransactionCallbackInvoker.cpp
index a78510e902..3590e76cb9 100644
--- a/services/surfaceflinger/TransactionCallbackInvoker.cpp
+++ b/services/surfaceflinger/TransactionCallbackInvoker.cpp
@@ -201,7 +201,8 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
handle->dequeueReadyTime);
transactionStats->surfaceStats.emplace_back(surfaceControl, handle->acquireTime,
handle->previousReleaseFence,
- handle->transformHint, eventStats, jankData);
+ handle->transformHint, eventStats, jankData,
+ handle->previousBufferId);
}
return NO_ERROR;
}