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

Commit de19a7e6 authored by Marissa Wall's avatar Marissa Wall Committed by Marissa Ikonomidis
Browse files

gralloc4-vts: don't wait on invalid sync fence

Sync fences can be invalid if the buffer is already ready. If the
fence is invalid, we do not need to wait.

Test: VtsHalGraphicsMapperV4_0
Bug: 150213134

Change-Id: I8326d5f8b358c466ee9a686fd299daed1d4b4aa8
parent bfefeddf
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -725,8 +725,10 @@ TEST_P(GraphicsMapperHidlTest, FlushRereadBasic) {


    int fence;
    int fence;
    ASSERT_NO_FATAL_FAILURE(fence = mGralloc->flushLockedBuffer(writeBufferHandle));
    ASSERT_NO_FATAL_FAILURE(fence = mGralloc->flushLockedBuffer(writeBufferHandle));
    if (fence >= 0) {
        ASSERT_EQ(0, sync_wait(fence, 3500));
        ASSERT_EQ(0, sync_wait(fence, 3500));
        close(fence);
        close(fence);
    }


    ASSERT_NO_FATAL_FAILURE(mGralloc->rereadLockedBuffer(readBufferHandle));
    ASSERT_NO_FATAL_FAILURE(mGralloc->rereadLockedBuffer(readBufferHandle));