egl: return correct error code for a case req ver < 3 with forward-compatible

Submitted by andrey simiklit on Oct. 11, 2018, 11:12 a.m.

Details

Message ID 20181011111211.14000-1-asimiklit.work@gmail.com
State New
Headers show
Series "egl: return correct error code for a case req ver < 3 with forward-compatible" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

andrey simiklit Oct. 11, 2018, 11:12 a.m.
From: Andrii Simiklit <andrii.simiklit@globallogic.com>

The EGL_KHR_create_context spec says:
   "If an OpenGL context is requested and the values for attributes
    EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR,
    when considered together with the value for attribute
    EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
    version and feature set that are not defined, than an
    EGL_BAD_MATCH error is generated."

This case will be correctly handled
a bit below after a 'for' loop when we
remove this handling.

Fixes: 11cabc45b712 "egl: rework handling EGL_CONTEXT_FLAGS"
Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
---
 src/egl/main/eglcontext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index ecc546e113..44a4469a97 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -179,7 +179,7 @@  _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
           *     will generate an error."
           */
          if ((val & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) &&
-             (api != EGL_OPENGL_API || ctx->ClientMajorVersion < 3)) {
+              api != EGL_OPENGL_API) {
             err = EGL_BAD_ATTRIBUTE;
             break;
          }

Comments

Hello,

Any updates here?

I think that I missed tag:
Reported-by: Ian Romanick <idr@freedesktop.org>
Here: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552#c9

The patch for the test which will check it:
https://patchwork.freedesktop.org/patch/256432/

Thanks,
Andrii.

On Thu, Oct 11, 2018 at 2:12 PM <asimiklit.work@gmail.com> wrote:

> From: Andrii Simiklit <andrii.simiklit@globallogic.com>
>
> The EGL_KHR_create_context spec says:
>    "If an OpenGL context is requested and the values for attributes
>     EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR,
>     when considered together with the value for attribute
>     EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
>     version and feature set that are not defined, than an
>     EGL_BAD_MATCH error is generated."
>
> This case will be correctly handled
> a bit below after a 'for' loop when we
> remove this handling.
>
> Fixes: 11cabc45b712 "egl: rework handling EGL_CONTEXT_FLAGS"
> Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=92552
> Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
> ---
>  src/egl/main/eglcontext.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
> index ecc546e113..44a4469a97 100644
> --- a/src/egl/main/eglcontext.c
> +++ b/src/egl/main/eglcontext.c
> @@ -179,7 +179,7 @@ _eglParseContextAttribList(_EGLContext *ctx,
> _EGLDisplay *dpy,
>            *     will generate an error."
>            */
>           if ((val & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) &&
> -             (api != EGL_OPENGL_API || ctx->ClientMajorVersion < 3)) {
> +              api != EGL_OPENGL_API) {
>              err = EGL_BAD_ATTRIBUTE;
>              break;
>           }
> --
> 2.17.1
>
>