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>
Test that struct names may not begin with "gl_" prefix.
Test illegal usages of "gl_" prefix in interface blocks.
Test that redeclaration of gl_PerVertex must be for a subset.
Test that interface blocks cannot declare conflicting names.
Test that in general, interface blocks cannot be redeclared.
Test that the built-in gl_PerVertex interface block can be redeclared.
Test that gl_PerVertex can't be redeclared after it's been used.
Test that gl_PerVertex can't be redeclared multiple times in one shader.
Test that after redeclaration, absent members of gl_PerVertex can't be used.
Test that builtins can't be redeclared both inside and outside gl_PerVertex.
Test inter- and intra-stage gl_PerVertex matching rules.

These tests verify the following linkage rules, from GLSL 4.10:

1. If multiple shaders using members of a built-in block belonging to
the same interface are linked together in the same program, they must
all redeclare the built-in block in the same way, as described in
section 4.3.7 "Interface Blocks" for interface block matching, or a
link error will result.

2. It will also be a link error if some shaders in a program redeclare
a specific built-in interface block while another shader in that
program does not redeclare that interface block yet still uses a
member of that interface block.
Verify array-ness and instance name of gl_PerVertex redeclarations.
Verify that gl_PerVertex can't be redeclared in certain shader types.