Re: [Piglit] [PATCH] egl_khr_fence_sync: check for EGL_KHR_reusable_sync

2014-10-14 Thread Daniel Kurtz
Hi Chad,

I took a look at running the egl_khr_fence_sync test again recently,
and Ilja's patch fixed one issue, but it didn't actually address the
original problem I had when running this test using the Mali driver.

I have been running piglit using epoxy dispatch.
Epoxy builds its dispatch tables from the khronos registry provided by
xml files, such as registry/egl.xml.
The problem is that this registry only defines the four functions for
EGL_KHR_reusable_sync, but not for EGL_KHR_fence_sync:

extension name=EGL_KHR_fence_sync
protect=KHRONOS_SUPPORT_INT64 supported=egl
require
!-- @ Most interfaces defined by EGL_KHR_reusable sync --
enum name=EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR/
enum name=EGL_SYNC_CONDITION_KHR/
enum name=EGL_SYNC_FENCE_KHR/
/require
/extension
...
extension name=EGL_KHR_reusable_sync
protect=KHRONOS_SUPPORT_INT64 supported=egl
require
enum name=EGL_SYNC_STATUS_KHR/
enum name=EGL_SIGNALED_KHR/
enum name=EGL_UNSIGNALED_KHR/
enum name=EGL_TIMEOUT_EXPIRED_KHR/
enum name=EGL_CONDITION_SATISFIED_KHR/
enum name=EGL_SYNC_TYPE_KHR/
enum name=EGL_SYNC_REUSABLE_KHR/
enum name=EGL_SYNC_FLUSH_COMMANDS_BIT_KHR/
enum name=EGL_FOREVER_KHR/
enum name=EGL_NO_SYNC_KHR/
command name=eglCreateSyncKHR/
command name=eglDestroySyncKHR/
command name=eglClientWaitSyncKHR/
command name=eglSignalSyncKHR/
command name=eglGetSyncAttribKHR/
/require
/extension

Thus, when using a driver like mali, which has EGL_KHR_fence_sync but
not EGL_KHR_reusable_sync, epoxy cannot find a provider for
eglCreateSyncKHR and fails:

# DISPLAY=:0 /usr/local/piglit/lib/piglit/bin/egl_khr_fence_sync -fbo -auto
No provider of eglCreateSyncKHR found.  Requires one of:
EGL extension EGL_KHR_reusable_sync

I created a new epoxy issue for this github:
https://github.com/anholt/libepoxy/issues/33

Note: I think this is fixed for EGL 1.5+, since it has
EGL_KHR_fence_sync built-in:

feature api=egl name=EGL_VERSION_1_5 number=1.5
...
require comment=EGL_KHR_fence_sync
enum name=EGL_SYNC_PRIOR_COMMANDS_COMPLETE/
enum name=EGL_SYNC_TYPE/
enum name=EGL_SYNC_STATUS/
enum name=EGL_SYNC_CONDITION/
enum name=EGL_SIGNALED/
enum name=EGL_UNSIGNALED/
enum name=EGL_SYNC_FLUSH_COMMANDS_BIT/
enum name=EGL_FOREVER/
enum name=EGL_TIMEOUT_EXPIRED/
enum name=EGL_CONDITION_SATISFIED/
enum name=EGL_NO_SYNC/
enum name=EGL_SYNC_FENCE/
command name=eglCreateSync/
command name=eglDestroySync/
command name=eglClientWaitSync/
command name=eglGetSyncAttrib/
/require





On Thu, Aug 21, 2014 at 6:20 AM, Chad Versace
chad.vers...@linux.intel.com wrote:

 On 08/18/2014 07:46 PM, Daniel Kurtz wrote:
  On Tue, Aug 19, 2014 at 7:05 AM, Chad Versace
  chad.vers...@linux.intel.com wrote:
  On 08/13/2014 07:13 PM, Daniel Kurtz wrote:
 

  I think the original reason why I wrote this patch was to address
  build breakage due to the incomplete dispatch (using symbol
  eglCreateSyncKHR instead of egl-looked-up peglCreatSyncKHR).
  This is fixed by Ilja's patch, which I assume he is going to send
  upstream shortly.

 Ilja didn't submit to the list. But I pulled the patch out the ebuild 
 directory
 and commited it to master.

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


