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

Commit 45e9e0b1 authored by Sungtak Lee's avatar Sungtak Lee
Browse files

Drop buffers for SurfaceFlinger properly

Drop buffers restrictively when consumer is SurfaceFlinger. When both
producer and consumer are controlled by app and timeout is not positive,
drop buffers for SurfaceFlinger.

Bug: 133214906
Change-Id: Ied102857673cbf36e51aac6abeea9abffbdcce67
parent b35167c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -886,7 +886,7 @@ status_t BufferQueueProducer::queueBuffer(int slot,
        item.mFence = acquireFence;
        item.mFenceTime = acquireFenceTime;
        item.mIsDroppable = mCore->mAsyncMode ||
                (!mCore->mLegacyBufferDrop && mConsumerIsSurfaceFlinger) ||
                (mConsumerIsSurfaceFlinger && mCore->mQueueBufferCanDrop) ||
                (mCore->mLegacyBufferDrop && mCore->mQueueBufferCanDrop) ||
                (mCore->mSharedBufferMode && mCore->mSharedBufferSlot == slot);
        item.mSurfaceDamage = surfaceDamage;
+2 −1
Original line number Diff line number Diff line
@@ -233,7 +233,8 @@ private:

    // mLegacyBufferDrop indicates whether mQueueBufferCanDrop is in effect.
    // If this flag is set mQueueBufferCanDrop is working as explained. If not
    // queueBuffer will not drop buffers unless consumer is SurfaceFlinger.
    // queueBuffer will not drop buffers unless consumer is SurfaceFlinger and
    // mQueueBufferCanDrop is set.
    bool mLegacyBufferDrop;

    // mDefaultBufferFormat can be set so it will override the buffer format