Re: [Piglit] [PATCH] framework: Don't stop resume because no tests are left to be run

2017-07-19 Thread Matt Turner
On Tue, Jul 11, 2017 at 10:27 AM, Dylan Baker  wrote:
> It's completely possible that if piglit resume is run with the -n flag
> (don't retry incomplete tests), that piglit resume could be invoked with
> no tests left to run. In this case it makes sense to let piglit resume
> just finalize the backend and produce a unified result.
>
> Signed-off-by: Dylan Baker 
> cc: Martin Peres 
> ---
>  framework/programs/run.py | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/framework/programs/run.py b/framework/programs/run.py
> index 508bc05c4..ef268f722 100644
> --- a/framework/programs/run.py
> +++ b/framework/programs/run.py
> @@ -35,6 +35,7 @@ import six
>
>  from framework import core, backends, exceptions, options
>  from framework import dmesg
> +from framework import exceptions

exceptions looks like it's imported a few lines above. Is this intentional?
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] cl: Add support for OCL 2.0

2017-07-19 Thread Jan Vesely
v2: Fix warning in cl-api-get-mem-object-info
v3: Filter permissible queue properties combinations
Use and test clCreateCommandQueueWithProperties on OCL 2.0

Signed-off-by: Jan Vesely 
---

I see few regressions with this patch on beignet(SKL) in generated 
clamp/mad_sat long16 tests. Forcing the clc version to 1.2 in those test fixes 
the regression so I believe it's beignet bug.
No regressions on clover Turks and beignet(IVB).

Jan

 tests/cl/api/create-command-queue.c | 37 +--
 tests/cl/api/get-mem-object-info.c  |  8 
 tests/util/piglit-util-cl-enum.c| 95 +++--
 tests/util/piglit-util-cl-enum.h|  4 ++
 tests/util/piglit-util-cl.h |  4 +-
 5 files changed, 119 insertions(+), 29 deletions(-)

