Re: [Piglit] [PATCH] cl: Guard against CL version overflow.

2017-07-06 Thread Jan Vesely
On Thu, 2017-07-06 at 18:46 -0400, Ilia Mirkin wrote:
> Would it make more sense to just make all of that unsigned?

or add an assert. This is a very stretched way to appease static
checker.

Jan

> 
> On Thu, Jul 6, 2017 at 5:59 PM, Vinson Lee  wrote:
> > Fix Coverity overflowed return value defect.
> > 
> > CID: 1364163
> > Signed-off-by: Vinson Lee 
> > ---
> >  tests/util/piglit-framework-cl.c | 8 +++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/util/piglit-framework-cl.c 
> > b/tests/util/piglit-framework-cl.c
> > index 235f160877cf..31346b7d8a17 100644
> > --- a/tests/util/piglit-framework-cl.c
> > +++ b/tests/util/piglit-framework-cl.c
> > @@ -450,6 +450,7 @@ piglit_cl_get_version_arg(int argc, const char** argv)
> >  {
> > int version_major = 0;
> > int version_minor = 0;
> > +   int version;
> > 
> > const char* version_str;
> > 
> > @@ -466,7 +467,12 @@ piglit_cl_get_version_arg(int argc, const char** argv)
> > }
> > }
> > 
> > -   return version_major*10 + version_minor;
> > +   version = version_major*10 + version_minor;
> > +   if (version < 0) {
> > +   version = 0;
> > +   }
> > +
> > +   return version;
> >  }
> > 
> >  bool
> > --
> > 2.11.0
> > 
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

-- 
Jan Vesely 

signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] cl: Guard against CL version overflow.

2017-07-06 Thread Ilia Mirkin
Would it make more sense to just make all of that unsigned?

On Thu, Jul 6, 2017 at 5:59 PM, Vinson Lee  wrote:
> Fix Coverity overflowed return value defect.
>
> CID: 1364163
> Signed-off-by: Vinson Lee 
> ---
>  tests/util/piglit-framework-cl.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tests/util/piglit-framework-cl.c 
> b/tests/util/piglit-framework-cl.c
> index 235f160877cf..31346b7d8a17 100644
> --- a/tests/util/piglit-framework-cl.c
> +++ b/tests/util/piglit-framework-cl.c
> @@ -450,6 +450,7 @@ piglit_cl_get_version_arg(int argc, const char** argv)
>  {
> int version_major = 0;
> int version_minor = 0;
> +   int version;
>
> const char* version_str;
>
> @@ -466,7 +467,12 @@ piglit_cl_get_version_arg(int argc, const char** argv)
> }
> }
>
> -   return version_major*10 + version_minor;
> +   version = version_major*10 + version_minor;
> +   if (version < 0) {
> +   version = 0;
> +   }
> +
> +   return version;
>  }
>
>  bool
> --
> 2.11.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] cl: Guard against CL version overflow.

2017-07-06 Thread Vinson Lee
Fix Coverity overflowed return value defect.

CID: 1364163
Signed-off-by: Vinson Lee 
---
 tests/util/piglit-framework-cl.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-cl.c b/tests/util/piglit-framework-cl.c
index 235f160877cf..31346b7d8a17 100644
--- a/tests/util/piglit-framework-cl.c
+++ b/tests/util/piglit-framework-cl.c
@@ -450,6 +450,7 @@ piglit_cl_get_version_arg(int argc, const char** argv)
 {
int version_major = 0;
int version_minor = 0;
+   int version;
 
const char* version_str;
 
@@ -466,7 +467,12 @@ piglit_cl_get_version_arg(int argc, const char** argv)
}
}
 
-   return version_major*10 + version_minor;
+   version = version_major*10 + version_minor;
+   if (version < 0) {
+   version = 0;
+   }
+
+   return version;
 }
 
 bool
-- 
2.11.0

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


Re: [Piglit] [PATCH 1/8] ext_framebuffer_multisample: set KHR_no_error status

2017-07-06 Thread Samuel Pitoiset

Thanks!

For the series:

Reviewed-by: Samuel Pitoiset 

