glx: Add glXCreateContextAttribs workaround for NVidia bug

With NVidia, calling glXCreateContextAttribsARB with MAJOR=1 and MINOR=0
returns an OpenGL 2.1 context. Calling it with MAJOR and MINOR unspecified
returns a context of the latest supported OpenGL version. However, according to
the GLX_ARB_create_context spec, the two calls should behave identically.
Calling with MAJOR and MINOR unspecified produces the expected behavior.

As a workaround, do not specify GLX_CONTEXT_MAJOR_VERSION_ARB and
GLX_CONTEXT_MINOR_VERSION_ARB in the call to glXCreateContextAttribsARB if the
user requested an OpenGL context of unspecified version or if the user
explicitly requested an OpenGL 1.0 context.

Reported-by: Paul Berry <stereotype441@gmail.com>
Reviewed-and-tested-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit a84f39fcf8e16f421aeed1fe6b60fc631108c5b9)
glx: Fix gles regression

In glx_context_fill_attrib_list, recently a check was added to
work around a bug for OpenGL v1.0 contexts and NVidia. This
check introduced a bug where for OpenGL ES (all versions)
the attrib_list wasn't getting entries for
GLX_CONTEXT_MAJOR_VERSION_ARB or GLX_CONTEXT_MINOR_VERSION_ARB.
In piglit, this causes all OpenGL ES testcases to fail with
context failures.
This fix adjusts the comparison so that OpenGL ES will always
have the context version and not set it for a Open GL v1.0
context.

[chadv: Replace != OPENGL_ES1 with == OPENGL to improve readability.
 Double negatives are confusing.]

Signed-off-by: Tom Gall <tom.gall@linaro.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit c6cf7f9fb2b8f05914b631f152261df2b7bae932)