Bug 106377 - eglWaitClient() doesn't work for surfaceless contexts
Summary: eglWaitClient() doesn't work for surfaceless contexts
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: EGL (show other bugs)
Version: 18.0
Hardware: All All
: medium major
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-03 13:23 UTC by Mike Gorchak
Modified: 2018-05-04 06:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gorchak 2018-05-03 13:23:07 UTC
When surfaceless contexts are in use (for example, for FBO rendering), eglWaitClient return an error EGL_BAD_CURRENT_SURFACE. According to spec it should do glFinish()-like behavior disregarding if it has bound surface to the context or not.

In case of using DRI2 backend it happens that in case of surfaceless context dri2_wait_client() is not called at all and aborted at _eglWaitClientCommon() function with following check:

   /* let bad current context imply bad current surface */
   if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
       _eglGetSurfaceHandle(ctx->DrawSurface) == EGL_NO_SURFACE)
      RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE);
Comment 1 Tapani Pälli 2018-05-04 06:33:21 UTC
EGL spec says following:

"If a surface associated with the calling thread’s current context is no longer
valid, an EGL_BAD_CURRENT_SURFACE error is generated."

Having zero mention of surfaceless context here seems like a spec bug to me. When surfaceless was brought part of spec it seems it only touched MakeCurrent.
Comment 2 Tapani Pälli 2018-05-04 06:50:52 UTC
I've filed following bug for discussion:

https://gitlab.khronos.org/egl/API/issues/12


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.