On 07/06/2017 05:53 AM, Timothy Arceri wrote:

---
  .../spec/ext_framebuffer_multisample/alpha-blending-after-rendering.c | 1 +
  .../ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp  | 1 +
  .../alpha-to-coverage-no-draw-buffer-zero-write.cpp   | 1 +
  .../alpha-to-coverage-no-draw-buffer-zero.cpp | 1 +
  .../spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp  | 1 +
  tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp | 1 +
  .../ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/bitmap.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/blit-flipped.cpp   | 1 +
  tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp  | 1 +
  .../spec/ext_framebuffer_multisample/blit-multiple-render-targets.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/clear.cpp  | 1 +
  tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp  | 1 +
  tests/spec/ext_framebuffer_multisample/dlist.c| 1 +
  .../ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp  | 1 +
  tests/spec/ext_framebuffer_multisample/enable-flag.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/fast-clear.c   | 4 
  tests/spec/ext_framebuffer_multisample/formats.cpp| 1 +
  .../int-draw-buffers-alpha-to-coverage.cpp| 1 +
  .../ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/interpolation.cpp  | 1 +
  tests/spec/ext_framebuffer_multisample/line-smooth.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/minmax.c   | 1 +
  tests/spec/ext_framebuffer_multisample/multisample-blit.cpp   | 1 +
  tests/spec/ext_framebuffer_multisample/negative-copypixels.c  | 1 +
  tests/spec/ext_framebuffer_multisample/negative-copyteximage.c| 1 +
  tests/spec/ext_framebuffer_multisample/negative-max-samples.c | 1 +
  tests/spec/ext_framebuffer_multisample/negative-mismatched-samples.c  | 1 +
  tests/spec/ext_framebuffer_multisample/negative-readpixels.c  | 1 +
  tests/spec/ext_framebuffer_multisample/no-color.cpp   | 1 +
  tests/spec/ext_framebuffer_multisample/point-smooth.cpp   | 1 +
  tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/renderbuffer-samples.c | 1 +
  tests/spec/ext_framebuffer_multisample/renderbufferstorage-samples.c  | 1 +
  tests/spec/ext_framebuffer_multisample/sample-alpha-to-coverage.cpp   | 1 +
  tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/sample-coverage.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/samples.c  | 1 +
  tests/spec/ext_framebuffer_multisample/turn-on-off.cpp| 1 +
  tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp | 1 +
  tests/spec/ext_framebuffer_multisample/upsample.cpp   | 1 +
  45 files changed, 48 insertions(+)

diff --git 
a/tests/spec/ext_framebuffer_multisample/alpha-blending-after-rendering.c 
b/tests/spec/ext_framebuffer_multisample/alpha-blending-after-rendering.c
index a654f9f..816b634 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-blending-after-rendering.c
+++ b/tests/spec/ext_framebuffer_multisample/alpha-blending-after-rendering.c
@@ -47,6 +47,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_compat_version = 30;
config.supports_gl_core_version = 31;
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp

index 777af0c..34bbfa7 100644
--- 
a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
+++ 
b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
@@ -45,6 +45,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.window_width = 512;
config.window_height = 256;
config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END

  

Re: [Piglit] [PATCH] arb_texture_buffer_object: set KHR_no_error support

2017-07-06 Thread Samuel Pitoiset

Reviewed-by: Samuel Pitoiset 

On 07/06/2017 06:41 AM, Timothy Arceri wrote:

