[Piglit] [PATCH piglit v3] Test that glShaderSource does not change compile status.

2016-04-30 Thread Jamey Sharp
OpenGL 4.5 Core Profile section 7.1, in the documentation for
CompileShader, says: "Changing the source code of a shader object with
ShaderSource does not change its compile status or the compiled shader
code." (I haven't checked older versions of the spec.)

This test creates a shader, compiles it, changes its source, and links
it. The spec requires rendering done with this shader to be consistent
with the old source, not the new source, since the shader isn't compiled
again after the source is changed.

According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
Edition" depends on this odd quirk of the spec. See:
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

This test fails against current Mesa master, but passes with a one-line
patch to src/mesa/main/shaderapi.c. That patch, together with
MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
successfully on i965, though rendering bugs remain.

Based on Karol's report, I expect this test should pass on Catalyst, but
I only have Intel hardware to test on.

Signed-off-by: Jamey Sharp 
Cc: Ian Romanick 
Cc: Kenneth Graunke 
---

v3: Simplify the shaders per Ken's suggestions.

I think at this point, this patch has reviewed-by from both Ian and Ken
and I'm happy with it. Could one of you merge it, and the corresponding
Mesa patch? Thanks!

Oh, and as Ian noticed, I forgot to mention that the Mesa patch fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=93551

 tests/all.py|  1 +
 tests/shaders/CMakeLists.gl.txt |  1 +
 tests/shaders/shadersource-no-compile.c | 98 +
 3 files changed, 100 insertions(+)
 create mode 100644 tests/shaders/shadersource-no-compile.c

diff --git a/tests/all.py b/tests/all.py
index 93d64e6..9f5c019 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
 g(['glsl-kwin-blur-2'])
 g(['gpu_shader4_attribs'])
 g(['link-unresolved-function'])
+g(['shadersource-no-compile'])
 g(['sso-simple'])
 g(['sso-uniforms-01'])
 g(['sso-uniforms-02'])
diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
index afbcc4b..2db2ded 100644
--- a/tests/shaders/CMakeLists.gl.txt
+++ b/tests/shaders/CMakeLists.gl.txt
@@ -150,6 +150,7 @@ ENDIF (UNIX)
 piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
 piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
 piglit_add_executable (link-unresolved-function link-unresolved-function.c)
+piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
 piglit_add_executable (sso-simple sso-simple.c)
 piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
 piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
diff --git a/tests/shaders/shadersource-no-compile.c 
b/tests/shaders/shadersource-no-compile.c
new file mode 100644
index 000..8a2264f
--- /dev/null
+++ b/tests/shaders/shadersource-no-compile.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright © 2016 Jamey Sharp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file shadersource-no-compile.c
+ * OpenGL 4.5 Core Profile section 7.1, in the documentation for CompileShader,
+ * says: "Changing the source code of a shader object with ShaderSource does 
not
+ * change its compile status or the compiled shader code."
+ *
+ * This test creates a shader, compiles it, changes its source, and links it.
+ * The spec requires rendering done with this shader to be consistent with the
+ * old source, not the new source, since the shader isn't compiled again after
+ * the source is changed.
+ *
+ * According to Karol Herbst, the game "Divinity: Original Sin 

[Piglit] [PATCH piglit v2] Test that glShaderSource does not change compile status.

2016-04-26 Thread Jamey Sharp
OpenGL 4.5 Core Profile section 7.1, in the documentation for
CompileShader, says: "Changing the source code of a shader object with
ShaderSource does not change its compile status or the compiled shader
code." (I haven't checked older versions of the spec.)

This test creates a shader, compiles it, changes its source, and links
it. The spec requires rendering done with this shader to be consistent
with the old source, not the new source, since the shader isn't compiled
again after the source is changed.

According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
Edition" depends on this odd quirk of the spec. See:
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

This test fails against current Mesa master, but passes with a one-line
patch to src/mesa/main/shaderapi.c. That patch, together with
MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
successfully on i965, though rendering bugs remain.

Based on Karol's report, I expect this test should pass on Catalyst, but
I only have Intel hardware to test on.

Signed-off-by: Jamey Sharp 
Cc: Ian Romanick 
---

"But Ian, I learned it from watching you!" Most of the things you
complained about, I copied verbatim from your sso-simple.c. ;-)

I did notice I apparently introduced the first use of C99 array literals
anywhere in Piglit, and I didn't really need to, so I re-wrote that. And
after your suggestions, piglit_init was embarrasingly tiny, so I moved
more setup code into it. I think it's a little more clear this way.

I think this test can perhaps be simplified. Can all the work be done in
one shader, either just a vertex shader or just a fragment shader? Or
does OpenGL require both shaders to be present? I didn't spot the answer
while skimming the spec.

 tests/all.py|   1 +
 tests/shaders/CMakeLists.gl.txt |   1 +
 tests/shaders/shadersource-no-compile.c | 102 
 3 files changed, 104 insertions(+)
 create mode 100644 tests/shaders/shadersource-no-compile.c

diff --git a/tests/all.py b/tests/all.py
index 93d64e6..9f5c019 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
 g(['glsl-kwin-blur-2'])
 g(['gpu_shader4_attribs'])
 g(['link-unresolved-function'])
+g(['shadersource-no-compile'])
 g(['sso-simple'])
 g(['sso-uniforms-01'])
 g(['sso-uniforms-02'])
diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
index afbcc4b..2db2ded 100644
--- a/tests/shaders/CMakeLists.gl.txt
+++ b/tests/shaders/CMakeLists.gl.txt
@@ -150,6 +150,7 @@ ENDIF (UNIX)
 piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
 piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
 piglit_add_executable (link-unresolved-function link-unresolved-function.c)
+piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
 piglit_add_executable (sso-simple sso-simple.c)
 piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
 piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
diff --git a/tests/shaders/shadersource-no-compile.c 
b/tests/shaders/shadersource-no-compile.c
new file mode 100644
index 000..b5db55d
--- /dev/null
+++ b/tests/shaders/shadersource-no-compile.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright © 2016 Jamey Sharp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file shadersource-no-compile.c
+ * OpenGL 4.5 Core Profile section 7.1, in the documentation for CompileShader,
+ * says: "Changing the source code of a shader object with ShaderSource does 
not
+ * change its compile status or the compiled shader code."
+ *
+ * This test creates a shader, compi

[Piglit] [PATCH] glShaderSource must not change compile status.

2016-04-25 Thread Jamey Sharp
OpenGL 4.5 Core Profile section 7.1, in the documentation for
CompileShader, says: "Changing the source code of a shader object with
ShaderSource does not change its compile status or the compiled shader
code." (I haven't checked older versions of the spec.)

According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
Edition" depends on this odd quirk of the spec. See:
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
"Divinity" to start up successfully on i965, though rendering bugs
remain.

Signed-off-by: Jamey Sharp 
Cc: Karol Herbst 
---
 src/mesa/main/shaderapi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index b28b5ce..fc2e885 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const GLchar *source)
/* free old shader source string and install new one */
free((void *)sh->Source);
sh->Source = source;
-   sh->CompileStatus = GL_FALSE;
 #ifdef DEBUG
sh->SourceChecksum = _mesa_str_checksum(sh->Source);
 #endif
-- 
2.6.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Test that glShaderSource does not change compile status.

2016-04-25 Thread Jamey Sharp
OpenGL 4.5 Core Profile section 7.1, in the documentation for
CompileShader, says: "Changing the source code of a shader object with
ShaderSource does not change its compile status or the compiled shader
code." (I haven't checked older versions of the spec.)

This test creates a shader, compiles it, changes its source, and links
it. The spec requires rendering done with this shader to be consistent
with the old source, not the new source, since the shader isn't compiled
again after the source is changed.

According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
Edition" depends on this odd quirk of the spec. See:
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

This test fails against current Mesa master, but passes with a one-line
patch to src/mesa/main/shaderapi.c. That patch, together with
MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
successfully on i965, though rendering bugs remain.

Based on Karol's report, I expect this test should pass on Catalyst, but
I only have Intel hardware to test on.

Signed-off-by: Jamey Sharp 
Cc: Karol Herbst 
---
 tests/all.py|   1 +
 tests/shaders/CMakeLists.gl.txt |   1 +
 tests/shaders/shadersource-no-compile.c | 107 
 3 files changed, 109 insertions(+)
 create mode 100644 tests/shaders/shadersource-no-compile.c

diff --git a/tests/all.py b/tests/all.py
index 93d64e6..9f5c019 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
 g(['glsl-kwin-blur-2'])
 g(['gpu_shader4_attribs'])
 g(['link-unresolved-function'])
+g(['shadersource-no-compile'])
 g(['sso-simple'])
 g(['sso-uniforms-01'])
 g(['sso-uniforms-02'])
diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
index afbcc4b..2db2ded 100644
--- a/tests/shaders/CMakeLists.gl.txt
+++ b/tests/shaders/CMakeLists.gl.txt
@@ -150,6 +150,7 @@ ENDIF (UNIX)
 piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
 piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
 piglit_add_executable (link-unresolved-function link-unresolved-function.c)
+piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
 piglit_add_executable (sso-simple sso-simple.c)
 piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
 piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
diff --git a/tests/shaders/shadersource-no-compile.c 
b/tests/shaders/shadersource-no-compile.c
new file mode 100644
index 000..922f0f3
--- /dev/null
+++ b/tests/shaders/shadersource-no-compile.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright © 2016 Jamey Sharp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file shadersource-no-compile.c
+ * OpenGL 4.5 Core Profile section 7.1, in the documentation for CompileShader,
+ * says: "Changing the source code of a shader object with ShaderSource does 
not
+ * change its compile status or the compiled shader code."
+ *
+ * This test creates a shader, compiles it, changes its source, and links it.
+ * The spec requires rendering done with this shader to be consistent with the
+ * old source, not the new source, since the shader isn't compiled again after
+ * the source is changed.
+ *
+ * According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
+ * Edition" depends on this odd quirk of the spec. See:
+ * https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
+ *
+ * \author Jamey Sharp 
+ */
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUB

[Piglit] OML_sync_control semantics

2014-05-16 Thread Jamey Sharp
[We should probably have moved this conversation to the piglit list when
it shifted to discussing these new OML_sync_control tests.]

On Wed, May 14, 2014 at 04:12:32PM +0100, Chris Wilson wrote:
> On Wed, May 14, 2014 at 06:49:10AM -0700, Jamey Sharp wrote:
> > On Wed, May 14, 2014 at 01:31:14PM +0100, Chris Wilson wrote:
> > > On Tue, May 13, 2014 at 09:20:45AM -0700, Jamey Sharp wrote:
> > > >Yeah, we have new tests that haven't quite been merged yet as we're
> > > >addressing Eric's review comments. Our current version, revised 
> > > > yesterday,
> > > >is available here:
> > > > 
> > > >[2]https://github.com/ThirteenFish/piglit
> > > > 
> > > >Make sure you do a full 'piglit-run.py -t OML_sync_control ...' as 
> > > > we run
> > > >the new tests in a variety of configurations, and the full-screen 
> > > > ones are
> > > >particularly interesting here. Though IIRC, SNA fails some of the 
> > > > others
> > > >as well.
> > > 
> > > Looks like there are quite a few bugs remaining in the test cases.
> > 
> > Thanks for reviewing them, Chris!
> > 
> > > glXGetSyncValuesOML returns the current hardware frame counter and time
> > > of last frame update, not the last client swap frame or swap time. You
> > > make an assumption in the timing loop that the calls to SwapBuffers
> > > and GetSyncValues are instantaneous and do not account for a vblank
> > > interrupt that can happen in between updating the hardware counters.
> > 
> > We do make that assumption, but if the assumption is violated we only
> > emit a warning.
> 
> It's a FAIL currently.

Hmm, right. I've rewritten those checks to just verify that alternating
between calls to WaitForSbc and GetSyncValues always have monotonically
increasing values for both UST and MSC. That's clearly required by the
spec, and still catches the driver bugs I was concerned about.

Regarding the behavior of divisor==0: I had to think very hard about
what you were saying, what the spec says, what the X.Org implementation
does, whether SwapInterval affects any of the above, etc. (In case
anyone wondered, I did not enjoy that.) Theo and I have concluded that
you're right, regardless of what SwapInterval is set to. (It was
confusing since a non-zero SwapInterval would in some cases make
divisor==0 sync to vblank almost as if you'd set divisor==swap_interval,
but not in all cases.)

As a result, we've changed timing.c to never use divisor==0, because we
want to validate that the driver syncs to vblank when required, and as
you say, the spec only requires that if divisor>0. Instead, when testing
in -msc-delta mode we set divisor=1, to specify that if the swap misses
our target_msc, it should wait until the next vblank.

We're also retracting the repeat-swapbuffers test. There may still be
utility in a test like it but it isn't testing anything we actually care
about and we don't want to think about it further.

You can review/test these changes and others, currently in separate
patches, at https://github.com/ThirteenFish/piglit. We'll rebase them
into the series when we send it out for review again.

> > > The computation of interframe jitter is wonky, thanks to using
> > > (new_timestamp - -1) on the first pass.
> > 
> > Oops, we broke that while addressing Eric's review comments on Monday.
> > We'll fix it.

Now fixed in the above git repo.

Thanks,
Jamey


signature.asc
Description: Digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] outerproduct_tests: Add positional argument specifiers.

2014-05-14 Thread Jamey Sharp
I can't merge Piglit patches, but for whatever it's worth this is
obviously correct, so:

Reviewed-by: Jamey Sharp 

On Wed, May 14, 2014 at 05:13:27PM -0700, Vinson Lee wrote:
> Fix build errors with Python < 2.7.
> 
> Signed-off-by: Vinson Lee 
> Reviewed-by: Dylan Baker 
> ---
>  generated_tests/gen_outerproduct_tests.py |8 
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/generated_tests/gen_outerproduct_tests.py 
> b/generated_tests/gen_outerproduct_tests.py
> index 38bf834..fdc3810 100644
> --- a/generated_tests/gen_outerproduct_tests.py
> +++ b/generated_tests/gen_outerproduct_tests.py
> @@ -46,13 +46,13 @@ def main():
>  
>  for c, r in itertools.product(xrange(2, 5), repeat=2):
>  vecs = [
> -Parameters(c, r, 'vec', 'mat{}x{}'.format(r, c)),
> -Parameters(c, r, 'ivec', 'mat{}x{}'.format(r, c))
> +Parameters(c, r, 'vec', 'mat{0}x{1}'.format(r, c)),
> +Parameters(c, r, 'ivec', 'mat{0}x{1}'.format(r, c))
>  ]
>  if r == c:
>  vecs.extend([
> -Parameters(c, r, 'vec', 'mat{}'.format(r)),
> -Parameters(c, r, 'ivec', 'mat{}'.format(r))
> +Parameters(c, r, 'vec', 'mat{0}'.format(r)),
> +Parameters(c, r, 'ivec', 'mat{0}'.format(r))
>  ])
>  
>  for shader in ['vs', 'fs']:
> -- 
> 1.7.1
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


signature.asc
Description: Digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 8/9] Added timeouts to tests that use SwapBuffersMsc.

2014-05-08 Thread Jamey Sharp
Theo and I preferred this approach as it allows each test to determine what
a reasonable timeout should be, using dynamic information if desired.

Also, we understood that getting signal-safety right in the Python
framework was hard, so we figured this was less likely to break.

That said, we'd be happy to have these merged without timeout support if
that's what it takes. :-)

Thanks for reviewing these!
Jamey
On May 8, 2014 10:49 AM, "Eric Anholt"  wrote:

> Jamey Sharp  writes:
>
> > From: TheoH 
> >
> > We've observed hangs on some drivers in these calls, which make it
> > harder to run the rest of the Piglit test suite.
>
> I know people have been working on having timeout support in the
> framework, which seems much better than having it ad-hoc in tests that
> we've discovered already hang on some systems.  Any framework folks have
> status on that?
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] util: use piglit_load_text_file() in piglit_compile_shader()

2014-04-28 Thread Jamey Sharp
Looks good to me! I don't know yet how the merge process works for
Piglit, but I'm happy to offer my:

Reviewed-by: Jamey Sharp 

Jamey

On Mon, Apr 28, 2014 at 2:46 PM, Brian Paul  wrote:
> The old code had a problem on MinGW.  If the shader/text file had
> DOS-style \r\n line endings, fread() would convert them to Unix-style
> \n line endings.  Since the actual number of chars read by fread()
> was less than the stat()'d size, we put the terminating '\0' in the
> wrong place, possibly after some garbage characters in the buffer.
>
> This sometimes caused the GLSL compiler to generate an error when it
> found those garbage chars.
>
> A Heisenbug:  I was seeing failures w/out gdb but success w/ gdb. Ugh!
>
> v2: get rid of stat() call too, per Jamey Sharp.
> ---
>  tests/util/piglit-shader.c |   29 ++---
>  1 file changed, 6 insertions(+), 23 deletions(-)
>
> diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
> index b326abd..76a4d03 100644
> --- a/tests/util/piglit-shader.c
> +++ b/tests/util/piglit-shader.c
> @@ -21,7 +21,6 @@
>   * USE OR OTHER DEALINGS IN THE SOFTWARE.
>   */
>
> -#include 
>  #include 
>
>  #include "piglit-util-gl-common.h"
> @@ -66,10 +65,7 @@ GLuint
>  piglit_compile_shader(GLenum target, const char *filename)
>  {
> GLuint prog;
> -   struct stat st;
> -   int err;
> GLchar *prog_string;
> -   FILE *f;
> const char *source_dir;
> char filename_with_path[FILENAME_MAX];
>
> @@ -82,28 +78,15 @@ piglit_compile_shader(GLenum target, const char *filename)
>  "%s/tests/%s", source_dir, filename);
> filename_with_path[FILENAME_MAX - 1] = 0;
>
> -   err = stat(filename_with_path, &st);
> -   if (err == -1) {
> -   fprintf(stderr, "Couldn't stat program %s: %s\n", 
> filename_with_path, strerror(errno));
> -   fprintf(stderr, "You can override the source dir by setting 
> the PIGLIT_SOURCE_DIR environment variable.\n");
> +   prog_string = piglit_load_text_file(filename_with_path, NULL);
> +   if (!prog_string) {
> +   fprintf(stderr, "Couldn't read shader %s: %s\n",
> +   filename_with_path, strerror(errno));
> +   fprintf(stderr, "You can override the source dir by setting 
> the"
> +   " PIGLIT_SOURCE_DIR environment variable.\n");
> exit(1);
> }
>
> -   prog_string = malloc(st.st_size + 1);
> -   if (prog_string == NULL) {
> -   fprintf(stderr, "malloc\n");
> -   exit(1);
> -   }
> -
> -   f = fopen(filename_with_path, "r");
> -   if (f == NULL) {
> -   fprintf(stderr, "Couldn't open program: %s\n", 
> strerror(errno));
> -   exit(1);
> -   }
> -   fread(prog_string, 1, st.st_size, f);
> -   prog_string[st.st_size] = '\0';
> -   fclose(f);
> -
> prog = piglit_compile_shader_text(target, prog_string);
>
> free(prog_string);
> --
> 1.7.10.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] util: use piglit_load_text_file() in piglit_compile_shader()

2014-04-28 Thread Jamey Sharp
After this patch, you don't need the stat call either, right? I think
the function reduces to getenv, snprintf, piglit_load_text_file,
piglit_compile_shader_text, and free. Which seems like a good idea
even if it wasn't fixing any bugs.

Jamey

On Mon, Apr 28, 2014 at 2:13 PM, Brian Paul  wrote:
> The old code had a problem on MinGW.  If the shader/text file had
> DOS-style \r\n line endings, fread() would convert them to Unix-style
> \n line endings.  Since the actual number of chars read by fread()
> was less than the stat()'d size, we put the terminating '\0' in the
> wrong place, possibly after some garbage characters in the buffer.
>
> This sometimes caused the GLSL compiler to generate an error when it
> found those garbage chars.
>
> A Heisenbug:  I was seeing failures w/out gdb but success w/ gdb. Ugh!
> ---
>  tests/util/piglit-shader.c |   16 +++-
>  1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
> index b326abd..0aa4d02 100644
> --- a/tests/util/piglit-shader.c
> +++ b/tests/util/piglit-shader.c
> @@ -69,7 +69,6 @@ piglit_compile_shader(GLenum target, const char *filename)
> struct stat st;
> int err;
> GLchar *prog_string;
> -   FILE *f;
> const char *source_dir;
> char filename_with_path[FILENAME_MAX];
>
> @@ -89,21 +88,12 @@ piglit_compile_shader(GLenum target, const char *filename)
> exit(1);
> }
>
> -   prog_string = malloc(st.st_size + 1);
> -   if (prog_string == NULL) {
> -   fprintf(stderr, "malloc\n");
> +   prog_string = piglit_load_text_file(filename_with_path, NULL);
> +   if (!prog_string) {
> +   fprintf(stderr, "Unable to read %s\n", filename_with_path);
> exit(1);
> }
>
> -   f = fopen(filename_with_path, "r");
> -   if (f == NULL) {
> -   fprintf(stderr, "Couldn't open program: %s\n", 
> strerror(errno));
> -   exit(1);
> -   }
> -   fread(prog_string, 1, st.st_size, f);
> -   prog_string[st.st_size] = '\0';
> -   fclose(f);
> -
> prog = piglit_compile_shader_text(target, prog_string);
>
> free(prog_string);
> --
> 1.7.10.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/2] EGL_CHROMIUM_get_sync_values: Add conformance test.

