Fix -Wformat-security warnings in AMD_performance_monitor tests.
glx-query-drawable: Add test for GLX_FBCONFIG_ID

Signed-off-by: Adam Jackson <ajax@redhat.com>
glx-query-drawable: Add test for GLX_PRESERVED_CONTENTS

Signed-off-by: Adam Jackson <ajax@redhat.com>
cmake,dma_buf: Refactor decisions to build dma_buf tests

This patch unifies the logic for deciding (1) to build dma_buf support
into libpiglitutil and (2) to build the ext_image_dma_buf_import tests.
In doing so, the patch creates a new CMake option,
PIGLIT_BUILD_DMA_BUF_TESTS.

It doesn't make sense to do (1) without (2) because the tests would all
skip. There does exist some logic in the ext_image_dma_buf_import
CMakeLists to prevent the tests from getting built without (1), but the
logic is incopmlete. This patch's unification fixes the incompleteness.

During Piglit's initial configuration, CMake chooses a default value of
PIGLIT_BUILD_DMA_BUF_TESTS based on what packages are present on the
system.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake,dma_buf: Require xcb-dri2 for dma_buf tests (v2)

xcb-dri2 is an optional build dependency for the dma_buf tests.  If
xcb-dri2 is present, then the tests use it to gain DRM authentication.
Otherwise, the tests must be ran as root.

No one likes running tests as root, so require xcb-dri2 for these tests.

v2: Fix spurious whitespace.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake,dma_buf: Require libdrm_intel>=2.4.38 to build dma_buf tests

The dma_buf tests, when running on Intel hardware, use DRM prime
buffers. Support for prime buffers arrived in libdrm_intel>=2.4.38.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
ext_image_dma_buf_import: Fix build with mesa < 9.2

The extension EGL_EXT_image_dma_buf_import is a recent extension,
published 2013-02-09, and therefore the eglext.h on many systems do not
define it.  The first Mesa version in which eglext.h defined the
extension was was Mesa 9.2.

To fix the build on such systems, define the extension's enums in
image_common.h.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
shader_runner: Re-use struct string_to_enum for enable_table.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
shader_runner: Refactor string-to-enum lookups.

We now do all lookups associated with string_to_enum using
lookup_enum_string().

Note: this function is a little more robust than the old string
lookups--previously, we would erroneously match an initial substring
(e.g. if the table contained "GL_DEPTH_COMPONENT", it would
erroneously match "GL_DEPTH_COMPONENT16").  We used to deal with that
in an ad-hoc kludgy way (by sometimes putting trailing spaces in the
string table).  Putting proper whitespace handling in
lookup_enum_string() seems a lot safer.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
shader_runner: Add the ability to set hints.

v2: Rework using ENUM_STRING() macro.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Test accuracy of dFdx and dFdy functions.

Mesa/i965 currently (as of commit 1cc3b90) has an inaccurate
implementation of dFdy() which produces the same results for every
pixel in an aligned 2x2 block.  This piglit test exposes the
inaccuracy.

v2: Use an error threshold of 1.0e-3 for both tests.  Set hint
GL_FRAGMENT_SHADER_DERIVATIVE_HINT to GL_NICEST, since some
implementations may use a less accurate derivative formula by default
in order to speed up textureGrad operations.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
GL 3.2: Test framebuffer with layered attachments

Make sure layered rendering results in a complete framebuffer
status.

Also, when using layered rendering GL_FRAMEBUFFER_ATTACHMENT_LAYERED
should return as TRUE from glGetFramebufferAttachmentParameteriv.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
GL 3.2: Test layered framebuffer status

Make sure FB completeness works properly when attaching two
textures when using layered textures.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
GL 3.2: Test FramebufferTexture when texture value is zero

Verify proper texture state values are returned when a zero
texture is bound with FramebufferTexture.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
arb_draw_indirect: add test for api errors

This initial test covers the new buffer binding point and expected API errors only;
no successful Draw*Indirect calls are made.

Future tests will exercise positive cases.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
add new test for glDrawArraysIndirect
add test for DrawElementsIndirect