glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA
authorAndreas Boll <andreas.boll.dev@gmail.com>
Tue, 24 Feb 2015 19:01:30 +0000 (20:01 +0100)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Wed, 25 Feb 2015 07:23:38 +0000 (08:23 +0100)
commit6d164f65c5a794164d07bc66c1f8f87280514e8c
tree81fbafd71e4859ff7248c3816f0539e9aee1ec02
parent06924972d5982f00e66335a66df0172a9d90cc29
glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA

If the renderer supports the core profile the query returned incorrectly
0x8 as value, because it was using (1U << __DRI_API_OPENGL_CORE) for the
returned value.

The same happened with the compatibility profile. It returned 0x1
(1U << __DRI_API_OPENGL) instead of 0x2.

Internal DRI defines:
   dri_interface.h: #define __DRI_API_OPENGL       0
   dri_interface.h: #define __DRI_API_OPENGL_CORE  3

Those two bits are supposed for internal usage only and should be
translated to GLX_CONTEXT_CORE_PROFILE_BIT_ARB (0x1) for a preferred
core context profile and GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB (0x2)
for a preferred compatibility context profile.

This patch implements the above translation in the glx module.

v2: Fix the incorrect behavior in the glx module

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/dri_common_query_renderer.c