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

Commit 0889c62c authored by Valerie Hau's avatar Valerie Hau
Browse files

Set timeout on dequeue buffer for BLAST Adapter

BufferQueue may not block if the queue consumer and producer
are controlled by the app. setting the timeout explicitly to prevent
this from happening

Bug: 146345307
Test: build, boot, libgui_test, manual
Change-Id: I5e580b1c45288b48c922a3e312c0d98e40808803
parent e78aa72a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ BLASTBufferQueue::BLASTBufferQueue(const sp<SurfaceControl>& surface, int width,
        mHeight(height),
        mNextTransaction(nullptr) {
    BufferQueue::createBufferQueue(&mProducer, &mConsumer);
    // since the adapter is in the client process, set dequeue timeout
    // explicitly so that dequeueBuffer will block
    mProducer->setDequeueTimeout(std::numeric_limits<int64_t>::max());

    int8_t disableTripleBuffer = property_get_bool("ro.sf.disable_triple_buffer", 0);
    if (!disableTripleBuffer) {