Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50e9beaa authored by Vishnu Nair's avatar Vishnu Nair
Browse files

BBQ: Log if producer disconnect was expected but not called

Fixes an issue introduced after rebasing.

Change-Id: I56a1ea9c39e6bde209c4e7d36f7d8e9f95079b02
Test: atest BLASTBufferQueueTest
Bug: 197269223
parent 7d93c575
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -621,12 +621,6 @@ void BLASTBufferQueue::acquireAndReleaseBuffer() {

void BLASTBufferQueue::flushAndWaitForFreeBuffer(std::unique_lock<std::mutex>& lock) {
    if (mWaitForTransactionCallback && mNumFrameAvailable > 0) {
        if ((mSurfaceControlSwapCount > mProducerDisconnectCount) && mLogScSwap) {
            BQA_LOGD("Expected producer disconnect sc swap count=%d bq disconnect count=%d",
                     mSurfaceControlSwapCount, mProducerDisconnectCount);
            mLogScSwap = false;
        }

        // We are waiting on a previous sync's transaction callback so allow another sync
        // transaction to proceed.
        //
@@ -653,6 +647,11 @@ void BLASTBufferQueue::flushAndWaitForFreeBuffer(std::unique_lock<std::mutex>& l
void BLASTBufferQueue::onFrameAvailable(const BufferItem& item) {
    ATRACE_CALL();
    std::unique_lock _lock{mMutex};
    if ((mSurfaceControlSwapCount > mProducerDisconnectCount) && mLogScSwap) {
        BQA_LOGD("Expected producer disconnect sc swap count=%d bq disconnect count=%d",
                    mSurfaceControlSwapCount, mProducerDisconnectCount);
        mLogScSwap = false;
    }

    const bool syncTransactionSet = mSyncTransaction != nullptr;
    BQA_LOGV("onFrameAvailable-start syncTransactionSet=%s", boolToString(syncTransactionSet));