diff --git a/tests/cl/api/create-command-queue.c 
b/tests/cl/api/create-command-queue.c
index 0ffd1377c..3ada5af90 100644
--- a/tests/cl/api/create-command-queue.c
+++ b/tests/cl/api/create-command-queue.c
@@ -52,7 +52,7 @@ get_mixed_command_queue_properties(int mask,
const cl_command_queue_properties 
properties[]) {
int i = 0;
cl_command_queue_properties mixed_properties = 0;
-   
+
while(mask > 0) {
if(mask%2 == 1) {
mixed_properties |= properties[i];
@@ -64,6 +64,21 @@ get_mixed_command_queue_properties(int mask,
return mixed_properties;
 }
 
+static bool
+properties_forbidden(const cl_command_queue_properties properties,
+ const struct piglit_cl_api_test_env* env)
+{
+   int num_command_queue_properties_mutexes =
+   PIGLIT_CL_ENUM_NUM(cl_command_queue_properties_mutexes, 
env->version);
+   const cl_command_queue_properties* command_queue_properties_mutexes =
+   PIGLIT_CL_ENUM_ARRAY(cl_command_queue_properties_mutexes);
+   int i = 0;
+   for (; i < num_command_queue_properties_mutexes; ++i)
+   if (properties == command_queue_properties_mutexes[i])
+   return true;
+   return false;
+}
+
 enum piglit_result
 piglit_cl_test(const int argc,
const char** argv,
@@ -79,7 +94,8 @@ piglit_cl_test(const int argc,
cl_command_queue command_queue;
cl_uint num_devices;
cl_device_id* devices;
-   cl_command_queue_properties mixed_command_queue_properties;
+   cl_command_queue_properties mixed_command_queue_properties[4] =
+   {CL_QUEUE_PROPERTIES, 0, 0, 0};
 
cl_context_properties context_properties[] = {
CL_CONTEXT_PLATFORM, (cl_context_properties)env->platform_id,
@@ -116,12 +132,25 @@ piglit_cl_test(const int argc,
 * There are 2^(num_command_queue_properties)-1 possible options.
 */
for(mask = 0; mask < (1 << num_command_queue_properties); mask++) {
-   mixed_command_queue_properties =
+   mixed_command_queue_properties[1] =
get_mixed_command_queue_properties(mask, 
command_queue_properties);
-   command_queue = clCreateCommandQueue(cl_ctx,
+   if (properties_forbidden(mixed_command_queue_properties[1], 
env))
+   continue;
+#if defined CL_VERSION_2_0
+   if (env->version >= 20) {
+   command_queue = clCreateCommandQueueWithProperties(
+cl_ctx,
 env->device_id,
 
mixed_command_queue_properties,
 );
+   } else
+#endif //CL_VERSION_2_0
+   {
+   command_queue = clCreateCommandQueue(cl_ctx,
+env->device_id,
+
mixed_command_queue_properties[1],
+);
+   }
if(errNo != CL_SUCCESS && errNo != CL_INVALID_QUEUE_PROPERTIES) 
{
piglit_cl_check_error(errNo, CL_SUCCESS);
fprintf(stderr,
diff --git a/tests/cl/api/get-mem-object-info.c 
b/tests/cl/api/get-mem-object-info.c
index 2db3b6ae6..5dcb4752d 100644
--- a/tests/cl/api/get-mem-object-info.c
+++ b/tests/cl/api/get-mem-object-info.c
@@ -170,6 +170,14 @@ test(int n,
}
break;
 #endif
+#if defined(CL_VERSION_2_0)
+   case CL_MEM_USES_SVM_POINTER:
+   if (env->version >= 20) {
+   CHECK_SIZE(cl_bool)
+   CHECK_VALUE(cl_bool, CL_FALSE)
+   }
+   break;
+#endif
default:
fprintf(stderr, "Warn: untested parameter %s\n",

[Piglit] [PATCH] egl: Add test for EGL_KHR_create_context_no_error

2017-07-19 Thread Grigori Goronzy
This test verifies context creation with the
EGL_KHR_create_context_no_error extension, which includes interaction
with debug and robustness flags. The test also verifies that the
KHR_no_error mode is successfully enabled with a check of context
flags and glGetError() behavior.

Both GL 2.0 and GLES2 are tested.
---
 tests/all.py   |   2 +
 .../egl_khr_create_context/CMakeLists.gles2.txt|   3 +
 tests/egl/spec/egl_khr_create_context/no-error.c   | 216 +
 3 files changed, 221 insertions(+)
 create mode 100644 tests/egl/spec/egl_khr_create_context/no-error.c

diff --git a/tests/all.py b/tests/all.py
index 4d19da1..4495c90 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4608,6 +4608,8 @@ with profile.test_list.group_manager(
   run_concurrent=False)
 g(['egl-create-context-valid-flag-debug-gl', 'gl'], 'valid debug flag GL',
   run_concurrent=False)
+g(['egl-create-context-no-error'], 'KHR_no_error enable',
+  run_concurrent=False)
 
 for api in ('gles1', 'gles2', 'gles3'):
 g(['egl-create-context-valid-flag-debug-gles', api],
diff --git a/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt 
b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
index 23bf145..a27ef2d 100644
--- a/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
+++ b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
@@ -19,4 +19,7 @@ piglit_add_executable (egl-create-context-invalid-gl-version 
invalid-gl-version.
 piglit_add_executable (egl-create-context-verify-gl-flavor verify-gl-flavor.c 
common.c)
 piglit_add_executable (egl-create-context-valid-flag-debug-gles 
valid-flag-debug.c common.c)
 
+# Tests that use ES 2 and Desktop GL.
+piglit_add_executable (egl-create-context-no-error no-error.c common.c)
+
 # vim: ft=cmake:
diff --git a/tests/egl/spec/egl_khr_create_context/no-error.c 
b/tests/egl/spec/egl_khr_create_context/no-error.c
new file mode 100644
index 000..652c794
--- /dev/null
+++ b/tests/egl/spec/egl_khr_create_context/no-error.c
@@ -0,0 +1,216 @@
+/* Copyright 2017 Grigori Goronzy 
+ *
+ * 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.
+ */
+
+#include 
+#include 
+
+#include "piglit-util-gl.h"
+#include "piglit-util-egl.h"
+#include "common.h"
+
+#define BOOLSTR(x) ((x) ? "yes" : "no")
+
+static void
+fold_results(enum piglit_result *a, enum piglit_result b)
+{
+if (*a == PIGLIT_FAIL || b == PIGLIT_FAIL)
+*a = PIGLIT_FAIL;
+else if (*a == PIGLIT_PASS || b == PIGLIT_PASS)
+*a = PIGLIT_PASS;
+else
+*a = PIGLIT_SKIP;
+}
+
+static void
+check_extension(EGLint mask)
+{
+if (!EGL_KHR_create_context_setup(mask))
+piglit_report_result(PIGLIT_SKIP);
+
+piglit_require_egl_extension(egl_dpy, "EGL_KHR_create_context_no_error");
+
+EGL_KHR_create_context_teardown();
+}
+
+static enum piglit_result
+check_no_error(EGLenum api, bool no_error, bool debug, bool robust)
+{
+   static bool is_dispatch_init = false;
+enum piglit_result pass = PIGLIT_SKIP;
+EGLContext ctx;
+EGLint attribs[11];
+size_t ai = 0;
+GLint context_flags = 0;
+EGLint mask = (api == EGL_OPENGL_API) ? EGL_OPENGL_BIT : 
EGL_OPENGL_ES2_BIT;
+
+printf("info: %s no_error=%s debug=%s robustness=%s\n",
+   (api == EGL_OPENGL_API) ? "OpenGL" : "OpenGL ES",
+   BOOLSTR(no_error), BOOLSTR(debug), BOOLSTR(robust));
+
+if (!EGL_KHR_create_context_setup(mask))
+goto out;
+
+if (eglBindAPI(api) != EGL_TRUE)
+goto out;
+
+if (api == EGL_OPENGL_ES_API) {
+attribs[ai++] = EGL_CONTEXT_CLIENT_VERSION;
+attribs[ai++] = 2;
+}
+if (debug || robust) {
+EGLint flags = 0;
+flags |= debug ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0;
+flags |= robust ? EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR : 0;
+attribs[ai++] = 

[Piglit] [Bug 101850] New: [PIGLIT] Piglit does not recognize some tests

2017-07-19 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101850

Bug ID: 101850
   Summary: [PIGLIT] Piglit does not recognize some tests
   Product: piglit
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: tests
  Assignee: piglit@lists.freedesktop.org
  Reporter: hector.edmundox.ramirez.go...@intel.com
QA Contact: piglit@lists.freedesktop.org

Description
===
Piglit does not recognize these two tests:
igt@drm_mm
igt@drv_selftest


Versions
==
Component: intel-gpu-tools
tag: intel-gpu-tools-1.19-96-gfb1ddc4
commit: fb1ddc47003ad6a683db79beeb81b6cbab1feb7c

Component: piglit
tag: piglit-v1
commit: 56e7e5583cd4a3ca15a8cda154d46d168959dd25


How to reproduce
=
Run an IGT execution on a platform. Testslit in use must contain the two
problematic tests mentioned in description. After initiating the execution,
piglit will fail

1) Run as this command:
$ : /home/gfx/intel-graphics/intel-gpu-tools/piglit/piglit run igt -o
/home/gfx/iterationT --test-list /home/gfx/dead.testlist -l verbose --sync
Traceback (most recent call last):
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/piglit", line 174, in

main()
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/piglit", line 170, in
main
sys.exit(runner(args))
  File
"/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/exceptions.py", line
51, in _inner
func(*args, **kwargs)
  File
"/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/programs/run.py",
line 357, in run
profile.run(profiles, args.log_level, backend, args.concurrency)
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/profile.py",
line 387, in run
profiles = [(p, list(p.itertests())) for p in profiles]
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/profile.py",
line 387, in 
profiles = [(p, list(p.itertests())) for p in profiles]
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/profile.py",
line 317, in itertests
opts[n] = self.test_list[n]
  File "/home/gfx/intel-graphics/intel-gpu-tools/piglit/framework/profile.py",
line 161, in __getitem__
return self.__container[key.lower()]
KeyError: 'igt@drm_mm'



Expected  behavior
=
Execution should begin normally


Current Behavior
=
Execution does not begin due to unrecognized tests

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit