Re: [Piglit] [PATCH 2/7] gl-4.4: set KHR_no_error compatibility

2017-05-29 Thread Timothy Arceri

On 19/05/17 19:08, Samuel Pitoiset wrote:

On 05/18/2017 04:00 AM, Timothy Arceri wrote:

---
  tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c 
b/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c

index 85113c8..71343d0 100644
--- a/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c
+++ b/tests/spec/gl-4.4/gl_max_vertex_attrib_stride.c
@@ -21,20 +21,21 @@
   * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   * SOFTWARE.
   */
  #include "piglit-util-gl.h"
  #include "minmax-test.h"
  PIGLIT_GL_TEST_CONFIG_BEGIN
  config.supports_gl_core_version = 44;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  PIGLIT_GL_TEST_CONFIG_END
  static bool check_stride(char *function, bool check_valid)
  {
  bool pass = true;
  if (check_valid) {
  if (!piglit_check_gl_error(GL_NO_ERROR)) {
  fprintf(stderr, "error when testing valid "
@@ -138,24 +139,26 @@ void piglit_init(int argc, char **argv)
  pass = piglit_minmax_pass;
  /* Try passing the max stride value */
  pass = test_stride_bind_buffer(stride_max, true) && pass;
  pass = test_stride_bind_buffers(stride_max, true) && pass;
  pass = test_stride_vertex_attrib(stride_max, true) && pass;
  pass = test_stride_vertex_attribi(stride_max, true) && pass;
  pass = test_stride_vertex_attribl(stride_max, true) && pass;
  /* Try passing a stride value that is to large */
-pass = test_stride_bind_buffer(stride_max_plus_one, false) && pass;
-pass = test_stride_bind_buffers(stride_max_plus_one, false) && pass;
-pass = test_stride_vertex_attrib(stride_max_plus_one, false) && 
pass;
-pass = test_stride_vertex_attribi(stride_max_plus_one, false) && 
pass;
-pass = test_stride_vertex_attribl(stride_max_plus_one, false) && 
pass;

+if (!piglit_khr_no_error) {
+pass = test_stride_bind_buffer(stride_max_plus_one, false) && 
pass;
+pass = test_stride_bind_buffers(stride_max_plus_one, false) 
&& pass;
+pass = test_stride_vertex_attrib(stride_max_plus_one, false) 
&& pass;
+pass = test_stride_vertex_attribi(stride_max_plus_one, false) 
&& pass;
+pass = test_stride_vertex_attribl(stride_max_plus_one, false) 
&& pass;

+}


How about moving the piglit_khr_no_error check directly in 
check_stride() ? With that changed, patch is:


Hey sorry, these fell off my radar. I've gone ahead and pushed this one 
unchanged without your review. The problem with the suggestion is that 
with KHR_no_error the idea is to never call the api in a way that can 
cause an error. Your suggesting would mean we call the api in an invalid 
way and just skip the error checks, this can mean we end up crashing, 
causing buffer overruns etc.


Thanks for the reviews I've pushed the other patches with you r-b.



Reviewed-by: Samuel Pitoiset 


  piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
  }
  enum piglit_result
  piglit_display(void)
  {
  return PIGLIT_PASS;
  }


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


Re: [Piglit] [PATCH v5] CMake: define GBM_BO_MAP only when symbol is found

2017-05-29 Thread Daniel Díaz Rodríguez
Ping.

-- 
ddiaz



On 16 May 2017 at 19:06, Daniel Díaz  wrote:
> gbm_bo_map() and _unmap() have been added recently to Mesa,
> and this update may not have reached all implementations of
> GBM, such as the one provided by Mali r6, where said
> definitions can be found in the header file but not in the
> library itself. This leads to errors like the following when
> linking:
>   ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap'
>   ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map'
>   collect2: error: ld returned 1 exit status
>   make[2]: *** [bin/point-sprite] Error 1
>
> Instead of relying on the header file, actually try to link
> using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP
> should be defined.
>
> Signed-off-by: Daniel Díaz 
> Reviewed-by: Jan Vesely 
> ---
> v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely.
> v3: Back to CHECK_FUNCTION_EXISTS.
> v4: Use ${GBM_LIBRARIES} instead of 'gbm'.
> v5: Add reviewed-by; hopefully final version.
>
>  CMakeLists.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index a4ff99e..cc26fa8 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> if(GBM_FOUND)
> set(PIGLIT_HAS_GBM True)
> add_definitions(-DPIGLIT_HAS_GBM)
> -   if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION 
> VERSION_GREATER "12.1")
> -   set(PIGLIT_HAS_GBM_BO_MAP True)
> +   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} 
> ${GBM_LIBRARIES})
> +   CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP)
> +   if (PIGLIT_HAS_GBM_BO_MAP)
> add_definitions(-DPIGLIT_HAS_GBM_BO_MAP)
> endif()
> endif(GBM_FOUND)
> --
> 1.9.1
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_get_program_binary: check correctly got_error

2017-05-29 Thread Juan A. Suarez Romero
Seems it was checking if *not* error got, instead of the other way
around.

Suggested-by: Fabio Lagalla
Signed-off-by: Juan A. Suarez Romero 
---
 tests/spec/arb_get_program_binary/retrievable_hint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_get_program_binary/retrievable_hint.c 
b/tests/spec/arb_get_program_binary/retrievable_hint.c
index 8283c5b..9263a89 100644
--- a/tests/spec/arb_get_program_binary/retrievable_hint.c
+++ b/tests/spec/arb_get_program_binary/retrievable_hint.c
@@ -79,7 +79,7 @@ piglit_init(int argc, char **argv)
 */
value = 0xDEADBEEF;
glGetProgramiv(prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, &value);
-   got_error = piglit_check_gl_error(0);
+   got_error = !piglit_check_gl_error(0);
 
if (!got_error) {
if (value == 0xDEADBEEF) {
-- 
2.9.4

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