eglGetFrameTimestamps: Don't require reads done to be monotonic.
authorBrian Anderson <brianderson@google.com>
Fri, 9 Mar 2018 18:25:08 +0000 (10:25 -0800)
committerBrian Anderson <brianderson@google.com>
Fri, 9 Mar 2018 21:39:09 +0000 (13:39 -0800)
Reads done is usually monotonic, but only under the assumption
that every buffer of the surface is being consumed by the same
unit. It is possible for a surface to switch between being an
overlay and being composited by the GPU. It's also possible a
driver will maintain a shadow copy of a frame that will further
affect when reads from a buffer might finish.

Remove the overly strict check.

Bug: 7033485174184639
Test: --deqp-case=dEQP-EGL*get_frame_timestamps*
Change-Id: I8e242a9fd649720b4d8059797c71163329b7b92c

modules/egl/teglGetFrameTimestampsTests.cpp

index 09deb06..642262d 100644 (file)
@@ -253,7 +253,7 @@ void verifySingleFrame (const FrameTimes& frameTimes, tcu::ResultCollector& resu
                check_lt(result, frameTimes.firstCompositionStart, frameTimes.displayPresent, "Buffer displayed before it was composited.");
 }
 
-void verifyNeighboringFrames (const FrameTimes& frame1, const FrameTimes& frame2, tcu::ResultCollector& result, bool verifyReadsDone)
+void verifyNeighboringFrames (const FrameTimes& frame1, const FrameTimes& frame2, tcu::ResultCollector& result)
 {
        // CPU timeline.
        check_lt(result, frame1.swapBufferBeginNs, frame2.swapBufferBeginNs, "Swap begin times not monotonic.");
@@ -270,9 +270,6 @@ void verifyNeighboringFrames (const FrameTimes& frame1, const FrameTimes& frame2
 
        if (timestampValid(frame1.displayPresent) && timestampValid(frame2.displayPresent))
                check_lt(result, frame1.displayPresent, frame2.displayPresent, "Display present times not monotonic.");
-
-       if (verifyReadsDone && timestampValid(frame1.readsDone) && timestampValid(frame2.readsDone))
-               check_lt(result, frame1.readsDone, frame2.readsDone, "Reads done times not monotonic.");
 }
 
 EGLContext createGLES2Context (const Library& egl, EGLDisplay display, EGLConfig config)
@@ -675,7 +672,7 @@ void GetFrameTimestampTest::executeForConfig (EGLDisplay display, EGLConfig conf
                                if (i >= frameDelay + 1)
                                {
                                        FrameTimes& frame6ago = frameTimes[i-frameDelay-1];
-                                       verifyNeighboringFrames(frame6ago, frame5ago, m_result, verifyReadsDone);
+                                       verifyNeighboringFrames(frame6ago, frame5ago, m_result);
                                }
                        }
                }