summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-05-25 20:42:02 -0700
committerPaul Berry <stereotype441@gmail.com>2013-06-07 13:40:31 -0700
commit4c1d83cb4cf202dd7375593c830fd78db04ff14b (patch)
tree45ed89432759b731aef3314a1c7fb2650e3a85f1
parenta96dcc5ac8fbbd47923d18664fa81bbc69d3ffad (diff)
util/x11: Wait for expose event in manual mode or with front buffer tests.
When running piglit in manual mode (no "-auto" command-line option is given), there's no point in calling piglit_display() before the window is exposed. This just leads to confusion because it will be called again once the window appears, leading to duplicate test output in the console window. When running piglit in "-auto" mode, if the test accesses the front buffer, then we need to wait until the window is exposed before calling piglit_display(), since a front buffer is not guaranteed to be available before then (in practice, this only happens with non-compositing window managers). However, if the test doesn't access the front buffer, then it is still safe to call piglit_display() before the expose event; doing so avoids wasting time. Note: there are two known bugs that cause sporadic failures in certain piglit tests with Mesa/Intel hardware (and possibly other Mesa drivers). See bugs #1 and #2 in http://lists.freedesktop.org/archives/mesa-dev/2013-May/039985.html. This change seems to exacerbate those sporadic failures. As far as I'm aware, the tests that are affected are: - spec/!OpenGL 1.1/drawbuffer-modes - spec/EXT_framebuffer_blit/fbo-sys-blit - spec/EXT_framebuffer_blit/fbo-sys-sub-blit I have patches on the list to fix bug #1 from that email (see http://lists.freedesktop.org/archives/mesa-dev/2013-May/040010.html), and Eric Anholt is working on bug #2. I believe that once those fixes land, the above tests should pass consistently. Based on work by Chad Versace. Cc: Chad Versace <chad.versace@linux.intel.com> Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--tests/util/piglit-framework-gl/piglit_winsys_framework.c15
-rw-r--r--tests/util/piglit-framework-gl/piglit_x11_framework.c5
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/util/piglit-framework-gl/piglit_winsys_framework.c b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
index 971f18363..eea81e61f 100644
--- a/tests/util/piglit-framework-gl/piglit_winsys_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
@@ -50,20 +50,17 @@ run_test(struct piglit_gl_framework *gl_fw,
int argc, char *argv[])
{
struct piglit_winsys_framework *winsys_fw = piglit_winsys_framework(gl_fw);
- enum piglit_result result = PIGLIT_PASS;
-
- if (gl_fw->test_config->requires_displayed_window) {
- /* Display the window before running the actual test. */
- winsys_fw->show_window(winsys_fw);
- }
if (gl_fw->test_config->init)
gl_fw->test_config->init(argc, argv);
- if (gl_fw->test_config->display)
- result = gl_fw->test_config->display();
- if (piglit_automatic)
+ if (!gl_fw->test_config->requires_displayed_window && piglit_automatic) {
+ enum piglit_result result = PIGLIT_PASS;
+ if (gl_fw->test_config->display)
+ result = gl_fw->test_config->display();
+
piglit_report_result(result);
+ }
/* In non-auto mode, the user wishes to see the window regardless
* of the value of piglit_gl_test_config::require_displayed_window.
diff --git a/tests/util/piglit-framework-gl/piglit_x11_framework.c b/tests/util/piglit-framework-gl/piglit_x11_framework.c
index e4bf9b9e6..95c46c40e 100644
--- a/tests/util/piglit-framework-gl/piglit_x11_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_x11_framework.c
@@ -113,8 +113,11 @@ process_next_event(struct piglit_x11_framework *x11_fw)
}
if (winsys_fw->need_redisplay) {
+ enum piglit_result result = PIGLIT_PASS;
if (test_config->display)
- test_config->display();
+ result = test_config->display();
+ if (piglit_automatic)
+ piglit_report_result(result);
winsys_fw->need_redisplay = false;
}
}