New preemption test.

Submitted by Rafael Antognolli on Oct. 4, 2018, 3:35 p.m.

Details

Reviewer None
Submitted Oct. 4, 2018, 3:35 p.m.
Last Updated Oct. 4, 2018, 3:45 p.m.
Revision 1

Cover Letter(s)

Revision 1
      This series attempts to test that we get a fine grained preemption
level when using the EGL_IMG_context_priority extension. Particularly,
if the context priority is set to high in a given context, it should
preempt lower priority contexts if they are still executing when the
higher priority one is dispatch.

This test attemps to confirm that some preemption actually happened. It
does so by first starting a draw call that is supposed to take a long
time to finish, due to the size of the render buffer and instanced
rendering with a high number of instances. Then it starts a new thread
and creates a new, high priority context. This context then dispatch a
bunch of draw calls, and expects that the first one to start after the
main draw call (using GL_TIMESTAMP for that) should still finish before
that one too.

However, checking through the GL_TIMESTAMP is not always guaranteed, and
sometimes we get reports that the first high priority draw that started
after the medium priority one also finished earlier, even if preemption
is not supported. For that, we check the second high priority draw that
started after the main one, which apparently will not report finished
before the medium priority one.

Even though the method reported above might not be ideal for testing
preemption, hopefully this test provides a framework that can be tweaked
to test things correctly at some point.

Cc: Kenneth Graunke <kenneth@whitecape.org>

Rafael Antognolli (7):
  tests: Add base test for mid-command preemption.
  egl-context-preemption: Add check for high priority contexts.
  egl-context-preemption: Add a high priority thread/context.
  egl-context-preemption: check that preemption actually happened.
  egl-context-preemption: Add a subtest to reuse the same display.
  egl-context-preemption: Check that the rendering was correct.
  tests: Add preemption test to the opengl profile.

 tests/egl/CMakeLists.gl.txt        |   2 +
 tests/egl/egl-context-preemption.c | 799 +++++++++++++++++++++++++++++
 tests/opengl.py                    |   2 +
 3 files changed, 803 insertions(+)
 create mode 100644 tests/egl/egl-context-preemption.c
    

Revisions