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

Commit b2435af9 authored by Su Hong Koo's avatar Su Hong Koo Committed by Android (Google) Code Review
Browse files

Merge "SF: Fix unit tests for force_slower_follower_gpu_composition" into main

parents aa5f85e8 6ce87e45
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -504,6 +504,12 @@ struct CompositionEnginePostCompositionTest : public CompositionEngineTest {
};
};


TEST_F(CompositionEnginePostCompositionTest, postCompositionReleasesAllFences) {
TEST_F(CompositionEnginePostCompositionTest, postCompositionReleasesAllFences) {
    if (FlagManager::getInstance().force_slower_follower_gpu_composition()) {
        // No point in sending a real fence since Fence::merge() will clobber it to a NO_FENCE
        // anyways.
        EXPECT_CALL(*mLayer3FE, getAndClearLastClientTargetAcquireFence())
                .WillOnce(Return(Fence::NO_FENCE));
    }
    EXPECT_CALL(*mLayer1FE, getReleaseFencePromiseStatus)
    EXPECT_CALL(*mLayer1FE, getReleaseFencePromiseStatus)
            .WillOnce(Return(LayerFE::ReleaseFencePromiseStatus::FULFILLED));
            .WillOnce(Return(LayerFE::ReleaseFencePromiseStatus::FULFILLED));
    EXPECT_CALL(*mLayer2FE, getReleaseFencePromiseStatus)
    EXPECT_CALL(*mLayer2FE, getReleaseFencePromiseStatus)
+7 −0
Original line number Original line Diff line number Diff line
@@ -3409,6 +3409,13 @@ TEST_F(OutputPostFramebufferTest, ifEnabledMustFlipThenPresentThenSendPresentCom
}
}


TEST_F(OutputPostFramebufferTest, releaseFencesAreSetInLayerFE) {
TEST_F(OutputPostFramebufferTest, releaseFencesAreSetInLayerFE) {
    // Fence::merge() always happens with this flag on, which returns a different Fence instance
    // even if one of the fence is a NO_FENCE. The checks in this test is for the specific instance.
    // Therefore, disable the flag and re-write it with a looser check when we clean up the flag.
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::
                              force_slower_follower_gpu_composition,
                      false);

    // Simulate getting release fences from each layer, and ensure they are passed to the
    // Simulate getting release fences from each layer, and ensure they are passed to the
    // front-end layer interface for each layer correctly.
    // front-end layer interface for each layer correctly.
    mOutput.mState.isEnabled = true;
    mOutput.mState.isEnabled = true;