linux_dl: Update stale comments before Mesa shipped ES3

Before Mesa shipped ES3, Waffle speculated that the library name would
remain libGLESv2.so. Speculation became reality. Update some comments
to replace that speculation with a statement of fact.

Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
doxygen: Remove bitrotted Doxygen grouping directives

I had grand plans for Waffle's Doxygen. @defgroup, @ingroup,
@addtogroup, OH MY! The intent was that documentation for modules and
classes would be logically grouped in the Doxygen output. Alas, these
plans never really happened and Waffle's Doxygen grouping is a mess.

Mercy kill the Doxygen grouping directives. They can always be
resurrected if someone cares to clean it up.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
doxygen: Clean up @file directives

- Remove filename from @file directives. The filename should remain
  autodetected, otherwise the doxygen block becomes orphaned when the file
  becomes renamed.
- Don't put brief comments in @file. They go in @brief.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
debian: Fix lintian warning debhelper-but-no-misc-depends

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
debian: Set source format to 3.0 (quilt)

This helps fix a lintian warning.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
glx: Fix build in CMAKE_BUILD_TYPE=Debug

Fix this error.

glx_context.c: In function ‘glx_context_fill_attrib_list’:
glx_context.c:112:24: error: ‘dpy’ undeclared
  assert(dpy->ARB_create_context_profile);

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
debian: rename libwaffle-1 to libwaffle-1-0

The libwaffle-1 library has a soname INTERFACE version of 0. Debian's
libtian tool generates the warning package-name-doesnt-match-sonames
since the package name doesnt end with 0.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
wflinfo: Use glGetStringi(GL_EXTENSION, i) for all contexts >= 3.0

Pre-patch, wflinfo used glGetStringi only for desktop OpenGL >= 3.0.
Unlike the OpenGL Core Profile, OpenGL ES 3.0 also supports
glGetString(GL_EXTENSIONS) for backwards compatibility with OpenGL ES
2.0. However, let's use the forward-looking API when it's available.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Don't allow negative version numbers

Previously, -V 4.-8 would be treated the same as -V 3.2.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Don't modify struct options after initialization

parse_args() initializes global options. After that, options should be
immutable. To ensure that, constify each occurence of struct options as
a function parameter.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Cleanup signature of wflinfo_try_create_context()

The function creates and returns two objects: a context and a config.
The context is the function's return value, and the config is an out
parameter.

Functions with asymmetric returns, I find awkard. Fix the signature to
return both objects as out parameters.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Cleanup signature of wflinfo_create_context()

The function creates and returns two objects: a context and a config.
The context is the function's return value, and the config is an out
parameter.

Functions with asymmetric returns, I find awkard. Fix the signature to
return both objects as out parameters.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Replace s/-1/WAFFLE_DONT_CARE/ when relevant

This clarifies the code's intent.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Distinguish between cmdline options and func options

'struct options` is intended for cmdline options. But wflinfo repurposed
it to manage waffle_config attributes too by passing it into
wflinfo_create_context() and wflinfo_try_create_context().

Add a new type `struct wflinfo_config_attrs`.  Stop passing `struct
option` to those functions and pass wflinfo_config_attrs instead.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wflinfo: Make wflinfo understand OpenGL 3.1 profiles

Strictly speaking, an OpenGL 3.1 context has no profile. But if the user
calls wflinfo like below...
    wflinfo --api=gl --version=3.1
    wflinfo --api=gl --version=3.1 --profile=none
    wflinfo --api=gl --version=3.1 --profile=core
    wflinfo --api=gl --version=3.1 --profile=compat
then we know what they way. Make wflinfo do what the user wants.

Likewise, if the user provided a profile but no version, like this...
    wflinfo --api=gl --profile=core
    wflinfo --api=gl --profile=compat
then wflinfo iterated over OpenGL context versions from 4.4 to 3.2 in
search of the given profile. Because wflinfo now understands 3.1
profiles, it iterates down to 3.1.

Because OpenGL 3.1 contexts don't have true profiles, this patch adds
gobs of special case code to pretend they do.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Set waffle_error when glXMakeCurrent fails

Jordan found this because `wflinfo -p glx -a gl -V 3.1 --profile=core`
failed on NVidia with this unhelpful message:
"Waffle error: 0x0 WAFFLE_NO_ERROR".

Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>