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

Commit 438b8692 authored by Pablo Ceballos's avatar Pablo Ceballos Committed by android-build-merger
Browse files

Merge "BQ: Don\'t return fences from dequeue in shared buffer mode" into...

Merge "BQ: Don\'t return fences from dequeue in shared buffer mode" into nyc-dev am: eb6377eb am: 907e94d3
am: d1059865

* commit 'd1059865':
  BQ: Don't return fences from dequeue in shared buffer mode

Change-Id: Iac1bc1d6323b3a79008f5434ae21f8f7f2dc95b5
parents 2f65a538 d1059865
Loading
Loading
Loading
Loading
+13 −9
Original line number Original line Diff line number Diff line
@@ -444,14 +444,6 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,


        mSlots[found].mBufferState.dequeue();
        mSlots[found].mBufferState.dequeue();


        // If shared buffer mode has just been enabled, cache the slot of the
        // first buffer that is dequeued and mark it as the shared buffer.
        if (mCore->mSharedBufferMode && mCore->mSharedBufferSlot ==
                BufferQueueCore::INVALID_BUFFER_SLOT) {
            mCore->mSharedBufferSlot = found;
            mSlots[found].mBufferState.mShared = true;
        }

        if ((buffer == NULL) ||
        if ((buffer == NULL) ||
                buffer->needsReallocation(width, height, format, usage))
                buffer->needsReallocation(width, height, format, usage))
        {
        {
@@ -483,9 +475,21 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,


        eglDisplay = mSlots[found].mEglDisplay;
        eglDisplay = mSlots[found].mEglDisplay;
        eglFence = mSlots[found].mEglFence;
        eglFence = mSlots[found].mEglFence;
        *outFence = mSlots[found].mFence;
        // Don't return a fence in shared buffer mode, except for the first
        // frame.
        *outFence = (mCore->mSharedBufferMode &&
                mCore->mSharedBufferSlot == found) ?
                Fence::NO_FENCE : mSlots[found].mFence;
        mSlots[found].mEglFence = EGL_NO_SYNC_KHR;
        mSlots[found].mEglFence = EGL_NO_SYNC_KHR;
        mSlots[found].mFence = Fence::NO_FENCE;
        mSlots[found].mFence = Fence::NO_FENCE;

        // If shared buffer mode has just been enabled, cache the slot of the
        // first buffer that is dequeued and mark it as the shared buffer.
        if (mCore->mSharedBufferMode && mCore->mSharedBufferSlot ==
                BufferQueueCore::INVALID_BUFFER_SLOT) {
            mCore->mSharedBufferSlot = found;
            mSlots[found].mBufferState.mShared = true;
        }
    } // Autolock scope
    } // Autolock scope


    if (returnFlags & BUFFER_NEEDS_REALLOCATION) {
    if (returnFlags & BUFFER_NEEDS_REALLOCATION) {