cmake: If using Waffle, require waffle >= 1.3

Subsequent patches will enable creation of forward-compatible and debug
contexts, which arrived in waffle-1.3.

After this patch, you may need to remove CMakeCache.txt and rerun CMake. The
problem is that CMake caches the results of pkg-config queries.  Alternatively,
you may manually update the value of CMakeCache.txt:WAFFLE_VERSION in any text
editor.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/waffle: Print more info when context creation fails

When waffle_config_choose() or waffle_context_create() fails, print
Waffle's error message to stderr. Several people (Carl, Ian, Timothy
Arceri) have requested this.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/wfl: Refactor make_context_current_singlepass()

Let make_context_current_singlepass() directly call
waffle_config_choose(). Add helper function make_config_attrib_list()
that makes the attribute list passed to waffle_config_choose(). This
refactor will make possible better error messages.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/waffle: Improve error messages when context creation fails

Unify the 3 occurences of message "Failed to create ... context", and
move the message closer to the failure.

Print a more helpful message when special_case_gl_31() fails.

Add helper function make_context_description(), used in the newer better
error messages.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/gl: Support creation of forward-compatible contexts

Add a new boolean flag to the PIGLIT_GL_TEST_CONFIG block,
`config.require_forward_compatible_context`. If the test is unable to
create a foward-compatible context, then the test skips.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/gl: Support creation of debug contexts

Add a new boolean flag to the PIGLIT_GL_TEST_CONFIG block,
`config.require_debug_context`. If the test is unable to create a debug
context, then the test skips.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/wfl: Remove hacks for compat contexts

When a test requested a compatibility context, Piglit did not pass the
context version to Waffle. Instead, Piglit requested an unversioned
compatibility context and then verified with piglit_get_gl_version()
that the actual version was >= requested version.

This hack prevented Piglit from creating forward-compatible contexts,
because, according to thw EGL_KHR_create_context spec, "requesting
a forward-compatible context for OpenGL versions less than
3.0 will generate an error."

Remove the hack. Pass the requested context version to Waffle.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
gl-3.0: Add test for the forward-compatible bit

Create a context with or without the forward-compatible bit, according to
a command line flag.  Then verify that GL_CONTEXT_FLAGS does or does not
contain GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>