Revert "egl: For OpenGL ES2, allow requests for version > 2.0"

This reverts commit 7d767558102e888d1f380b22301d1ee3adb1e3d5.  I'm
reverting this due to more confusion about the ES3 bit.

Commit 52df64a "waffle: Support OpenGL ES3" was my first attempt at
implementing ES3 support, which I reverted in 7147d9b.  Commit 7d76755
"egl: For OpenGL ES2, allow requests for version > 2.0" was my 2nd attempt
to implement OpenGL ES3 support.

After seeking clarification from Khronos' EGL working group on the
semantics of EGL_OPENGL_ES3_BIT_KHR, I discovered that it is illegal to
request, with a config whose EGL_RENDERABLE_TYPE lacks
EGL_OPENGL_ES3_BIT_KHR, a GL context whose EGL_CONTEXT_OPENGL_MAJOR_VERSION = 3.

Therefore the original implementation in 52df64a was correct and should
not have been reverted. The 2nd implementation 7d76755 was incorrect.
Hopefully, I can now finally proceed implementing OpenGL ES3 support
correctly and without confusion.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
gitignore: Ignore ninja files
glx: Choose a larger array length to prevent accidental overflow

The attribute list passed to glXCreateContextAttribs, increase its length
from from 7 to 64.

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

s/which/about the/

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
man: Improve docs for waffle_config and waffle_context

* The documentation for config attributes was overly complicated by
the discussion of each native platform's subtleties. Remove most
discussion of those subtleties and simply refer the reader to external
documentation for additional details.

* The documentation for config attributes was also complicated by the
discussion of version promotion. Move that discussion to the
waffle_context manpage.

* Extend the "SEE ALSO" lists for each manpage.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Refactor validation of context attributes

Decompose validation from one function into three functions:
  - generic validation for any api
  - validation for OpenGL
  - validation for OpenGL ESx

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Add field wcore_config_attrs::context_full_version

Many functions independently computed the full version by combining the
major and minor version. This patch replaces those identical computations
with a single one in wcore_config_attrs_parse(), and stores the result in
wcore_config_attrs::context_full_version.

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

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Support OpenGL ES1 contexts

The ability to create arbitrary OpenGL ES contexts was introduced by
GLX_EXT_create_context_es_profile.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
tests/gl_basic: Add cases glx_basic.gles1_{rgb,rgba}

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wegl: Refactor packing of attrib_list for eglCreateContext

Replace hardcoded indices into attrib_list[] with a sequence of i++.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl,glx: Remove redundant profile check done by core

When requesting version >= 3.2 of OpenGL, the core module verifies that
the requested profile attribute is valid.

This patch removes the redundant re-validation in the glx and egl modules
with an assertion.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Move extension fields out of sub-struct

Remove field glx_display::extensions and move each field
glx_display::extensions::$ext_name to glx_display::$ext_name. The
extension struct added no information and just made necessary extra
typing.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Fix glx_display_supports_context_api for ES1

For WAFFLE_CONTEXT_OPENGL_ES1, the function unconditionally returned false
despite that glx_config_choose and glx_context_create now support ES1.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Refactor filling of attrib_list for glxCreateContextAttribs

This patch rearranges the code so that the outer control block is a switch
on the context api. This makes the code easier to follow.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Check that requested profile is WAFFLE_NONE for ES

The waffle_config manpages documents this requirement.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Fix profile validation for GL

For OpenGL:
  - For version < 3.2, ignore the profile.
  - For version >= 3.2, check that version is either core or compat.

This complies with the waffle_config manpage, section
WAFFLE_CONTEXT_PROFILE.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl: Fix unitialized variable bug

If EGL_KHR_create_context was unsupported and the requested API was
OpenGL, then attrib_list[] was accessed with unitialized index variable i.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
man: Fix a misplaced newline

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
man/waffle_config: Clarify the possibility of version/profile rejection

Clarify that, even if waffle successfully returns a config, the native
platform may later reject the requested version and profile at time of
context creation.

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