Re: [Piglit] [PATCH 1/6] Ported blend func test from Glean to Piglit.

2014-10-14 Thread Laura Ekstrand
These nits have been incorporated into my local branch (
http://cgit.freedesktop.org/~ldeks/piglit/?h=gl-1.0-glean).

Thanks for the help.

Laura

On Mon, Oct 13, 2014 at 7:58 PM, Dylan Baker baker.dyla...@gmail.com
wrote:

 On Monday, October 13, 2014 02:21:34 PM Laura Ekstrand wrote:
  ---
   tests/spec/gl-1.0/CMakeLists.gl.txt |   1 +
   tests/spec/gl-1.0/blend.c   | 786
 
   2 files changed, 787 insertions(+)
   create mode 100644 tests/spec/gl-1.0/blend.c
 
  diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt
 b/tests/spec/gl-1.0/CMakeLists.gl.txt
  index e5bb33f..f5f8c48 100644
  --- a/tests/spec/gl-1.0/CMakeLists.gl.txt
  +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
  @@ -20,5 +20,6 @@ piglit_add_executable (gl-1.0-long-dlist long-dlist.c)
   piglit_add_executable (gl-1.0-rendermode-feedback rendermode-feedback.c)
   piglit_add_executable (gl-1.0-swapbuffers-behavior
 swapbuffers-behavior.c)
   piglit_add_executable (gl-1.0-polygon-line-aa polygon-line-aa.c)
  +piglit_add_executable (gl-1.0-blend-func blend.c)
 
   # vim: ft=cmake:
  diff --git a/tests/spec/gl-1.0/blend.c b/tests/spec/gl-1.0/blend.c
  new file mode 100644
  index 000..4812f5d
  --- /dev/null
  +++ b/tests/spec/gl-1.0/blend.c
  @@ -0,0 +1,786 @@
  +/*  BEGIN_COPYRIGHT -*- glean -*-
  + *
  + *  Copyright (C) 1999  Allen Akin   All Rights Reserved.
  + *
  + *  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 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 ALLEN AKIN 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.
  +
  + *  END_COPYRIGHT
  + */
  +
  +/*
  + * Copyright 2014 Intel Corporation
  + *
  + * 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.
  + */

 Since both licenses are MIT you could just add Copyright Intel...
 below the original copyright date rather than having two copies of the
 license.

  +
  +/** @file blend.c
  + *
  + *  Test blending functions.
  + *
  + *   This test checks all combinations of source and destination
  + *   blend factors for the GL_FUNC_ADD blend equation.  It operates
  + *   on all RGB or RGBA drawing surface configurations that support
  + *   the creation of windows.
  + *
  + *   Note that a common cause of failures for this test is small errors
  + *   introduced when an implementation scales color values incorrectly;
  + *   for example, converting an 8-bit color value to float by
  + *   dividing by 256 rather than 255, or computing a blending result
  + *   by shifting a double-width intermediate value rather than scaling
  + *   it.  Also, please note that the OpenGL spec requires that when
  + *   converting from floating-point colors to integer form, the result
  + *   must be rounded to the nearest integer, not truncated.
  + *   [1.2.1, 2.13.9]
  + *
  + *   The test reports two error measurements.  The first (readback) is
  + *   the error detected when reading back raw values that 

Re: [Piglit] [PATCH 1/2] Ported the glsl1 test from Glean to Piglit.

2014-10-14 Thread Laura Ekstrand
I applied the style fixes pointed out by Brian Paul and Dylan Baker in the
blend func patch to my local repo (see
http://cgit.freedesktop.org/~ldeks/piglit/?h=glsl1).

Laura

P.S.: I apologize if this is a repeat email.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] cl: Add test for clCreateProgramWithBinary()

2014-10-14 Thread Tom Stellard
---
 tests/cl.py   |   1 +
 tests/cl/api/CMakeLists.cl.txt|   1 +
 tests/cl/api/create-program-with-binary.c | 189 ++
 3 files changed, 191 insertions(+)
 create mode 100644 tests/cl/api/create-program-with-binary.c

diff --git a/tests/cl.py b/tests/cl.py
index 67ed542..1812e11 100644
--- a/tests/cl.py
+++ b/tests/cl.py
@@ -73,6 +73,7 @@ add_plain_test(api, 'clGetMemObjectInfo', 
['cl-api-get-mem-object-info'])
 add_plain_test(api, 'clGetImageInfo', ['cl-api-get-image-info'])
 add_plain_test(api, 'clRetainMemObject and clReleaseMemObject', 
['cl-api-retain_release-mem-object'])
 #  Program
+add_plain_test(api, 'clCreateProgramWithBinary', 
['cl-api-create-program-with-binary'])
 add_plain_test(api, 'clCreateProgramWithSource', 
['cl-api-create-program-with-source'])
 add_plain_test(api, 'clBuildProgram', ['cl-api-build-program'])
 add_plain_test(api, 'clCreateKernelsInProgram', 
['cl-api-create-kernels-in-program'])
diff --git a/tests/cl/api/CMakeLists.cl.txt b/tests/cl/api/CMakeLists.cl.txt
index 460c8ac..a51b45e 100644
--- a/tests/cl/api/CMakeLists.cl.txt
+++ b/tests/cl/api/CMakeLists.cl.txt
@@ -26,6 +26,7 @@ piglit_cl_add_api_test (get-mem-object-info 
get-mem-object-info.c)
 piglit_cl_add_api_test (get-image-info get-image-info.c)
 
 # Programs
+piglit_cl_add_api_test (create-program-with-binary 
create-program-with-binary.c)
 piglit_cl_add_api_test (create-program-with-source 
create-program-with-source.c)
 piglit_cl_add_api_test (retain_release-program retain_release-program.c)
 piglit_cl_add_api_test (build-program build-program.c)
diff --git a/tests/cl/api/create-program-with-binary.c 
b/tests/cl/api/create-program-with-binary.c
new file mode 100644
index 000..f2b3791
--- /dev/null
+++ b/tests/cl/api/create-program-with-binary.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright © 2012 Blaž Tomažič blaz.toma...@gmail.com
+ * Copyright 2014 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 SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file create-program-with-source.c
+ *
+ * Test API function:
+ *
+ *  cl_program clCreateProgramWithBinary (cl_context context,
+ *cl_uint num_devices,
+ *const cl_device_id *device_list,
+ *const size_t *lengths,
+ *const unsigned char **binaries,
+ *cl_int *binary_status,
+ *cl_int *errcode_ret)
+ */
+
+#include piglit-framework-cl-api.h
+
+
+PIGLIT_CL_API_TEST_CONFIG_BEGIN
+
+   config.name = clCreateProgramWithBinary;
+   config.version_min = 10;
+
+   config.run_per_platform = true;
+   config.create_context = true;
+
+PIGLIT_CL_API_TEST_CONFIG_END
+
+
+const char* dummy_kernel = kernel void dummy_kernel() { };
+
+enum piglit_result
+piglit_cl_test(const int argc,
+   const char** argv,
+   const struct piglit_cl_api_test_config* config,
+   const struct piglit_cl_api_test_env* env)
+{
+   enum piglit_result result = PIGLIT_PASS;
+   int i;
+
+   cl_int errNo;
+   cl_program program;
+   cl_program binary_program;
+   piglit_cl_context ctx = env-context;
+   cl_context cl_ctx = ctx-cl_ctx;
+   cl_kernel kernel;
+
+   size_t kernel_length = strlen(dummy_kernel);
+   size_t *sizes = calloc(sizeof(size_t), ctx-num_devices);
+   unsigned char **binaries = calloc(sizeof(char*),  ctx-num_devices);
+   cl_int *binary_status = calloc(sizeof(cl_int), ctx-num_devices);
+
+
+   /*** Normal usage ***/
+
+   /* with errNo */
+   program = clCreateProgramWithSource(cl_ctx,
+   1,
+   dummy_kernel,
+