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 <kenn...@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 -- 2.19.0 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit