Re: [Piglit] [PATCH] glsl-1.50: add linker test for unused in out blocks

2017-07-14 Thread Józef Kucia
On Tue, May 30, 2017 at 4:23 PM, Józef Kucia  wrote:
> This test exposes a Mesa GLSL linker bug. The test fails with the
> following error message:
>
>   error: Input block `blk' is not an output of the previous stage
>
> Section 4.3.4 (Inputs) of the GLSL 1.50 spec says:
>
> "Only the input variables that are actually read need to be written
> by the previous stage; it is allowed to have superfluous
> declarations of input variables."
> ---
>  .../interstage-multiple-shader-objects.shader_test | 38 
> ++
>  1 file changed, 38 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test

Ping. Could someone take a look?
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] clipflat: refactor some code

2017-07-14 Thread Neha Bhende
Looks good.


Reviewed-by : Neha Bhende 


Thanks,

Neha


From: Brian Paul 
Sent: Friday, July 14, 2017 9:06:17 AM
To: piglit@lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende; Brian Paul
Subject: [PATCH] clipflat: refactor some code

Pull the innermost code out of testPrim() into a new function.
This can make things a little easier for hacking/debugging.

Also, print whether PV control is supported and whether quads follow
the PV convention.
---
 tests/general/clipflat.c | 121 +++
 1 file changed, 71 insertions(+), 50 deletions(-)

diff --git a/tests/general/clipflat.c b/tests/general/clipflat.c
index 1820418..2608d28 100644
--- a/tests/general/clipflat.c
+++ b/tests/general/clipflat.c
@@ -209,10 +209,16 @@ piglit_init(int argc, char **argv)
 provoking_vertex_first = true;
 }

+   printf("Have GL_ARB/EXT_provoking_vertex: %s\n",
+  provoking_vertex_first ? "yes" : "no");
+
 if (provoking_vertex_first) {
 GLboolean k;
 glGetBooleanv(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT, 
);
 quads_follows_pv_convention = k;
+
+   printf("Quads follow provoking vertex convention: %s\n",
+  k ? "yes" : "no");
 }
 }

@@ -443,11 +449,72 @@ reportSubtest(GLenum mode, int drawMode, GLuint facing,
 }


-// Test a particular primitive mode
+// Test a particular primitive mode for one drawing mode, filled/unfilled
+// state and CW/CCW winding.
 static bool
-testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+testPrimCombo(GLenum mode, const GLfloat *verts, GLuint count,
+ bool fill, enum draw_mode drawMode, GLuint facing)
 {
 GLfloat x, y;
+   bool pass = true;
+
+   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
+
+   if (facing == 0) {
+   glFrontFace(GL_CCW);
+   glCullFace(GL_BACK);
+   }
+   else {
+   glFrontFace(GL_CW);
+   glCullFace(GL_FRONT);
+   }
+
+   // Position the geometry at 9 different locations to test
+   // clipping against the left, right, bottom and top edges of
+   // the window.
+   // Only the center location will be unclipped.
+   for (y = -1.0; y <= 1.0; y += 1.0) {
+   for (x = -1.0; x <= 1.0; x += 1.0) {
+   bool quad_pass;
+   GLfloat badColor[3];
+
+   glPushMatrix();
+   glTranslatef(x, y, 0.0);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   switch (drawMode) {
+   case BEGIN_END:
+   drawBeginEnd(mode, verts, count);
+   break;
+   case DRAW_ARRAYS:
+   drawArrays(mode, verts, count);
+   break;
+   case DRAW_ELEMENTS:
+   drawElements(mode, verts, count);
+   break;
+   default:
+   assert(0);
+   }
+
+   glPopMatrix();
+
+   quad_pass = checkResult(badColor);
+   pass = pass && quad_pass;
+   reportSubtest(mode, drawMode, facing, fill,
+ badColor, x, y, quad_pass);
+   }
+   }
+
+   return pass;
+}
+
+
+// Test a particular primitive mode for all drawing modes, filled/unfilled
+// and CW/CCW winding.
+static bool
+testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+{
 GLuint facing, fill;
 int drawMode;
 bool pass = true;
@@ -455,59 +522,13 @@ testPrim(GLenum mode, const GLfloat *verts, GLuint count)
 // Loop over polygon mode: filled vs. outline
 for (fill = 0; fill < 2; fill++) {

-   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
-
 // Loop over drawing mode: glBegin/End vs glDrawArrays vs 
glDrawElements
 for (drawMode = 0; drawMode < NUM_DRAW_MODES; drawMode++) {

 // Loop over CW vs. CCW winding (should make no 
difference)
 for (facing = 0; facing < 2; facing++) {
-
-   if (facing == 0) {
-   glFrontFace(GL_CCW);
-   glCullFace(GL_BACK);
-   }
-   else {
-   glFrontFace(GL_CW);
-   glCullFace(GL_FRONT);
-   }
-
-   // Position the geometry at 9 different 
locations to test
-  

Re: [Piglit] [PATCH] clipflat: refactor some code

2017-07-14 Thread Charmaine Lee

Reviewed-by: Charmaine Lee 


From: Brian Paul 
Sent: Friday, July 14, 2017 9:06 AM
To: piglit@lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende; Brian Paul
Subject: [PATCH] clipflat: refactor some code

Pull the innermost code out of testPrim() into a new function.
This can make things a little easier for hacking/debugging.

Also, print whether PV control is supported and whether quads follow
the PV convention.
---
 tests/general/clipflat.c | 121 +++
 1 file changed, 71 insertions(+), 50 deletions(-)

diff --git a/tests/general/clipflat.c b/tests/general/clipflat.c
index 1820418..2608d28 100644
--- a/tests/general/clipflat.c
+++ b/tests/general/clipflat.c
@@ -209,10 +209,16 @@ piglit_init(int argc, char **argv)
provoking_vertex_first = true;
}

+   printf("Have GL_ARB/EXT_provoking_vertex: %s\n",
+  provoking_vertex_first ? "yes" : "no");
+
if (provoking_vertex_first) {
GLboolean k;
glGetBooleanv(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT, 
);
quads_follows_pv_convention = k;
+
+   printf("Quads follow provoking vertex convention: %s\n",
+  k ? "yes" : "no");
}
 }

@@ -443,11 +449,72 @@ reportSubtest(GLenum mode, int drawMode, GLuint facing,
 }


-// Test a particular primitive mode
+// Test a particular primitive mode for one drawing mode, filled/unfilled
+// state and CW/CCW winding.
 static bool
-testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+testPrimCombo(GLenum mode, const GLfloat *verts, GLuint count,
+ bool fill, enum draw_mode drawMode, GLuint facing)
 {
GLfloat x, y;
+   bool pass = true;
+
+   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
+
+   if (facing == 0) {
+   glFrontFace(GL_CCW);
+   glCullFace(GL_BACK);
+   }
+   else {
+   glFrontFace(GL_CW);
+   glCullFace(GL_FRONT);
+   }
+
+   // Position the geometry at 9 different locations to test
+   // clipping against the left, right, bottom and top edges of
+   // the window.
+   // Only the center location will be unclipped.
+   for (y = -1.0; y <= 1.0; y += 1.0) {
+   for (x = -1.0; x <= 1.0; x += 1.0) {
+   bool quad_pass;
+   GLfloat badColor[3];
+
+   glPushMatrix();
+   glTranslatef(x, y, 0.0);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   switch (drawMode) {
+   case BEGIN_END:
+   drawBeginEnd(mode, verts, count);
+   break;
+   case DRAW_ARRAYS:
+   drawArrays(mode, verts, count);
+   break;
+   case DRAW_ELEMENTS:
+   drawElements(mode, verts, count);
+   break;
+   default:
+   assert(0);
+   }
+
+   glPopMatrix();
+
+   quad_pass = checkResult(badColor);
+   pass = pass && quad_pass;
+   reportSubtest(mode, drawMode, facing, fill,
+ badColor, x, y, quad_pass);
+   }
+   }
+
+   return pass;
+}
+
+
+// Test a particular primitive mode for all drawing modes, filled/unfilled
+// and CW/CCW winding.
+static bool
+testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+{
GLuint facing, fill;
int drawMode;
bool pass = true;
@@ -455,59 +522,13 @@ testPrim(GLenum mode, const GLfloat *verts, GLuint count)
// Loop over polygon mode: filled vs. outline
for (fill = 0; fill < 2; fill++) {

-   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
-
// Loop over drawing mode: glBegin/End vs glDrawArrays vs 
glDrawElements
for (drawMode = 0; drawMode < NUM_DRAW_MODES; drawMode++) {

// Loop over CW vs. CCW winding (should make no 
difference)
for (facing = 0; facing < 2; facing++) {
-
-   if (facing == 0) {
-   glFrontFace(GL_CCW);
-   glCullFace(GL_BACK);
-   }
-   else {
-   glFrontFace(GL_CW);
-   glCullFace(GL_FRONT);
-   }
-
-   // Position the geometry at 9 different 
locations to test
-   // clipping against the left, 

Re: [Piglit] [PATCH] Remove a useless GLU depedency

2017-07-14 Thread Brian Paul


Reviewed-by: Brian Paul 


On 07/14/2017 10:07 AM, Marek Olšák wrote:

From: Marek Olšák 

---
  tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt   | 1 -
  tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt | 1 -
  2 files changed, 2 deletions(-)

diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt 
b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
index 276fa52..e690a98 100644
--- a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
+++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
@@ -1,15 +1,14 @@
  include_directories(
${GLEXT_INCLUDE_DIR}
${OPENGL_INCLUDE_PATH}
${piglit_SOURCE_DIR}/tests/util
  )

  link_libraries (
piglitutil_${piglit_target_api}
${OPENGL_gl_LIBRARY}
-   ${OPENGL_glu_LIBRARY}
  )

  piglit_add_executable (arb_arrays_of_arrays-max-binding max-binding.c)

  # vim: ft=cmake:
diff --git a/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
index 8dd026f..06655f8 100644
--- a/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
@@ -1,15 +1,14 @@
  include_directories(
 ${GLEXT_INCLUDE_DIR}
 ${OPENGL_INCLUDE_PATH}
  )

  link_libraries (
 piglitutil_${piglit_target_api}
 ${OPENGL_gl_LIBRARY}
-   ${OPENGL_glu_LIBRARY}
  )

  piglit_add_executable (arb_gpu_shader_fp64-layout-std140-fp64-shader 
layout-std140-fp64-shader.c)
  piglit_add_executable (arb_gpu_shader_fp64-layout-std140-fp64-mixed-shader 
layout-std140-fp64-mixed-shader.c)
  piglit_add_executable (arb_gpu_shader_fp64-layout-std430-fp64-shader 
layout-std430-fp64-shader.c)
  piglit_add_executable (arb_gpu_shader_fp64-layout-std430-fp64-mixed-shader 
layout-std430-fp64-mixed-shader.c)



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


[Piglit] [PATCH] Remove a useless GLU depedency

2017-07-14 Thread Marek Olšák
From: Marek Olšák 

---
 tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt   | 1 -
 tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt | 1 -
 2 files changed, 2 deletions(-)

diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt 
b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
index 276fa52..e690a98 100644
--- a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
+++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt
@@ -1,15 +1,14 @@
 include_directories(
${GLEXT_INCLUDE_DIR}
${OPENGL_INCLUDE_PATH}
${piglit_SOURCE_DIR}/tests/util
 )
 
 link_libraries (
piglitutil_${piglit_target_api}
${OPENGL_gl_LIBRARY}
-   ${OPENGL_glu_LIBRARY}
 )
 
 piglit_add_executable (arb_arrays_of_arrays-max-binding max-binding.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
index 8dd026f..06655f8 100644
--- a/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/shader_storage/CMakeLists.gl.txt
@@ -1,15 +1,14 @@
 include_directories(
${GLEXT_INCLUDE_DIR}
${OPENGL_INCLUDE_PATH}
 )
 
 link_libraries (
piglitutil_${piglit_target_api}
${OPENGL_gl_LIBRARY}
-   ${OPENGL_glu_LIBRARY}
 )
 
 piglit_add_executable (arb_gpu_shader_fp64-layout-std140-fp64-shader 
layout-std140-fp64-shader.c)
 piglit_add_executable (arb_gpu_shader_fp64-layout-std140-fp64-mixed-shader 
layout-std140-fp64-mixed-shader.c)
 piglit_add_executable (arb_gpu_shader_fp64-layout-std430-fp64-shader 
layout-std430-fp64-shader.c)
 piglit_add_executable (arb_gpu_shader_fp64-layout-std430-fp64-mixed-shader 
layout-std430-fp64-mixed-shader.c)
-- 
2.7.4

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


[Piglit] [PATCH] clipflat: refactor some code

2017-07-14 Thread Brian Paul
Pull the innermost code out of testPrim() into a new function.
This can make things a little easier for hacking/debugging.

Also, print whether PV control is supported and whether quads follow
the PV convention.
---
 tests/general/clipflat.c | 121 +++
 1 file changed, 71 insertions(+), 50 deletions(-)

diff --git a/tests/general/clipflat.c b/tests/general/clipflat.c
index 1820418..2608d28 100644
--- a/tests/general/clipflat.c
+++ b/tests/general/clipflat.c
@@ -209,10 +209,16 @@ piglit_init(int argc, char **argv)
provoking_vertex_first = true;
}
 
+   printf("Have GL_ARB/EXT_provoking_vertex: %s\n",
+  provoking_vertex_first ? "yes" : "no");
+
if (provoking_vertex_first) {
GLboolean k;
glGetBooleanv(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT, 
);
quads_follows_pv_convention = k;
+
+   printf("Quads follow provoking vertex convention: %s\n",
+  k ? "yes" : "no");
}
 }
 
@@ -443,11 +449,72 @@ reportSubtest(GLenum mode, int drawMode, GLuint facing,
 }
 
 
-// Test a particular primitive mode
+// Test a particular primitive mode for one drawing mode, filled/unfilled
+// state and CW/CCW winding.
 static bool
-testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+testPrimCombo(GLenum mode, const GLfloat *verts, GLuint count,
+ bool fill, enum draw_mode drawMode, GLuint facing)
 {
GLfloat x, y;
+   bool pass = true;
+
+   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
+
+   if (facing == 0) {
+   glFrontFace(GL_CCW);
+   glCullFace(GL_BACK);
+   }
+   else {
+   glFrontFace(GL_CW);
+   glCullFace(GL_FRONT);
+   }
+
+   // Position the geometry at 9 different locations to test
+   // clipping against the left, right, bottom and top edges of
+   // the window.
+   // Only the center location will be unclipped.
+   for (y = -1.0; y <= 1.0; y += 1.0) {
+   for (x = -1.0; x <= 1.0; x += 1.0) {
+   bool quad_pass;
+   GLfloat badColor[3];
+
+   glPushMatrix();
+   glTranslatef(x, y, 0.0);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   switch (drawMode) {
+   case BEGIN_END:
+   drawBeginEnd(mode, verts, count);
+   break;
+   case DRAW_ARRAYS:
+   drawArrays(mode, verts, count);
+   break;
+   case DRAW_ELEMENTS:
+   drawElements(mode, verts, count);
+   break;
+   default:
+   assert(0);
+   }
+
+   glPopMatrix();
+
+   quad_pass = checkResult(badColor);
+   pass = pass && quad_pass;
+   reportSubtest(mode, drawMode, facing, fill,
+ badColor, x, y, quad_pass);
+   }
+   }
+
+   return pass;
+}
+
+
+// Test a particular primitive mode for all drawing modes, filled/unfilled
+// and CW/CCW winding.
+static bool
+testPrim(GLenum mode, const GLfloat *verts, GLuint count)
+{
GLuint facing, fill;
int drawMode;
bool pass = true;
@@ -455,59 +522,13 @@ testPrim(GLenum mode, const GLfloat *verts, GLuint count)
// Loop over polygon mode: filled vs. outline
for (fill = 0; fill < 2; fill++) {
 
-   glPolygonMode(GL_FRONT_AND_BACK, fill ? GL_LINE : GL_FILL);
-
// Loop over drawing mode: glBegin/End vs glDrawArrays vs 
glDrawElements
for (drawMode = 0; drawMode < NUM_DRAW_MODES; drawMode++) {
 
// Loop over CW vs. CCW winding (should make no 
difference)
for (facing = 0; facing < 2; facing++) {
-
-   if (facing == 0) {
-   glFrontFace(GL_CCW);
-   glCullFace(GL_BACK);
-   }
-   else {
-   glFrontFace(GL_CW);
-   glCullFace(GL_FRONT);
-   }
-
-   // Position the geometry at 9 different 
locations to test
-   // clipping against the left, right, bottom and 
top edges of
-   // the window.
-   // Only the center location will be unclipped.
-   for (y = -1.0; y <= 1.0; y += 1.0) {
-   for (x = -1.0; x 

Re: [Piglit] [PATCH] glx-multithread-clearbuffer: new test reproducing amdgpu CS thread deadlock

2017-07-14 Thread Brian Paul


Reviewed-by: Brian Paul 



On 07/14/2017 09:54 AM, Marek Olšák wrote:

From: Marek Olšák 

---
  tests/all.py|   1 +
  tests/glx/CMakeLists.gl.txt |   2 +
  tests/glx/glx-multithread-clearbuffer.c | 100 
  3 files changed, 103 insertions(+)
  create mode 100644 tests/glx/glx-multithread-clearbuffer.c

diff --git a/tests/all.py b/tests/all.py
index e08cee9..ae55425 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -659,20 +659,21 @@ with profile.test_list.group_manager(
  g(['glx-close-display'], run_concurrent=False)
  g(['glx-fbconfig-sanity'], run_concurrent=False)
  g(['glx-fbconfig-compliance'], run_concurrent=False)
  g(['glx-fbconfig-bad'], run_concurrent=False)
  g(['glx-fbo-binding'], run_concurrent=False)
  g(['glx-multi-context-front'], run_concurrent=False)
  g(['glx-multi-context-ib-1'], run_concurrent=False)
  g(['glx-multi-context-single-window'], run_concurrent=False)
  g(['glx-multi-window-single-context'], run_concurrent=False)
  g(['glx-multithread'], run_concurrent=False)
+g(['glx-multithread-clearbuffer'], run_concurrent=False)
  g(['glx-multithread-texture'], run_concurrent=False)
  g(['glx-multithread-makecurrent-1'], run_concurrent=False)
  g(['glx-multithread-makecurrent-2'], run_concurrent=False)
  g(['glx-multithread-makecurrent-3'], run_concurrent=False)
  g(['glx-multithread-makecurrent-4'], run_concurrent=False)
  g(['glx-multithread-shader-compile'], run_concurrent=False)
  g(['glx-shader-sharing'], run_concurrent=False)
  g(['glx-swap-exchange'], run_concurrent=False)
  g(['glx-swap-event', '--event'], 'glx-swap-event_event',
run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index cf036f5..3d3b4da 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -31,20 +31,22 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multi-context-single-window 
glx-multi-context-single-window.c)
piglit_add_executable (glx-multi-window-single-context 
glx-multi-window-single-context.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
piglit_add_executable (glx-context-flush-control 
glx-context-flush-control.c)
target_link_libraries (glx-context-flush-control pthread)
+   piglit_add_executable (glx-multithread-clearbuffer 
glx-multithread-clearbuffer.c)
+   target_link_libraries(glx-multithread-clearbuffer pthread)
piglit_add_executable (glx-multithread-texture 
glx-multithread-texture.c)
target_link_libraries(glx-multithread-texture pthread)
piglit_add_executable (glx-multithread-makecurrent-1 
glx-multithread-makecurrent-1.c)
target_link_libraries(glx-multithread-makecurrent-1 pthread)
piglit_add_executable (glx-multithread-makecurrent-2 
glx-multithread-makecurrent-2.c)
target_link_libraries(glx-multithread-makecurrent-2 pthread)
piglit_add_executable (glx-multithread-makecurrent-3 
glx-multithread-makecurrent-3.c)
target_link_libraries(glx-multithread-makecurrent-3 pthread)
piglit_add_executable (glx-multithread-makecurrent-4 
glx-multithread-makecurrent-4.c)
target_link_libraries(glx-multithread-makecurrent-4 pthread)
diff --git a/tests/glx/glx-multithread-clearbuffer.c 
b/tests/glx/glx-multithread-clearbuffer.c
new file mode 100644
index 000..577fde8
--- /dev/null
+++ b/tests/glx/glx-multithread-clearbuffer.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2017 Advanced Micro Devices, Inc.
+ *
+ * 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
+ * 

[Piglit] [PATCH] glx-multithread-clearbuffer: new test reproducing amdgpu CS thread deadlock

2017-07-14 Thread Marek Olšák
From: Marek Olšák 

---
 tests/all.py|   1 +
 tests/glx/CMakeLists.gl.txt |   2 +
 tests/glx/glx-multithread-clearbuffer.c | 100 
 3 files changed, 103 insertions(+)
 create mode 100644 tests/glx/glx-multithread-clearbuffer.c

diff --git a/tests/all.py b/tests/all.py
index e08cee9..ae55425 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -659,20 +659,21 @@ with profile.test_list.group_manager(
 g(['glx-close-display'], run_concurrent=False)
 g(['glx-fbconfig-sanity'], run_concurrent=False)
 g(['glx-fbconfig-compliance'], run_concurrent=False)
 g(['glx-fbconfig-bad'], run_concurrent=False)
 g(['glx-fbo-binding'], run_concurrent=False)
 g(['glx-multi-context-front'], run_concurrent=False)
 g(['glx-multi-context-ib-1'], run_concurrent=False)
 g(['glx-multi-context-single-window'], run_concurrent=False)
 g(['glx-multi-window-single-context'], run_concurrent=False)
 g(['glx-multithread'], run_concurrent=False)
+g(['glx-multithread-clearbuffer'], run_concurrent=False)
 g(['glx-multithread-texture'], run_concurrent=False)
 g(['glx-multithread-makecurrent-1'], run_concurrent=False)
 g(['glx-multithread-makecurrent-2'], run_concurrent=False)
 g(['glx-multithread-makecurrent-3'], run_concurrent=False)
 g(['glx-multithread-makecurrent-4'], run_concurrent=False)
 g(['glx-multithread-shader-compile'], run_concurrent=False)
 g(['glx-shader-sharing'], run_concurrent=False)
 g(['glx-swap-exchange'], run_concurrent=False)
 g(['glx-swap-event', '--event'], 'glx-swap-event_event',
   run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index cf036f5..3d3b4da 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -31,20 +31,22 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multi-context-single-window 
glx-multi-context-single-window.c)
piglit_add_executable (glx-multi-window-single-context 
glx-multi-window-single-context.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
piglit_add_executable (glx-context-flush-control 
glx-context-flush-control.c)
target_link_libraries (glx-context-flush-control pthread)
+   piglit_add_executable (glx-multithread-clearbuffer 
glx-multithread-clearbuffer.c)
+   target_link_libraries(glx-multithread-clearbuffer pthread)
piglit_add_executable (glx-multithread-texture 
glx-multithread-texture.c)
target_link_libraries(glx-multithread-texture pthread)
piglit_add_executable (glx-multithread-makecurrent-1 
glx-multithread-makecurrent-1.c)
target_link_libraries(glx-multithread-makecurrent-1 pthread)
piglit_add_executable (glx-multithread-makecurrent-2 
glx-multithread-makecurrent-2.c)
target_link_libraries(glx-multithread-makecurrent-2 pthread)
piglit_add_executable (glx-multithread-makecurrent-3 
glx-multithread-makecurrent-3.c)
target_link_libraries(glx-multithread-makecurrent-3 pthread)
piglit_add_executable (glx-multithread-makecurrent-4 
glx-multithread-makecurrent-4.c)
target_link_libraries(glx-multithread-makecurrent-4 pthread)
diff --git a/tests/glx/glx-multithread-clearbuffer.c 
b/tests/glx/glx-multithread-clearbuffer.c
new file mode 100644
index 000..577fde8
--- /dev/null
+++ b/tests/glx/glx-multithread-clearbuffer.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2017 Advanced Micro Devices, Inc.
+ *
+ * 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