egl-create-context-verify-gl-flavor: Test GLES3

- Request a config with the es3 bit, EGL_OPENGL_ES3_BIT_KHR.
- Try to create a GLES 3.0 context with the config.
- Verify that the context version is >= 3.0.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl_khr_create_context: Check eglChooseConfig's errors

If eglChooseConfig fails with EGL_BAD_ATTRIBUTE, then fail the test.
Piglit only requests valid attributes, therefore the error is incorrect.

Regresses test egl-create-context-verify-gl-flavor:gles3.0 on
mesa-5cf853669. Mesa fails to recoginize EGL_OPENGL_ES3_BIT_KHR despite
exposing the EGL_KHR_create_context extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl-create-context-verify-gl-flavor: Test bogus versions

Attempt to create contexts with bogus versions.

Tests Mesa commit 243cf7a924eaef78ce0d5150747fae6c3c4e6974. Before that
commit, the Intel driver failed to validate requested OpenGL ES context
versions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
texture-integer-glsl130: Expect 1 for alpha in R, RG, RGB cases.

Table 3.23 (on page 221) of the OpenGL 3.0 specification is:

+----------------------------------------+
| Texture Base    | Texture source color |
| Internal Format |    C_s          A_s  |
+-----------------+----------------------+
| ALPHA           | (0, 0, 0)    |   A   |
| LUMINANCE       | (L, L, L)    |   1   |
| LUMINANCE_ALPHA | (L, L, L)    |   A   |
| INTENSITY       | (I, I, I)    |   I   |
| RED             | (R, 0, 0)    |   1   |
| RG              | (R, G, 0)    |   1   |
| RGB             | (R, G, B)    |   1   |
| RGBA            | (R, G, B)    |   A   |
+-----------------+----------------------+

From this, we see when sampling from RED, RG, and RGB textures, alpha
is supposed to be one.

v2: Change commit message to quote the right part of the spec.

Reviewed-by: Eric Anholt <eric@anholt.net>
util: Do not use setrlimit/getrlimit if RLIMIT_AS is not defined.

OpenBSD is one platform that does not define the symbol RLIMIT_AS.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Revert "texture-integer-glsl130: Expect 1 for alpha in R, RG, RGB cases."

This reverts commit cf47699087f74a6fd94c59a74837fc6c3c6422a8.

While I still believe the test is wrong, apparently this change made it
worse; the test doesn't quite work like I thought.  More investigation
is needed.  In the meantime, restore the old behavior.
time-elapsed: Spend time in the FS rather than do a lot of draws.

The time-elapsed test needs to consume a lot of GPU time so that it
can validate GPU time queries against elapsed wall-clock time.
Previously we did this by painting the window thousands of times.
That sometimes caused false failures due to the CPU time consumed in
preparing the draw calls.

This patch changes the test so that it consumes time by using a slow
fragment shader rather than by painting the window over and over.
glslparsertest: Use integers for GL and GLSL versions

I haven't observed any failures with this yet.  Since we just did the
same thing with shader_runner, it seems like a good idea.

v2: Fix two off-by-10x errors pointed out by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glslparsertest: Add support for GLSL ES 3.0 via GL_ARB_ES3_compatibility

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glsl-es-3.00: Verify that no statment is allowed before the first case in a switch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glsl-es-3.00: Verify that .length() returns a signed integer

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glsl-es-3.00: Verify that .length() returns a constant expression

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glsl-1.40: Add a new UBO test for a potential bug in the i965 driver.
glsl-1.40: Add a test for a path in i965 where I had an XXX comment.
egl_khr_create_context: Fix build error with old eglext.h

This patch defines EGL_OPENGL_ES3_BIT_KHR, for the case when eglext.h is
too old.

Reported-by: Ken Phillis Jr <kphillisjr@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl: Fix typo in previous commit
framework: add returncode parameter to ExecTest.interpretResult

The intel-gpu-tools testrunner needs this to figure out the
testresult (since 'skip' is indicated by a returncode of 77
in i-g-t).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
igt: new testinfrastructure to support drm/i915 kernel tests

Piglit as a testrunner is _so_ much better than automake's make check.

Based upon a quick patch from Kenneth Graunke.

v2: Add copyright header.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
framework: unicode() wrap format string

Otherwise python2 blows up when the program output contains a non-ascii
character. The resulting exception caused a bunch of spurious fails in
the igt testscases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
igt: auto-enumerate subtests

This works together with the new subtest infrastructure in
intel-gpu-tools.

v2: An empty string crept into the subtest list, resulting in a
testcase failure. Filter it out.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>