eglGetFrameTimestamps: Consider timestamps of 0 as invalid.
authorBrian Anderson <brianderson@google.com>
Thu, 19 Oct 2017 21:59:28 +0000 (14:59 -0700)
committerBrian Anderson <brianderson@google.com>
Fri, 3 Nov 2017 21:38:03 +0000 (14:38 -0700)
There's a bug in the kernel that doesn't merge fences properly,
resulting in "reads done" timestamps of 0 when the fences being
merged have already signaled.

This is a temporary relaxation of the test requirements until
the kernel fix is required.

Bug: 68811985
Test: --deqp-case=dEQP-EGL*get_frame_timestamps*
Change-Id: I5f7e56e3a0c9808237a1ebc3787cf788feef1a79

modules/egl/teglGetFrameTimestampsTests.cpp

index d65d8d3..f3963bb 100644 (file)
@@ -194,7 +194,8 @@ void populateFrameTimes(FrameTimes* frameTimes, TimestampInfoMap& map, const std
 
 bool timestampValid (EGLnsecsANDROID timestamp)
 {
-       return (timestamp >= 0) || (timestamp == EGL_TIMESTAMP_PENDING_ANDROID);
+       // \todo [2017-10-19 brianderson] Don't consider 0 invalid once kernel fix is in.
+       return (timestamp > 0) || (timestamp == EGL_TIMESTAMP_PENDING_ANDROID);
 }
 
 bool timestampPending (EGLnsecsANDROID timestamp)
@@ -241,7 +242,7 @@ void verifySingleFrame (const FrameTimes& frameTimes, tcu::ResultCollector& resu
        // be sure that the readsDone time must be after the renderingComplete time.
     // It may also be equal to the renderingComplete time if no reads were
     // peformed.
-       if (verifyReadsDone)
+       if (verifyReadsDone && timestampValid(frameTimes.readsDone))
                check_le(result, frameTimes.renderingComplete, frameTimes.readsDone, "Buffer rendering completed after reads completed.");
 
        // Verify CPU/GPU dependencies