Bug 56706 - EGL sets error to EGL_SUCCESS when DRI driver fails to create context
Summary: EGL sets error to EGL_SUCCESS when DRI driver fails to create context
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: Chad Versace
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-03 06:32 UTC by Chad Versace
Modified: 2012-11-21 00:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Chad Versace 2012-11-03 06:32:20 UTC
Observed on mesa-84b4372 with i965.

There is no bugzilla category for EGL, so I'm placing this bug in the GLX category.


How to reproduce
-----------------
On i965, call eglCreateContext() with EGL_CONTEXT_MAJOR_VERSION_KHR/EGL_CONTEXT_MINOR_VERSION_KHR set to 3.2. Context creation will fail because i965 does not yet support GL 3.2. Afterwards, eglGetError() returns EGL_SUCCESS.

For a standalone testcase that reproduces the problem, run the example program "gl_basic" found in waffle-7d76755. Run it as `gl_basic x11_egl gl 3.2.


Expected behavior
-----------------
eglGetError() should return EGL_BAD_MATCH. From the EGL_KHR_create_context spec:

      * 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.


Diagnosis
---------
In eglCreateContext, no error code is set when drv->API.CreateContext fails.
Comment 1 Chad Versace 2012-11-21 00:00:48 UTC
Change status to RESOLVED/FIXED. Fixed by 

commit 5cf8536690226b3bd19d19197fcec501a278703c
Author: Chad Versace <chad.versace@linux.intel.com>
Date:   Fri Nov 9 14:06:41 2012 -0800

    egl/dri2: Set error code when dri2CreateContextAttribs fails


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.