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

Commit 7cc3dd32 authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

Update sideband stream when layer has queued a buffer

Layer which is disconnected from the sideband stream
cannot display a queued frame. This CL updates the
sideband when a frame is queued.

Bug: 159511848
Test: m surfaceflinger
Test: run the test from b/159511848
Change-Id: Iec532d63880b218fba5f3ccc7056ca4d283f32c6
parent e147115f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -208,8 +208,14 @@ bool BufferQueueLayer::getSidebandStreamChanged() const {
}

bool BufferQueueLayer::latchSidebandStream(bool& recomputeVisibleRegions) {
    const bool updateSidebandStream = hasFrameUpdate() && mSidebandStream.get();
    ALOGV_IF(updateSidebandStream,
             "[%s] has both sideband stream and buffer. Updating the sideband stream.",
             mName.c_str());

    bool sidebandStreamChanged = true;
    if (mSidebandStreamChanged.compare_exchange_strong(sidebandStreamChanged, false)) {
    if (mSidebandStreamChanged.compare_exchange_strong(sidebandStreamChanged, false) ||
        updateSidebandStream) {
        // mSidebandStreamChanged was changed to false
        mSidebandStream = mConsumer->getSidebandStream();
        auto* layerCompositionState = editCompositionState();