2014-04-24 Thread Jamey Sharp
Well, I find your arguments convincing. For whatever my opinion is worth.
:-)

On Apr 24, 2014 1:03 PM, "Chad Versace" 
wrote:
> On Thu, Apr 24, 2014 at 09:17:50AM -0700, Jamey Sharp wrote:
> > On Apr 23, 2014 1:36 PM, "Chad Versace" 
wrote:
> > > As for eglSwapBuffers being synchronized to vertical retraces, again
it
> > > is on all platforms I've used.
> >
> > Modulo bugs, presumably, since it certainly isn't reliably synchronized
in X
> > right now. :-)
>
> How is it not synchronized in X? And how unreliabe is its unreliability?
> Please tell. This storm cloud troubles my soul.

I should qualify, I've only been testing glX, not EGL, but since the bugs
I'm seeing look to me like they're in the user space drivers on the X
server side, I expect them to show up when using either client API.

You can try the Piglit patch series that Theo and I posted yesterday and
see whether you get any better results than I do. Our earlier ad-hoc tests
suggested that none of the open source drivers do well at OML_sync_control,
using either DRI2 or Present. Our Piglit tests confirm that result for
current git master of xserver and xf86-video-intel using either UXA or SNA
with either DRI2 or DRI3.

I speculate that only some of the code paths are buggy, and it depends on
whether the driver decides to use page flipping, blits, or exchanges, which
in turn follows complicated rules I don't understand. One symptom is that
often the WaitForSbc or WaitForMsc call will return 0 for both UST and MSC,
which occurs when the driver calls DRI2SwapComplete with zeroes, and that
tends to correlate with bad behavior. But it isn't a cause or a reliable
effect of the bugs.

I recommend trying without a compositor first as compositing managers seem
to make the situation quite a bit worse, though under compositing it's
unreliably unreliable. :-\ Without a compositor, stable results from the
Piglit tests. With a compositor, sometimes both the compositor and the GL
client crash simultaneously, and the rest of the time I can't predict which
tests will fail.

> > Ooh, and does Mesa set EGL_MAX_SWAP_INTERVAL == 0 if vblank_mode is 0?
>
> Yep. This code block, present in the X11 and Wayland code, does it. I
verified
> it actually does it job with my wfl-swapinterval toy.
>
>switch (vblank_mode) {
>...

Ah, very good!

Jamey
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/2] EGL_CHROMIUM_get_sync_values: Add conformance test.

2014-04-24 Thread Jamey Sharp
On Apr 23, 2014 1:36 PM, "Chad Versace" 
wrote:
> On Tue, Apr 22, 2014 at 12:22:12PM -0700, Sarah Sharp wrote:
> > On Fri, Apr 18, 2014 at 06:21:31PM -0700, Jamey Sharp wrote:
> > > - I don't see that MSC has to change at all even after two
> > > eglSwapBuffers calls, if SwapBuffers doesn't sync to vertical retrace.
> >
> > I looked at the EGL 1.5 spec with Chad, and if you look at the
> > definition of eglSwapInterval, you'll see that the "minimum number of
> > video frame periods per buffer swap" is set to 1 by default.  I think
> > one frame period is the time between vertical retraces, but the spec
> > isn't clear on that.
>
> The spec is sadly ambiguous on that. It's also ambiguous on whether
> eglSwapBuffers blocks or immediately returns false if too many
> outstanding swaps are pending.
>
> I think it's safe to assume that it blocks.  because that's what all EGL
> implementations do that I've used: X11, Android, Wayland, and
> (vacuously) GBM. (More below on why this it's vacuously true that GBM
> implements the blocking behavior).

I'd just feel more comfortable, in a conformance test, if there were
specification text you could point to instead of a de facto standard. I
note you only mention Linux based GL implementations, after all.

Any day one can use a word like "vacuously" is a good day, though.

> As for eglSwapBuffers being synchronized to vertical retraces, again it
> is on all platforms I've used.

Modulo bugs, presumably, since it certainly isn't reliably synchronized in
X right now. :-) But I agree that it's intended to be, especially
considering:

> Like Sarah said. If you set env vars that provide nonconformant
> behavior, then your conformance testsuite may fail.

It wasn't obvious to me that that was non-conforming behavior. However,
Theo has since pointed out this sentence in the OML_sync_control spec:

"If there are multiple outstanding swaps for the same window, at most one
such swap can be satisfied per increment of MSC."

So I retract my first concern. :-)

(Technically this doesn't say the swap has to happen during vertical
retrace, but for the purposes of Sarah's tests that doesn't matter.)

> I played with that test app on X11, Wayland, and GBM to discover exactly
> how the swap interval behaves on each platform. Wayland was the
> weirdest.

Out of curiosity, how was Wayland weird?

> I think the test should do this:
>
> Create the EGLConfig as it currently does. That is, do not specify
> EGL_[MIN|MAX]_SWAP_INTERVAL.  Then immediately query
> eglGetConfigAttrib(EGL_MIN_SWAP_INTERVAL) and
> eglGetConfigAttrib(EGL_MAX_SWAP_INTERVAL).
>
> If the max swap interval is 0, then eglSwapBuffers will not block.
> So report PIGLIT_RESULT_SKIP.
>
> Else, the EGL spec ensures that the surface's swap interval is
> EGL_MIN_SWAP_INTERVAL. Calculate the expected MSC and SBC from that.
>
> For bonus points, let the desired swap_interval be an input
> parameter to the test. The test will skip if and only if
> requested_swap_interval is outside of [EGL_MIN_SWAP_INTERVAL,
> EGL_MAX_SWAP_INTERVAL]. The test sets the surface's swap interval
> with eglSwapInterval(requested_swap_interval), calculates expected
> values of of MSC and SBC, and tests for them.
>
> Why is GBM a special case? Because EGLConfigs on GBM have
> EGL_MIN_SWAP_INTERVAL == EGL_MAX_SWAP_INTERVAL == 0. So eglSwapBuffers
> never throttles.

This strikes me as a very satisfying way to handle it, my lingering
concerns about unspecified throttling/blocking behavior notwithstanding.

Ooh, and does Mesa set EGL_MAX_SWAP_INTERVAL == 0 if vblank_mode is 0?

Jamey
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] OML_sync_control tests

2014-04-23 Thread Jamey Sharp
These patches are our attempts to validate that glX OML_sync_control
implementations sync to vblank, and otherwise conform to the extension's
specification. The existing tests don't demonstrate a variety of
implementation bugs that we've observed in current drivers, so this is
our attempt to demonstrate those bugs.

Patch 1 fixes argument setup for the existing OML_sync_control tests,
which causes the swapbuffersmsc-return test to pass where it failed
before. (Together with xserver patches that are now in git master, the
existing tests all pass for me after this patch is applied.)

Patches 2-6 are framework improvements to simplify both existing tests
and the newly added ones.

Patches 7 and 9 add our new tests, and patch 8 adds timeouts to make it
easier to run the test suite on the, let's say, non-conformant driver
implementation on Theo's laptop.

I sent patches 1-3 to the list last week for review but haven't seen any
responses yet.

Jamey and Theo

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 7/9] Validate that OML Sync Control syncs to vblank.

2014-04-23 Thread Jamey Sharp
From: TheoH 

The existing tests don't demonstrate a variety of implementation bugs
that we've observed in current drivers, so this is our attempt to
demonstrate those bugs.

Signed-off-by: Theo Hill 
Signed-off-by: Jamey Sharp 
---
 tests/all.py  |   9 +
 tests/spec/glx_oml_sync_control/CMakeLists.gl.txt |   1 +
 tests/spec/glx_oml_sync_control/timing.c  | 298 ++
 3 files changed, 308 insertions(+)
 create mode 100644 tests/spec/glx_oml_sync_control/timing.c

