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

Commit acdc44bb authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "fix a bug when reallocating a window's buffers is needed" into kraken

parents 9a559970 57d89899
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -303,6 +303,7 @@ private:
            : mCapacity(c), mList(0) { }
            : mCapacity(c), mList(0) { }
        status_t add(int value);
        status_t add(int value);
        status_t remove(int value);
        status_t remove(int value);
        uint32_t getMask() const { return mList; }


        class const_iterator {
        class const_iterator {
            friend class BufferList;
            friend class BufferList;
+2 −2
Original line number Original line Diff line number Diff line
@@ -440,7 +440,7 @@ status_t SharedBufferClient::queue(int buf)
bool SharedBufferClient::needNewBuffer(int buf) const
bool SharedBufferClient::needNewBuffer(int buf) const
{
{
    SharedBufferStack& stack( *mSharedStack );
    SharedBufferStack& stack( *mSharedStack );
    const uint32_t mask = 1<<buf;
    const uint32_t mask = 1<<(31-buf);
    return (android_atomic_and(~mask, &stack.reallocMask) & mask) != 0;
    return (android_atomic_and(~mask, &stack.reallocMask) & mask) != 0;
}
}


@@ -532,7 +532,7 @@ status_t SharedBufferServer::reallocate()
    RWLock::AutoRLock _l(mLock);
    RWLock::AutoRLock _l(mLock);


    SharedBufferStack& stack( *mSharedStack );
    SharedBufferStack& stack( *mSharedStack );
    uint32_t mask = (1<<mNumBuffers)-1;
    uint32_t mask = mBufferList.getMask();
    android_atomic_or(mask, &stack.reallocMask); 
    android_atomic_or(mask, &stack.reallocMask); 
    return NO_ERROR;
    return NO_ERROR;
}
}