Here we also move some of the config setup to the top of the
file as this is the layout of piglit tests everywhere else in
piglit.
---
  tests/spec/arb_texture_buffer_object/bufferstorage.c| 11 ++-
  tests/spec/arb_texture_buffer_object/data-sync.c|  1 +
  tests/spec/arb_texture_buffer_object/dlist.c|  1 +
  tests/spec/arb_texture_buffer_object/fetch-outside-bounds.c | 13 +++--
  tests/spec/arb_texture_buffer_object/formats.c  |  1 +
  tests/spec/arb_texture_buffer_object/get.c  |  1 +
  tests/spec/arb_texture_buffer_object/max-size.c | 11 ++-
  tests/spec/arb_texture_buffer_object/minmax.c   |  1 +
  tests/spec/arb_texture_buffer_object/negative-bad-bo.c  |  1 +
  tests/spec/arb_texture_buffer_object/negative-bad-format.c  |  1 +
  tests/spec/arb_texture_buffer_object/negative-bad-target.c  |  1 +
  tests/spec/arb_texture_buffer_object/negative-unsupported.c |  1 +
  tests/spec/arb_texture_buffer_object/render-no-bo.c | 13 +++--
  tests/spec/arb_texture_buffer_object/subdata-sync.c |  1 +
  tests/spec/arb_texture_buffer_object/unused-name.c  |  1 +
  15 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/tests/spec/arb_texture_buffer_object/bufferstorage.c 
b/tests/spec/arb_texture_buffer_object/bufferstorage.c
index c46c70d..16e4dcd 100644
--- a/tests/spec/arb_texture_buffer_object/bufferstorage.c
+++ b/tests/spec/arb_texture_buffer_object/bufferstorage.c
@@ -27,6 +27,12 @@
  
  #include "piglit-util-gl.h"
  
+PIGLIT_GL_TEST_CONFIG_BEGIN

+   config.supports_gl_core_version = 31;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
+PIGLIT_GL_TEST_CONFIG_END
+
  static const float green[4] = {0, 1, 0, 0};
  static const float red[4] = {1, 0, 0, 0};
  static float *map;
@@ -138,8 +144,3 @@ piglit_init(int argc, char **argv)
  GL_FALSE, 0, NULL);
glEnableVertexAttribArray(vertex_location);
  }
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-   config.supports_gl_core_version = 31;
-   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
-PIGLIT_GL_TEST_CONFIG_END
diff --git a/tests/spec/arb_texture_buffer_object/data-sync.c 
b/tests/spec/arb_texture_buffer_object/data-sync.c
index 5542734..511690d 100644
--- a/tests/spec/arb_texture_buffer_object/data-sync.c
+++ b/tests/spec/arb_texture_buffer_object/data-sync.c
@@ -35,6 +35,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_core_version = 31;
  
  	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;

+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
  PIGLIT_GL_TEST_CONFIG_END
  
  enum piglit_result

diff --git a/tests/spec/arb_texture_buffer_object/dlist.c 
b/tests/spec/arb_texture_buffer_object/dlist.c
index ea15f61..565dc24 100644
--- a/tests/spec/arb_texture_buffer_object/dlist.c
+++ b/tests/spec/arb_texture_buffer_object/dlist.c
@@ -38,6 +38,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_compat_version = 10;
  
  	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;

+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_texture_buffer_object/fetch-outside-bounds.c b/tests/spec/arb_texture_buffer_object/fetch-outside-bounds.c

index c9aa6c4..c0e3976 100644
--- a/tests/spec/arb_texture_buffer_object/fetch-outside-bounds.c
+++ b/tests/spec/arb_texture_buffer_object/fetch-outside-bounds.c
@@ -39,6 +39,13 @@
  
  #include "piglit-util-gl.h"
  
+PIGLIT_GL_TEST_CONFIG_BEGIN

+   config.supports_gl_compat_version = 10;
+   config.supports_gl_core_version = 31;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
+PIGLIT_GL_TEST_CONFIG_END
+
  enum piglit_result
  piglit_display(void)
  {
@@ -113,9 +120,3 @@ piglit_init(int argc, char **argv)
if (piglit_get_gl_version() < 31)
piglit_require_extension("GL_ARB_texture_buffer_object");
  }
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-   config.supports_gl_compat_version = 10;
-   config.supports_gl_core_version = 31;
-   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
-PIGLIT_GL_TEST_CONFIG_END
diff --git a/tests/spec/arb_texture_buffer_object/formats.c 
b/tests/spec/arb_texture_buffer_object/formats.c
index fad657d..f2960cd 100644
--- a/tests/spec/arb_texture_buffer_object/formats.c
+++ b/tests/spec/arb_texture_buffer_object/formats.c
@@ -719,4 +719,5 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.window_width = 200;
config.window_height = 500;
config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+