diff --git a/tests/all.py b/tests/all.py
index ccfa626..d610ce0 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -786,6 +786,15 @@ oml_sync_control['swapbuffersmsc-return swap_interval 0'] 
= PiglitTest(['glx-oml
 oml_sync_control['swapbuffersmsc-return swap_interval 1'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return', '1'])
 oml_sync_control['waitformsc'] = 
PiglitTest(['glx-oml-sync-control-waitformsc'])
 
+oml_sync_control_nonzeros = [
+mode + [kind, period]
+for mode in [[], ['-fullscreen'], ['-waitformsc']]
+for kind in ['-divisor', '-msc-delta']
+for period in ['1', '2']
+]
+for arg in [[], ['-fullscreen']] + oml_sync_control_nonzeros:
+oml_sync_control[' '.join(['timing'] + arg)] = 
PiglitTest(['glx-oml-sync-control-timing'] + arg)
+
 mesa_query_renderer = {}
 glx['GLX_MESA_query_renderer'] = mesa_query_renderer
 mesa_query_renderer['coverage'] = 
concurrent_test('glx-query-renderer-coverage')
diff --git a/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt 
b/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
index c299848..125e2a5 100644
--- a/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
+++ b/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
@@ -26,6 +26,7 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-oml-sync-control-swapbuffersmsc-divisor-zero 
swapbuffersmsc-divisor-zero.c common.c)
piglit_add_executable (glx-oml-sync-control-swapbuffersmsc-return 
swapbuffersmsc-return.c common.c)
piglit_add_executable (glx-oml-sync-control-waitformsc waitformsc.c 
common.c)
+   piglit_add_executable (glx-oml-sync-control-timing timing.c common.c)
 ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 # vim: ft=cmake:
diff --git a/tests/spec/glx_oml_sync_control/timing.c 
b/tests/spec/glx_oml_sync_control/timing.c
new file mode 100644
index 000..decb352
--- /dev/null
+++ b/tests/spec/glx_oml_sync_control/timing.c
@@ -0,0 +1,298 @@
+/*
+ * Copyright © 2014 The TOVA Company
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file timing.c
+ * Validates that OML Sync Control implementation actually syncs to vertical 
retrace
+ */
+
+#include "piglit-util-gl-common.h"
+#include "piglit-glx-util.h"
+#include "common.h"
+/*
+ * TODO: varying MSC deltas enumerated as arguments
+ * TODO: As a different test, create two drawables and verify they have 
independent SBC
+ */
+static bool fullscreen;
+static bool use_swapbuffers = true;
+static int64_t target_msc_delta;
+static int64_t divisor;
+static const int64_t msc_remainder = 0;
+static const unsigned int loops = 10;
+
+struct stats {
+   unsigned int n;
+   double mean;
+   double M2;
+};
+
+static void update_stats(struct stats *stats, double val) {
+   double delta = val - stats->mean;
+   stats->n += 1;
+   stats->mean += delta / stats->n;
+   stats->M2 += delta * (val - stats->mean);
+}
+
+static double get_stddev(struct stats *stats) {
+   return sqrt(stats->M2 / (stats->n - 1));
+}
+
+static enum piglit_result
+draw(Display *dpy)
+{
+   enum piglit_result result = PIGLIT_PASS;
+   int64_t last_ust =

[Piglit] [PATCH 3/9] Only test non-default swap_interval if supported.

2014-04-23 Thread Jamey Sharp
If this test is compiled on a machine that does not have headers for
GLX_MESA_swap_control, then it should skip any tests that require using
GLX_MESA_swap_control.

I tested this patch in both configurations, using "#if 0 && ..." to
check the unsupported-at-build-time case.

Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
index 92f34ea..2f31fbf 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
@@ -51,8 +51,8 @@ draw(Display *dpy)
bool pass = true;
int i;
 
-#if defined(GLX_MESA_swap_control)
if (swap_interval != -1) {
+#if defined(GLX_MESA_swap_control)
PFNGLXSWAPINTERVALMESAPROC pglXSwapIntervalMESA;
 
printf("Testing with swap interval %d\n", swap_interval);
@@ -62,12 +62,15 @@ draw(Display *dpy)
glXGetProcAddressARB((const GLubyte *)
 "glXSwapIntervalMESA");
pglXSwapIntervalMESA(swap_interval);
+#else
+   fprintf(stderr,
+   "Testing swap interval %d requires building with 
GLX_MESA_swap_control\n",
+   swap_interval);
+   piglit_report_result(PIGLIT_SKIP);
+#endif
} else {
printf("Testing with default swap interval\n");
}
-#else
-   printf("Testing with default swap interval\n");
-#endif
 
glXGetSyncValuesOML(dpy, win, &start_ust, &start_msc, &start_sbc);
if (start_sbc != 0) {
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 8/9] Added timeouts to tests that use SwapBuffersMsc.

2014-04-23 Thread Jamey Sharp
From: TheoH 

We've observed hangs on some drivers in these calls, which make it
harder to run the rest of the Piglit test suite.

Signed-off-by: Theo Hill 
Signed-off-by: Jamey Sharp 
---
 .../glx_oml_sync_control/swapbuffersmsc-divisor-zero.c | 14 --
 tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c| 13 +++--
 tests/spec/glx_oml_sync_control/timing.c   | 12 
 3 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
index d83905c..fa6db1c 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
@@ -46,8 +46,18 @@ draw(Display *dpy)
int64_t start_ust = 0xd0, start_msc = 0xd0, start_sbc = 0xd0;
int64_t swapped_ust = 0xd0, swapped_msc = 0xd0, swapped_sbc = 0xd0;
int64_t current_ust = 0xd0, current_msc = 0xd0, current_sbc = 0xd0;
-   int64_t target_msc, outstanding_sbc;
+   int64_t target_msc, outstanding_sbc, msc_delta = 5;
bool already_wrapped = false;
+   int32_t rate_num, rate_den;
+   double timeout;
+
+   if (!glXGetMscRateOML(dpy, win, &rate_num, &rate_den)) {
+   timeout = 1.0 / 10; /* Assume MSC rate is at least 10Hz */
+   } else {
+   timeout = (double) rate_den / rate_num;
+   }
+   piglit_set_timeout(timeout * msc_delta * 2, PIGLIT_FAIL); /* Safety 
factor 2 */
+
 
glXGetSyncValuesOML(dpy, win, &start_ust, &start_msc, &start_sbc);
if (start_sbc != 0) {
@@ -63,7 +73,7 @@ wrap:
glClear(GL_COLOR_BUFFER_BIT);
 
/* Queue a swap for 5 frames from when we started. */
-   target_msc = start_msc + 5;
+   target_msc = start_msc + msc_delta;
glXSwapBuffersMscOML(dpy, win, target_msc, 0, 0);
outstanding_sbc++;
 
diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
index a37fc9a..74d5873 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
@@ -49,7 +49,16 @@ draw(Display *dpy)
int64_t start_ust = 0xd0, start_msc = 0xd0, start_sbc = 0xd0;
int64_t next_sbc;
bool pass = true;
-   int i;
+   int i, loops = 3;
+   int32_t rate_num, rate_den;
+   double timeout;
+
+   if (!glXGetMscRateOML(dpy, win, &rate_num, &rate_den)) {
+   timeout = 1.0 / 10; /* Assume MSC rate is at least 10Hz */
+   } else {
+   timeout = (double)rate_den / rate_num;
+   }
+   piglit_set_timeout(timeout * loops * 2, PIGLIT_FAIL); /* Safety factor 
2 */
 
if (swap_interval != -1) {
 #if defined(GLX_MESA_swap_control)
@@ -81,7 +90,7 @@ draw(Display *dpy)
}
next_sbc = start_sbc + 1;
 
-   for (i = 0; i < 3; i++) {
+   for (i = 0; i < loops; i++) {
int64_t ret_sbc;
 
glClearColor(0.0, 1.0, 0.0, 0.0);
diff --git a/tests/spec/glx_oml_sync_control/timing.c 
b/tests/spec/glx_oml_sync_control/timing.c
index decb352..e81beef 100644
--- a/tests/spec/glx_oml_sync_control/timing.c
+++ b/tests/spec/glx_oml_sync_control/timing.c
@@ -57,6 +57,11 @@ static double get_stddev(struct stats *stats) {
return sqrt(stats->M2 / (stats->n - 1));
 }
 
+static double max(double a, double b)
+{
+   return a > b ? a : b;
+}
+
 static enum piglit_result
 draw(Display *dpy)
 {
@@ -67,6 +72,7 @@ draw(Display *dpy)
double expected_msc_wallclock_duration = 0.0;
int32_t rate_num, rate_den;
unsigned int i;
+   double timeout;
 
if (!glXGetSyncValuesOML(dpy, win, &last_ust, &last_msc, &last_sbc)) {
fprintf(stderr, "Initial glXGetSyncValuesOML failed\n");
@@ -80,10 +86,16 @@ draw(Display *dpy)
 
if (!glXGetMscRateOML(dpy, win, &rate_num, &rate_den)) {
fprintf(stderr, "glXGetMscRateOML failed, can't test MSC 
duration\n");
+   timeout = 1.0 / 10; /* Assume MSC rate is at least 10Hz */
} else {
expected_msc_wallclock_duration = 1e6 * rate_den / rate_num;
+   timeout = expected_msc_wallclock_duration / 1e6;
}
 
+   timeout *= loops * max(1, max(target_msc_delta, divisor));
+   piglit_set_timeout(timeout * 2, PIGLIT_FAIL); /* Safety factor 2 */
+
+
for (i = 0; i < loops; i++) {
int64_t swapped_ust = 0xd0, swapped_msc = 0xd0, swapped_sbc = 
0xd0;
int64_t new_ust = 0xd0, new_msc = 0xd0, new_sbc = 0xd0, 
new_timestamp;
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 4/9] Add piglit_set_timeout for tests that might hang.

2014-04-23 Thread Jamey Sharp
Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 CMakeLists.txt   | 31 ---
 tests/util/piglit-util.c | 40 
 tests/util/piglit-util.h |  1 +
 3 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cbdccf1..481cfce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -301,10 +301,16 @@ if (OPENGL_FOUND)
endif (APPLE)
 endif()
 
+if(CMAKE_USE_PTHREADS_INIT)
+   set(PIGLIT_HAS_PTHREADS true)
+   add_definitions(-DPIGLIT_HAS_PTHREADS)
+endif()
+
 FIND_LIBRARY(HAVE_LIBRT NAMES rt)
 if(HAVE_LIBRT)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
 endif()
+
 check_c_source_compiles(
"
#define _POSIX_C_SOURCE 199309L
@@ -313,15 +319,34 @@ check_c_source_compiles(
"
PIGLIT_HAS_POSIX_CLOCK_MONOTONIC
 )
+
+if(PIGLIT_HAS_PTHREADS AND PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
+   check_c_source_compiles(
+   "
+   #include 
+   #include 
+   static void timeout(union sigval val) { }
+   int main() {
+   struct sigevent sev = {
+   .sigev_notify = SIGEV_THREAD,
+   .sigev_notify_function = timeout,
+   };
+   timer_t timerid;
+   return timer_create(CLOCK_MONOTONIC, &sev, &timerid);
+   }
+   "
+   PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
+   )
+endif()
+
 set(CMAKE_REQUIRED_LIBRARIES)
 
 if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
add_definitions(-DPIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
 endif()
 
-if(CMAKE_USE_PTHREADS_INIT)
-   set(PIGLIT_HAS_PTHREADS true)
-   add_definitions(-DPIGLIT_HAS_PTHREADS)
+if(PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD)
+   add_definitions(-DPIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD)
 endif()
 
 if(PIGLIT_USE_WAFFLE AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index cefc303..ecb91ea 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -43,6 +43,10 @@
 #include 
 
 #ifdef PIGLIT_HAS_POSIX_CLOCK_MONOTONIC
+#ifdef PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
+#include 
+#include 
+#endif
 #include 
 #endif
 
@@ -218,6 +222,12 @@ piglit_report_result(enum piglit_result result)
 {
const char *result_str = piglit_result_to_string(result);
 
+#ifdef PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
+   /* Ensure we only report one result in case we race with timeout */
+   static pthread_mutex_t result_lock = PTHREAD_MUTEX_INITIALIZER;
+   pthread_mutex_lock(&result_lock);
+#endif
+
fflush(stderr);
 
printf("PIGLIT: {'result': '%s' }\n", result_str);
@@ -233,6 +243,36 @@ piglit_report_result(enum piglit_result result)
}
 }
 
+#ifdef PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
+static void
+timeout_expired(union sigval val)
+{
+   piglit_loge("Test timed out.");
+   piglit_report_result(val.sival_int);
+}
+#endif
+
+void
+piglit_set_timeout(double seconds, enum piglit_result timeout_result)
+{
+#ifdef PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
+   struct sigevent sev = {
+   .sigev_notify = SIGEV_THREAD,
+   .sigev_notify_function = timeout_expired,
+   .sigev_value = { .sival_int = timeout_result },
+   };
+   time_t sec = seconds;
+   struct itimerspec spec = {
+   .it_value = { .tv_sec = sec, .tv_nsec = (seconds - sec) * 1e9 },
+   };
+   timer_t timerid;
+   timer_create(CLOCK_MONOTONIC, &sev, &timerid);
+   timer_settime(timerid, 0, &spec, NULL);
+#else
+   piglit_logi("Cannot abort this test for timeout on this platform");
+#endif
+}
+
 void
 piglit_report_subtest_result(enum piglit_result result, const char *format, 
...)
 {
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 23e0539..c3b939a 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -197,6 +197,7 @@ int piglit_find_line(const char *program, int position);
 void piglit_merge_result(enum piglit_result *all, enum piglit_result subtest);
 const char * piglit_result_to_string(enum piglit_result result);
 NORETURN void piglit_report_result(enum piglit_result result);
+void piglit_set_timeout(double seconds, enum piglit_result timeout_result);
 void piglit_report_subtest_result(enum piglit_result result,
  const char *format, ...) PRINTFLIKE(2, 3);
 
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 9/9] Validate that SwapBuffers doesn't re-use an MSC.

2014-04-23 Thread Jamey Sharp
From: TheoH 

This test checks that when swapbuffers is called multiple times without
WaitForSbc that the SBC is not incremented more often than the MSC.

Signed-off-by: Theo Hill 
Signed-off-by: Jamey Sharp 
---
 tests/all.py   |   4 +
 tests/spec/glx_oml_sync_control/CMakeLists.gl.txt  |   2 +
 .../spec/glx_oml_sync_control/repeat-swapbuffers.c | 143 +
 3 files changed, 149 insertions(+)
 create mode 100644 tests/spec/glx_oml_sync_control/repeat-swapbuffers.c

diff --git a/tests/all.py b/tests/all.py
index d610ce0..b87970d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -795,6 +795,10 @@ oml_sync_control_nonzeros = [
 for arg in [[], ['-fullscreen']] + oml_sync_control_nonzeros:
 oml_sync_control[' '.join(['timing'] + arg)] = 
PiglitTest(['glx-oml-sync-control-timing'] + arg)
 
+oml_sync_control['repeat-swapbuffers'] = 
PiglitTest(['glx-oml-sync-control-repeat-swapbuffers'])
+oml_sync_control['repeat-swapbuffers -msc-delta 1'] = 
PiglitTest(['glx-oml-sync-control-repeat-swapbuffers', '-msc-delta', '1'])
+oml_sync_control['repeat-swapbuffers -msc-delta 5'] = 
PiglitTest(['glx-oml-sync-control-repeat-swapbuffers', '-msc-delta', '5'])
+
 mesa_query_renderer = {}
 glx['GLX_MESA_query_renderer'] = mesa_query_renderer
 mesa_query_renderer['coverage'] = 
concurrent_test('glx-query-renderer-coverage')
diff --git a/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt 
b/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
index 125e2a5..9b02979 100644
--- a/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
+++ b/tests/spec/glx_oml_sync_control/CMakeLists.gl.txt
@@ -27,6 +27,8 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-oml-sync-control-swapbuffersmsc-return 
swapbuffersmsc-return.c common.c)
piglit_add_executable (glx-oml-sync-control-waitformsc waitformsc.c 
common.c)
piglit_add_executable (glx-oml-sync-control-timing timing.c common.c)
+   piglit_add_executable (glx-oml-sync-control-repeat-swapbuffers 
repeat-swapbuffers.c common.c)
+
 ENDIF(PIGLIT_BUILD_GLX_TESTS)
 
 # vim: ft=cmake:
diff --git a/tests/spec/glx_oml_sync_control/repeat-swapbuffers.c 
b/tests/spec/glx_oml_sync_control/repeat-swapbuffers.c
new file mode 100644
index 000..7339305
--- /dev/null
+++ b/tests/spec/glx_oml_sync_control/repeat-swapbuffers.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright © 2014 The TOVA Company
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file repeat-swapbuffers.c
+ * Verifies that glXSwapBuffersMscOML does not increment SBC more often than 
MSC
+ */
+
+#include "piglit-util-gl-common.h"
+#include "piglit-glx-util.h"
+#include "common.h"
+
+static int64_t target_msc_delta = 0;
+static const int64_t divisor = 0;
+static const int64_t msc_remainder = 0;
+static const unsigned int loops = 5;
+
+
+struct omlTriple {
+   int64_t ust;
+   int64_t msc;
+   int64_t sbc;
+};
+
+static double max(double a, double b)
+{
+   return a > b ? a : b;
+}
+
+static enum piglit_result
+draw(Display *dpy)
+{
+   struct omlTriple old = {.ust = 0xd0, .msc = 0xd0, .sbc = 0xd0};
+   struct omlTriple new = {.ust = 0xd0, .msc = 0xd0, .sbc = 0xd0};
+   int64_t target_sbc = 0;
+   int i;
+   int32_t rate_num, rate_den;
+   double timeout;
+
+   if (!glXGetMscRateOML(dpy, win, &rate_num, &rate_den)) {
+   timeout = 1.0 / 10; /* Assume MSC rate is at least 10Hz */
+   } else {
+   timeout = (double) rate_den / rate_num;
+   }
+
+   timeout *= loops * max(1, max(target_msc_delta, divisor));
+   piglit_set_timeout(timeout * 2, PIGLIT_FAIL); /* Safety factor 2 */
+
+   i

[Piglit] [PATCH 6/9] Allow OML_sync_control tests to run fullscreen.

2014-04-23 Thread Jamey Sharp
None of the current tests use this, but we introduce some fullscreen
tests in the next commit.

Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/spec/glx_oml_sync_control/common.c  | 7 +--
 tests/spec/glx_oml_sync_control/common.h  | 2 +-
 tests/spec/glx_oml_sync_control/getmscrate.c  | 2 +-
 tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c | 2 +-
 tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c   | 2 +-
 tests/spec/glx_oml_sync_control/waitformsc.c  | 2 +-
 6 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/spec/glx_oml_sync_control/common.c 
b/tests/spec/glx_oml_sync_control/common.c
index b83e886..320c5d0 100644
--- a/tests/spec/glx_oml_sync_control/common.c
+++ b/tests/spec/glx_oml_sync_control/common.c
@@ -53,7 +53,7 @@ Window win;
 XVisualInfo *visinfo;
 
 void
-piglit_oml_sync_control_test_run(enum piglit_result (*draw)(Display *dpy))
+piglit_oml_sync_control_test_run(bool fullscreen, enum piglit_result 
(*draw)(Display *dpy))
 {
Display *dpy;
GLXContext ctx;
@@ -68,7 +68,10 @@ piglit_oml_sync_control_test_run(enum piglit_result 
(*draw)(Display *dpy))
piglit_glx_get_all_proc_addresses(procs, ARRAY_SIZE(procs));
 
visinfo = piglit_get_glx_visual(dpy);
-   win = piglit_get_glx_window(dpy, visinfo);
+   if (fullscreen)
+   win = piglit_get_glx_window_fullscreen(dpy, visinfo);
+   else
+   win = piglit_get_glx_window(dpy, visinfo);
ctx = piglit_get_glx_context(dpy, visinfo);
glXMakeCurrent(dpy, win, ctx);
 
diff --git a/tests/spec/glx_oml_sync_control/common.h 
b/tests/spec/glx_oml_sync_control/common.h
index 40ef4a3..3a6a08b 100644
--- a/tests/spec/glx_oml_sync_control/common.h
+++ b/tests/spec/glx_oml_sync_control/common.h
@@ -13,4 +13,4 @@ extern PFNGLXWAITFORSBCOMLPROC __piglit_glXWaitForSbcOML;
 extern Window win;
 extern XVisualInfo *visinfo;
 
-void piglit_oml_sync_control_test_run(enum piglit_result (*draw)(Display 
*dpy));
+void piglit_oml_sync_control_test_run(bool fullscreen, enum piglit_result 
(*draw)(Display *dpy));
diff --git a/tests/spec/glx_oml_sync_control/getmscrate.c 
b/tests/spec/glx_oml_sync_control/getmscrate.c
index c18ea49..bfb0cda 100644
--- a/tests/spec/glx_oml_sync_control/getmscrate.c
+++ b/tests/spec/glx_oml_sync_control/getmscrate.c
@@ -82,7 +82,7 @@ draw(Display *dpy)
 int
 main(int argc, char **argv)
 {
-   piglit_oml_sync_control_test_run(draw);
+   piglit_oml_sync_control_test_run(false, draw);
 
return 0;
 }
diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
index 555f551..d83905c 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-divisor-zero.c
@@ -137,7 +137,7 @@ wrap:
 int
 main(int argc, char **argv)
 {
-   piglit_oml_sync_control_test_run(draw);
+   piglit_oml_sync_control_test_run(false, draw);
 
return 0;
 }
diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
index 2f31fbf..a37fc9a 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
@@ -113,7 +113,7 @@ main(int argc, char **argv)
swap_interval = atoi(argv[1]);
}
 
-   piglit_oml_sync_control_test_run(draw);
+   piglit_oml_sync_control_test_run(false, draw);
 
return 0;
 }
diff --git a/tests/spec/glx_oml_sync_control/waitformsc.c 
b/tests/spec/glx_oml_sync_control/waitformsc.c
index 6fdef6e..501ba42 100644
--- a/tests/spec/glx_oml_sync_control/waitformsc.c
+++ b/tests/spec/glx_oml_sync_control/waitformsc.c
@@ -96,7 +96,7 @@ wrap:
 int
 main(int argc, char **argv)
 {
-   piglit_oml_sync_control_test_run(draw);
+   piglit_oml_sync_control_test_run(false, draw);
 
return 0;
 }
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/9] Don't run GLX_OML_sync_control tests concurrently.

2014-04-23 Thread Jamey Sharp
This fixes the swapbuffersmsc-return (with default swap_interval) test,
by not passing it arguments that it doesn't understand.

These tests all require a GLXWindow, so they can't be used in -fbo mode
(and they didn't understand that option anyway).

And though they need the behavior of -auto, none of them parse that
option. These tests have to deal with it in other ways, as illustrated
by commit 1d618f2abbc9f9665505b7082690eebc3bc01a72.

Finally, I think it's a bad idea to run these tests concurrently with
anything else, as interference from other clients could change the
result of attempting to sync to vertical retrace, which is a
screen-global resource.

Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/all.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 49c801a..ccfa626 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -779,12 +779,12 @@ create_context_es2_profile['invalid OpenGL ES version'] = 
concurrent_test('glx-c
 
 oml_sync_control = {};
 glx['GLX_OML_sync_control'] = oml_sync_control
-oml_sync_control['glXGetMscRateOML'] = 
concurrent_test('glx-oml-sync-control-getmscrate')
-oml_sync_control['swapbuffersmsc-divisor-zero'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-divisor-zero')
-oml_sync_control['swapbuffersmsc-return'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return')
-oml_sync_control['swapbuffersmsc-return swap_interval 0'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return 0')
-oml_sync_control['swapbuffersmsc-return swap_interval 1'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return 1')
-oml_sync_control['waitformsc'] = 
concurrent_test('glx-oml-sync-control-waitformsc')
+oml_sync_control['glXGetMscRateOML'] = 
PiglitTest(['glx-oml-sync-control-getmscrate'])
+oml_sync_control['swapbuffersmsc-divisor-zero'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-divisor-zero'])
+oml_sync_control['swapbuffersmsc-return'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return'])
+oml_sync_control['swapbuffersmsc-return swap_interval 0'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return', '0'])
+oml_sync_control['swapbuffersmsc-return swap_interval 1'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return', '1'])
+oml_sync_control['waitformsc'] = 
PiglitTest(['glx-oml-sync-control-waitformsc'])
 
 mesa_query_renderer = {}
 glx['GLX_MESA_query_renderer'] = mesa_query_renderer
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 5/9] Add helper for creating full-screen glX windows.

2014-04-23 Thread Jamey Sharp
Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/util/piglit-glx-util.c | 22 ++
 tests/util/piglit-glx-util.h |  1 +
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-glx-util.c b/tests/util/piglit-glx-util.c
index 1faec8f..6ba4a1d 100644
--- a/tests/util/piglit-glx-util.c
+++ b/tests/util/piglit-glx-util.c
@@ -93,8 +93,8 @@ piglit_get_glx_context_share(Display *dpy, XVisualInfo 
*visinfo, GLXContext shar
return ctx;
 }
 
-Window
-_piglit_get_glx_window(Display *dpy, XVisualInfo *visinfo, bool map)
+static Window
+_piglit_get_glx_window(Display *dpy, XVisualInfo *visinfo, bool map, bool 
fullscreen)
 {
XSetWindowAttributes window_attr;
unsigned long mask;
@@ -109,6 +109,14 @@ _piglit_get_glx_window(Display *dpy, XVisualInfo *visinfo, 
bool map)
window_attr.event_mask = StructureNotifyMask | ExposureMask |
KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+   if (fullscreen) {
+   window_attr.override_redirect = True;
+   mask |= CWOverrideRedirect;
+   piglit_width = DisplayWidth(dpy, screen);
+   piglit_height = DisplayHeight(dpy, screen);
+   }
+
win = XCreateWindow(dpy, root_win, 0, 0,
piglit_width, piglit_height,
0, visinfo->depth, InputOutput,
@@ -126,13 +134,19 @@ _piglit_get_glx_window(Display *dpy, XVisualInfo 
*visinfo, bool map)
 Window
 piglit_get_glx_window_unmapped(Display *dpy, XVisualInfo *visinfo)
 {
-   return _piglit_get_glx_window(dpy, visinfo, false);
+   return _piglit_get_glx_window(dpy, visinfo, false, false);
+}
+
+Window
+piglit_get_glx_window_fullscreen(Display *dpy, XVisualInfo *visinfo)
+{
+   return _piglit_get_glx_window(dpy, visinfo, true, true);
 }
 
 Window
 piglit_get_glx_window(Display *dpy, XVisualInfo *visinfo)
 {
-   return _piglit_get_glx_window(dpy, visinfo, true);
+   return _piglit_get_glx_window(dpy, visinfo, true, false);
 }
 
 bool
diff --git a/tests/util/piglit-glx-util.h b/tests/util/piglit-glx-util.h
index aebed15..70c9838 100644
--- a/tests/util/piglit-glx-util.h
+++ b/tests/util/piglit-glx-util.h
@@ -40,6 +40,7 @@ XVisualInfo * piglit_get_glx_visual(Display *dpy);
 GLXContext piglit_get_glx_context(Display *dpy, XVisualInfo *visinfo);
 GLXContext piglit_get_glx_context_share(Display *dpy, XVisualInfo *visinfo, 
GLXContext share);
 Window piglit_get_glx_window(Display *dpy, XVisualInfo *visinfo);
+Window piglit_get_glx_window_fullscreen(Display *dpy, XVisualInfo *visinfo);
 Window piglit_get_glx_window_unmapped(Display *dpy, XVisualInfo *visinfo);
 bool piglit_is_glx_extension_supported(Display *dpy, const char *name);
 void piglit_require_glx_extension(Display *dpy, const char *name);
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/9] Simplify piglit_glx_get_all_proc_addresses API.

2014-04-23 Thread Jamey Sharp
I couldn't stand the number of ways this API could be misused and the
amount of code duplication it forced--two closely related issues.

This also fixes a bug: The "Failed to get function pointer" test could
never have triggered unless the caller passed incorrect arguments,
which is not the kind of error it was intended to be testing for.

Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/spec/glx_ext_import_context/common.c | 27 ++-
 tests/spec/glx_oml_sync_control/common.c   | 30 +++---
 tests/spec/glx_oml_sync_control/common.h   | 10 +-
 tests/util/piglit-glx-util.c   | 11 +--
 tests/util/piglit-glx-util.h   | 10 --
 5 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/tests/spec/glx_ext_import_context/common.c 
b/tests/spec/glx_ext_import_context/common.c
index 9048472..862dd36 100644
--- a/tests/spec/glx_ext_import_context/common.c
+++ b/tests/spec/glx_ext_import_context/common.c
@@ -31,6 +31,15 @@ PFNGLXGETCONTEXTIDEXTPROC __piglit_glXGetContextIDEXT = NULL;
 PFNGLXIMPORTCONTEXTEXTPROC __piglit_glXImportContextEXT = NULL;
 PFNGLXFREECONTEXTEXTPROC __piglit_glXFreeContextEXT = NULL;
 
+#define ADD_FUNC(name) PIGLIT_GLX_PROC(__piglit_##name, name)
+static const struct piglit_glx_proc_reference procedures[] = {
+   ADD_FUNC(glXGetCurrentDisplayEXT),
+   ADD_FUNC(glXQueryContextInfoEXT),
+   ADD_FUNC(glXGetContextIDEXT),
+   ADD_FUNC(glXImportContextEXT),
+   ADD_FUNC(glXFreeContextEXT),
+};
+
 Display *dpy = NULL;
 XVisualInfo *visinfo = NULL;
 GLXContext directCtx = NULL;
@@ -63,22 +72,6 @@ void GLX_EXT_import_context_setup_for_child(void)
 
 void GLX_EXT_import_context_setup(void)
 {
-   const char *const names[] = {
-   "glXGetCurrentDisplayEXT",
-   "glXQueryContextInfoEXT",
-   "glXGetContextIDEXT",
-   "glXImportContextEXT",
-   "glXFreeContextEXT"
-   };
-
-   __GLXextFuncPtr *procedures[ARRAY_SIZE(names)] = {
-   (__GLXextFuncPtr *) & __piglit_glXGetCurrentDisplayEXT,
-   (__GLXextFuncPtr *) & __piglit_glXQueryContextInfoEXT,
-   (__GLXextFuncPtr *) & __piglit_glXGetContextIDEXT,
-   (__GLXextFuncPtr *) & __piglit_glXImportContextEXT,
-   (__GLXextFuncPtr *) & __piglit_glXFreeContextEXT
-   };
-
const char *vendor;
 
dpy = piglit_get_glx_display();
@@ -113,7 +106,7 @@ void GLX_EXT_import_context_setup(void)
piglit_require_glx_extension(dpy, "GLX_EXT_import_context");
}
 
-   piglit_glx_get_all_proc_addresses(procedures, names, ARRAY_SIZE(names));
+   piglit_glx_get_all_proc_addresses(procedures, ARRAY_SIZE(procedures));
 
visinfo = piglit_get_glx_visual(dpy);
 
diff --git a/tests/spec/glx_oml_sync_control/common.c 
b/tests/spec/glx_oml_sync_control/common.c
index d5011a8..b83e886 100644
--- a/tests/spec/glx_oml_sync_control/common.c
+++ b/tests/spec/glx_oml_sync_control/common.c
@@ -39,6 +39,16 @@ PFNGLXGETMSCRATEOMLPROC __piglit_glXGetMscRateOML;
 PFNGLXSWAPBUFFERSMSCOMLPROC __piglit_glXSwapBuffersMscOML;
 PFNGLXWAITFORMSCOMLPROC __piglit_glXWaitForMscOML;
 PFNGLXWAITFORSBCOMLPROC __piglit_glXWaitForSbcOML;
+
+#define ADD_FUNC(name) PIGLIT_GLX_PROC(__piglit_##name, name)
+static const struct piglit_glx_proc_reference procs[] = {
+   ADD_FUNC(glXGetSyncValuesOML),
+   ADD_FUNC(glXGetMscRateOML),
+   ADD_FUNC(glXSwapBuffersMscOML),
+   ADD_FUNC(glXWaitForMscOML),
+   ADD_FUNC(glXWaitForSbcOML),
+};
+
 Window win;
 XVisualInfo *visinfo;
 
@@ -47,24 +57,6 @@ piglit_oml_sync_control_test_run(enum piglit_result 
(*draw)(Display *dpy))
 {
Display *dpy;
GLXContext ctx;
-   const int proc_count = 5;
-   __GLXextFuncPtr *procs[proc_count];
-   const char *names[proc_count];
-   int i;
-
-#define ADD_FUNC(name) \
-   do {\
-   procs[i] = (__GLXextFuncPtr *)&(__piglit_##name);   \
-   names[i] = #name;   \
-   i++;\
-   } while (0)
-
-   i = 0;
-   ADD_FUNC(glXGetSyncValuesOML);
-   ADD_FUNC(glXGetMscRateOML);
-   ADD_FUNC(glXSwapBuffersMscOML);
-   ADD_FUNC(glXWaitForMscOML);
-   ADD_FUNC(glXWaitForSbcOML);
 
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
@@ -73,7 +65,7 @@ piglit_oml_sync_control_test_run(enum piglit_result 
(*draw)(Display *dpy))
}
 
piglit_require_glx_extension(dpy, "GLX_OML_sync_control");
-   piglit_glx_get_all_proc_addresses(procs, names, ARRAY_SIZE(procs));
+   piglit_glx_

Re: [Piglit] [PATCH 2/2] EGL_CHROMIUM_get_sync_values: Add conformance test.

2014-04-18 Thread Jamey Sharp
I'm no expert on OML_sync_control, but in a funny coincidence I've
been reading that spec and Xorg's DRI2 implementation of it pretty
carefully recently. (I blame keithp.)

In test_eglGetSyncValuesCHROMIUM_msc_and_sbc_test, I think what the
spec allows and requires might be a little different than what's
tested, although I'm not sure.

- I don't see that MSC has to change at all even after two
eglSwapBuffers calls, if SwapBuffers doesn't sync to vertical retrace.
I think you can test this by setting the DRI config option
vblank_mode=0 when you run your Piglit test. (I've read that you can
set that as an environment variable but I can't find code in Mesa that
would do that, so maybe you have to use drirc.)

- I'm not sure how you can ensure any SwapBuffers calls completed
without using any of GLX_OML_sync_control, GLX_INTEL_swap_event, or
implementation-specific knowledge. It isn't obvious to me that
eglSwapBuffers can be relied on to throttle the client, even on a
specific implementation like Xorg/DRI2. (Again, perhaps with
vblank_mode=0; I'd expect turning off vsync to also turn off
throttling.)

And of course I'd be curious to know why ChromeOS wants GetSyncValues
without any of the APIs that make those values meaningful, but that
isn't a question that unit testing can answer. ;-)

All my confusion aside, this seems like a fine set of tests for this extension.

Jamey

On Fri, Apr 18, 2014 at 3:37 PM, Sarah Sharp
 wrote:
> Test the EGL_CHROMIUM_get_sync_values extension, which is equivalent to
> the glXGetSyncValuesOML function in the GLX OML_sync_control extension:
>
> http://www.opengl.org/registry/specs/OML/glx_sync_control.txt
>
> It's difficult to test the Media Stream Counter (MSC) without the
> equivalent function to get the MSC rate (glXGetMscRateOML).  The test at
> least makes sure MSC and SBC increment after two SwapBuffers() calls.
> UST is system-dependent, so it may behave differently on Windows, Linux,
> and Apple.  The test just makes sure it increments monotonically.
>
> The test uses Chad's new subtest infrastructure and the EGL convenience
> functions from egl-util.c.
>
> Signed-off-by: Sarah Sharp 
> Cc: Chad Versace 
> Cc: Rob Bradford 
> ---
>  tests/all.py   |   4 +
>  tests/egl/spec/CMakeLists.txt  |   1 +
>  .../CMakeLists.gles2.txt   |   7 +
>  .../egl_chromium_get_sync_values/CMakeLists.txt|   1 +
>  .../egl_chromium_get_sync_values.c | 278 
> +
>  5 files changed, 291 insertions(+)
>  create mode 100644 
> tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.gles2.txt
>  create mode 100644 tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.txt
>  create mode 100644 
> tests/egl/spec/egl_chromium_get_sync_values/egl_chromium_get_sync_values.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 49c801a..439cd02 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -3835,6 +3835,10 @@ egl_khr_fence_sync = {}
>  spec['EGL_KHR_fence_sync'] = egl_khr_fence_sync
>  egl_khr_fence_sync['conformance'] = concurrent_test('egl_khr_fence_sync')
>
> +egl_chromium_get_sync_values = {}
> +spec['EGL_CHROMIUM_get_sync_values'] = egl_chromium_get_sync_values
> +egl_chromium_get_sync_values['conformance'] = 
> concurrent_test('egl_chromium_get_sync_values')
> +
>  gles20 = {}
>  spec['!OpenGL ES 2.0'] = gles20
>  gles20['glsl-fs-pointcoord'] = concurrent_test('glsl-fs-pointcoord_gles2')
> diff --git a/tests/egl/spec/CMakeLists.txt b/tests/egl/spec/CMakeLists.txt
> index 84c3fa0..ac3fe9c 100644
> --- a/tests/egl/spec/CMakeLists.txt
> +++ b/tests/egl/spec/CMakeLists.txt
> @@ -2,3 +2,4 @@ add_subdirectory (egl-1.4)
>  add_subdirectory (egl_ext_client_extensions)
>  add_subdirectory (egl_khr_create_context)
>  add_subdirectory (egl_khr_fence_sync)
> +add_subdirectory (egl_chromium_get_sync_values)
> diff --git a/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.gles2.txt 
> b/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.gles2.txt
> new file mode 100644
> index 000..d707647
> --- /dev/null
> +++ b/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.gles2.txt
> @@ -0,0 +1,7 @@
> +link_libraries(
> +   piglitutil_${piglit_target_api}
> +)
> +
> +piglit_add_executable(egl_chromium_get_sync_values ../../egl-util.c 
> egl_chromium_get_sync_values.c)
> +
> +# vim: ft=cmake:
> diff --git a/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.txt 
> b/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.txt
> new file mode 100644
> index 000..144a306
> --- /dev/null
> +++ b/tests/egl/spec/egl_chromium_get_sync_values/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git 
> a/tests/egl/spec/egl_chromium_get_sync_values/egl_chromium_get_sync_values.c 
> b/tests/egl/spec/egl_chromium_get_sync_values/egl_chromium_get_sync_values.c
> new file mode 100644
> index 000..adb26aa
> --- /dev/null
> +++ 
> b/tests/egl/spec/egl_chromium_get_

[Piglit] [PATCH] Only test non-default swap_interval if supported.

2014-04-18 Thread Jamey Sharp
If this test is compiled on a machine that does not have headers for
GLX_MESA_swap_control, then it should skip any tests that require using
GLX_MESA_swap_control.

I tested this patch in both configurations, using "#if 0 && ..." to
check the unsupported-at-build-time case.

Signed-off-by: Jamey Sharp 
---
 tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c 
b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
index 92f34ea..2f31fbf 100644
--- a/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
+++ b/tests/spec/glx_oml_sync_control/swapbuffersmsc-return.c
@@ -51,8 +51,8 @@ draw(Display *dpy)
bool pass = true;
int i;
 
-#if defined(GLX_MESA_swap_control)
if (swap_interval != -1) {
+#if defined(GLX_MESA_swap_control)
PFNGLXSWAPINTERVALMESAPROC pglXSwapIntervalMESA;
 
printf("Testing with swap interval %d\n", swap_interval);
@@ -62,12 +62,15 @@ draw(Display *dpy)
glXGetProcAddressARB((const GLubyte *)
 "glXSwapIntervalMESA");
pglXSwapIntervalMESA(swap_interval);
+#else
+   fprintf(stderr,
+   "Testing swap interval %d requires building with 
GLX_MESA_swap_control\n",
+   swap_interval);
+   piglit_report_result(PIGLIT_SKIP);
+#endif
} else {
printf("Testing with default swap interval\n");
}
-#else
-   printf("Testing with default swap interval\n");
-#endif
 
glXGetSyncValuesOML(dpy, win, &start_ust, &start_msc, &start_sbc);
if (start_sbc != 0) {
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Simplify piglit_glx_get_all_proc_addresses API.

2014-04-18 Thread Jamey Sharp
I couldn't stand the number of ways this API could be misused and the
amount of code duplication it forced--two closely related issues.

This also fixes a bug: The "Failed to get function pointer" test could
never have triggered unless the caller passed incorrect arguments,
which is not the kind of error it was intended to be testing for.

Signed-off-by: Jamey Sharp 
---
 tests/spec/glx_ext_import_context/common.c | 27 ++-
 tests/spec/glx_oml_sync_control/common.c   | 30 +++---
 tests/spec/glx_oml_sync_control/common.h   | 10 +-
 tests/util/piglit-glx-util.c   | 11 +--
 tests/util/piglit-glx-util.h   | 10 --
 5 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/tests/spec/glx_ext_import_context/common.c 
b/tests/spec/glx_ext_import_context/common.c
index 9048472..862dd36 100644
--- a/tests/spec/glx_ext_import_context/common.c
+++ b/tests/spec/glx_ext_import_context/common.c
@@ -31,6 +31,15 @@ PFNGLXGETCONTEXTIDEXTPROC __piglit_glXGetContextIDEXT = NULL;
 PFNGLXIMPORTCONTEXTEXTPROC __piglit_glXImportContextEXT = NULL;
 PFNGLXFREECONTEXTEXTPROC __piglit_glXFreeContextEXT = NULL;
 
+#define ADD_FUNC(name) PIGLIT_GLX_PROC(__piglit_##name, name)
+static const struct piglit_glx_proc_reference procedures[] = {
+   ADD_FUNC(glXGetCurrentDisplayEXT),
+   ADD_FUNC(glXQueryContextInfoEXT),
+   ADD_FUNC(glXGetContextIDEXT),
+   ADD_FUNC(glXImportContextEXT),
+   ADD_FUNC(glXFreeContextEXT),
+};
+
 Display *dpy = NULL;
 XVisualInfo *visinfo = NULL;
 GLXContext directCtx = NULL;
@@ -63,22 +72,6 @@ void GLX_EXT_import_context_setup_for_child(void)
 
 void GLX_EXT_import_context_setup(void)
 {
-   const char *const names[] = {
-   "glXGetCurrentDisplayEXT",
-   "glXQueryContextInfoEXT",
-   "glXGetContextIDEXT",
-   "glXImportContextEXT",
-   "glXFreeContextEXT"
-   };
-
-   __GLXextFuncPtr *procedures[ARRAY_SIZE(names)] = {
-   (__GLXextFuncPtr *) & __piglit_glXGetCurrentDisplayEXT,
-   (__GLXextFuncPtr *) & __piglit_glXQueryContextInfoEXT,
-   (__GLXextFuncPtr *) & __piglit_glXGetContextIDEXT,
-   (__GLXextFuncPtr *) & __piglit_glXImportContextEXT,
-   (__GLXextFuncPtr *) & __piglit_glXFreeContextEXT
-   };
-
const char *vendor;
 
dpy = piglit_get_glx_display();
@@ -113,7 +106,7 @@ void GLX_EXT_import_context_setup(void)
piglit_require_glx_extension(dpy, "GLX_EXT_import_context");
}
 
-   piglit_glx_get_all_proc_addresses(procedures, names, ARRAY_SIZE(names));
+   piglit_glx_get_all_proc_addresses(procedures, ARRAY_SIZE(procedures));
 
visinfo = piglit_get_glx_visual(dpy);
 
diff --git a/tests/spec/glx_oml_sync_control/common.c 
b/tests/spec/glx_oml_sync_control/common.c
index d5011a8..b83e886 100644
--- a/tests/spec/glx_oml_sync_control/common.c
+++ b/tests/spec/glx_oml_sync_control/common.c
@@ -39,6 +39,16 @@ PFNGLXGETMSCRATEOMLPROC __piglit_glXGetMscRateOML;
 PFNGLXSWAPBUFFERSMSCOMLPROC __piglit_glXSwapBuffersMscOML;
 PFNGLXWAITFORMSCOMLPROC __piglit_glXWaitForMscOML;
 PFNGLXWAITFORSBCOMLPROC __piglit_glXWaitForSbcOML;
+
+#define ADD_FUNC(name) PIGLIT_GLX_PROC(__piglit_##name, name)
+static const struct piglit_glx_proc_reference procs[] = {
+   ADD_FUNC(glXGetSyncValuesOML),
+   ADD_FUNC(glXGetMscRateOML),
+   ADD_FUNC(glXSwapBuffersMscOML),
+   ADD_FUNC(glXWaitForMscOML),
+   ADD_FUNC(glXWaitForSbcOML),
+};
+
 Window win;
 XVisualInfo *visinfo;
 
@@ -47,24 +57,6 @@ piglit_oml_sync_control_test_run(enum piglit_result 
(*draw)(Display *dpy))
 {
Display *dpy;
GLXContext ctx;
-   const int proc_count = 5;
-   __GLXextFuncPtr *procs[proc_count];
-   const char *names[proc_count];
-   int i;
-
-#define ADD_FUNC(name) \
-   do {\
-   procs[i] = (__GLXextFuncPtr *)&(__piglit_##name);   \
-   names[i] = #name;   \
-   i++;\
-   } while (0)
-
-   i = 0;
-   ADD_FUNC(glXGetSyncValuesOML);
-   ADD_FUNC(glXGetMscRateOML);
-   ADD_FUNC(glXSwapBuffersMscOML);
-   ADD_FUNC(glXWaitForMscOML);
-   ADD_FUNC(glXWaitForSbcOML);
 
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
@@ -73,7 +65,7 @@ piglit_oml_sync_control_test_run(enum piglit_result 
(*draw)(Display *dpy))
}
 
piglit_require_glx_extension(dpy, "GLX_OML_sync_control");
-   piglit_glx_get_all_proc_addresses(procs, names, ARRAY_SIZE(procs));
+   piglit_glx_get_all_proc_addresses(procs, ARRAY_SIZE(pro

[Piglit] [PATCH] Don't run GLX_OML_sync_control tests concurrently.

2014-04-18 Thread Jamey Sharp
This fixes the swapbuffersmsc-return (with default swap_interval) test,
by not passing it arguments that it doesn't understand.

These tests all require a GLXWindow, so they can't be used in -fbo mode
(and they didn't understand that option anyway).

And though they need the behavior of -auto, none of them parse that
option. These tests have to deal with it in other ways, as illustrated
by commit 1d618f2abbc9f9665505b7082690eebc3bc01a72.

Finally, I think it's a bad idea to run these tests concurrently with
anything else, as interference from other clients could change the
result of attempting to sync to vertical retrace, which is a
screen-global resource.

Signed-off-by: Jamey Sharp 
Signed-off-by: Theo Hill 
---
 tests/all.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 42be8f4..846973a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -779,12 +779,12 @@ create_context_es2_profile['invalid OpenGL ES version'] = 
concurrent_test('glx-c
 
 oml_sync_control = {};
 glx['GLX_OML_sync_control'] = oml_sync_control
-oml_sync_control['glXGetMscRateOML'] = 
concurrent_test('glx-oml-sync-control-getmscrate')
-oml_sync_control['swapbuffersmsc-divisor-zero'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-divisor-zero')
-oml_sync_control['swapbuffersmsc-return'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return')
-oml_sync_control['swapbuffersmsc-return swap_interval 0'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return 0')
-oml_sync_control['swapbuffersmsc-return swap_interval 1'] = 
concurrent_test('glx-oml-sync-control-swapbuffersmsc-return 1')
-oml_sync_control['waitformsc'] = 
concurrent_test('glx-oml-sync-control-waitformsc')
+oml_sync_control['glXGetMscRateOML'] = 
PiglitTest(['glx-oml-sync-control-getmscrate'])
+oml_sync_control['swapbuffersmsc-divisor-zero'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-divisor-zero'])
+oml_sync_control['swapbuffersmsc-return'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return'])
+oml_sync_control['swapbuffersmsc-return swap_interval 0'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return', '0'])
+oml_sync_control['swapbuffersmsc-return swap_interval 1'] = 
PiglitTest(['glx-oml-sync-control-swapbuffersmsc-return', '1'])
+oml_sync_control['waitformsc'] = 
PiglitTest(['glx-oml-sync-control-waitformsc'])
 
 mesa_query_renderer = {}
 glx['GLX_MESA_query_renderer'] = mesa_query_renderer
-- 
1.8.5.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit