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

Commit cf1868c8 authored by Lloyd Pique's avatar Lloyd Pique
Browse files

SF: Remove a redundant write

The Layer compositionState structure was only intended to be updated
during the call from the LayerFE::prepareCompositionState() call, which
in turn calls preparePerFrameCompositionState().

Both BufferQueueLayer and BufferStateLayer were updating the buffer
entry in the composition state structure in updateActiveBuffer(), which
was redundant with an update of the buffer entry also being made there.

This *may* also have resulted in the StrongPointer code reporting a
write race, resulting in a reported bug.

Test: go/wm-smoke
Test: atest CtsColorModeTestCases
Test: atest CtsDisplayTestCases
Test: atest CtsGraphicsTestCases
Test: atest CtsUiRenderingTestCases
Test: atest CtsViewTestCases
Test: atest android.media.cts.EncodeVirtualDisplayWithCompositionTest
Bug: 149663608
Change-Id: I5b2fc552a92746adfe3693059dab315a573a4860
parent 14f49cd4
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -346,8 +346,6 @@ status_t BufferQueueLayer::updateActiveBuffer() {
    mPreviousBufferId = getCurrentBufferId();
    mBufferInfo.mBuffer =
            mConsumer->getCurrentBuffer(&mBufferInfo.mBufferSlot, &mBufferInfo.mFence);
    auto* layerCompositionState = editCompositionState();
    layerCompositionState->buffer = mBufferInfo.mBuffer;

    if (mBufferInfo.mBuffer == nullptr) {
        // this can only happen if the very first buffer was rejected.
+0 −1
Original line number Diff line number Diff line
@@ -616,7 +616,6 @@ status_t BufferStateLayer::updateActiveBuffer() {
    mPreviousBufferId = getCurrentBufferId();
    mBufferInfo.mBuffer = s.buffer;
    mBufferInfo.mFence = s.acquireFence;
    editCompositionState()->buffer = mBufferInfo.mBuffer;

    return NO_ERROR;
}