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

Commit 63bd9936 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Handle defer transactions on a detached layer

If a defer transaction is applied on a detached layer, the barrier layer
cannot dequeue its buffer since it incorrectly waits for the detached
layer to commit its dependent pending states. When a layer is detached
we remove all remove sync points. This fix ensures that an already
detached layer does not add any pending states or sync points.

Test: atest SurfaceFlinger_test:DetachChildren#DeferredTransactionOnDetachedChildren
Fixes: 150924737

Change-Id: Iefe4248b1c2f4273d07a0324697a82d0fe9c5e52
(cherry picked from commit edbe6d26)
parent ec3b36a4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1445,6 +1445,13 @@ Layer::FrameRate Layer::getFrameRateForLayerTree() const {

void Layer::deferTransactionUntil_legacy(const sp<Layer>& barrierLayer, uint64_t frameNumber) {
    ATRACE_CALL();
    if (mLayerDetached) {
        // If the layer is detached, then we don't defer this transaction since we will not
        // commit the pending state while the layer is detached. Adding sync points may cause
        // the barrier layer to wait for the states to be committed before dequeuing a buffer.
        return;
    }

    mCurrentState.barrierLayer_legacy = barrierLayer;
    mCurrentState.frameNumber_legacy = frameNumber;
    // We don't set eTransactionNeeded, because just receiving a deferral