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

Commit bfe1f35f authored by Pablo Ceballos's avatar Pablo Ceballos Committed by Android (Google) Code Review
Browse files

Merge "BQ: fix Volantis test failures"

parents a42832ef b687a281
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -113,14 +113,10 @@ public:
    // allow for the asynchronous behavior. If it is not enabled queue/dequeue
    // calls may block.
    //
    // This function should not be called when there are any currently dequeued
    // buffer slots, doing so will result in a BAD_VALUE error.
    //
    // Return of a value other than NO_ERROR means an error has occurred:
    // * NO_INIT - the buffer queue has been abandoned.
    // * BAD_VALUE - one of the below conditions occurred:
    //     * client has one or more buffers dequeued
    //     * this call would cause the maxBufferCount value to be exceeded
    // * BAD_VALUE - this call would cause the maxBufferCount value to be
    //               exceeded
    virtual status_t setAsyncMode(bool async) = 0;

    // dequeueBuffer requests a new buffer slot for the client to use. Ownership
+0 −8
Original line number Diff line number Diff line
@@ -159,14 +159,6 @@ status_t BufferQueueProducer::setAsyncMode(bool async) {
            return NO_INIT;
        }

        // There must be no dequeued buffers when changing the async mode.
        for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
            if (mSlots[s].mBufferState == BufferSlot::DEQUEUED) {
                BQ_LOGE("setAsyncMode: buffer owned by producer");
                return BAD_VALUE;
            }
        }

        if ((mCore->mMaxAcquiredBufferCount + mCore->mMaxDequeuedBufferCount +
                (async || mCore->mDequeueBufferCannotBlock ? 1 : 0)) >
                mCore->mMaxBufferCount) {
+0 −4
Original line number Diff line number Diff line
@@ -616,10 +616,6 @@ TEST_F(IGraphicBufferProducerTest, SetAsyncMode_Fails) {
                TEST_PRODUCER_USAGE_BITS))) << "slot: " << dequeuedSlot;
    }

    // Client has one or more buffers dequeued
    EXPECT_EQ(BAD_VALUE, mProducer->setAsyncMode(false)) << "asyncMode: "
            << false;

    // Abandon buffer queue
    ASSERT_OK(mConsumer->consumerDisconnect());

+10 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
        }
    };

    SetUpWindowAndContext();

    runProducerThread(new PT());

    mFC->waitForFrame();
@@ -50,6 +52,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
        }
    };

    SetUpWindowAndContext();

    runProducerThread(new PT());

    mFC->waitForFrame();
@@ -75,6 +79,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
        }
    };

    SetUpWindowAndContext();

    runProducerThread(new PT());

    for (int i = 0; i < NUM_ITERATIONS; i++) {
@@ -104,6 +110,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
        }
    };

    SetUpWindowAndContext();

    runProducerThread(new PT());

    for (int i = 0; i < NUM_ITERATIONS; i++) {
@@ -134,6 +142,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
        }
    };

    SetUpWindowAndContext();

    runProducerThread(new PT());

    // Allow three frames to be rendered and queued before starting the
+2 −0
Original line number Diff line number Diff line
@@ -34,7 +34,9 @@ protected:

    virtual void SetUp() {
        SurfaceTextureGLTest::SetUp();
    }

    void SetUpWindowAndContext() {
        mProducerEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig,
                mANW.get(), NULL);
        ASSERT_EQ(EGL_SUCCESS, eglGetError());
Loading