[Mesa-dev] [PATCH 13/14] egl: Track EGL_KHR_debug state when going through EGL API calls

Adam Jackson ajax at redhat.com
Tue Sep 13 16:46:32 UTC 2016


On Tue, 2016-09-13 at 16:54 +0100, Emil Velikov wrote:
> Going through table 13.2 and the below there are some discrepancies.
> 
> AFAICT some of those can be seen as spec bugs (B), while others seem
> to be missing (M)
>  - thread - eglBindAPI (M)

Not really missing, but tricky. _EGL_FUNC_START calls _eglSetFuncName
which initializes thr->CurrentObjectLabel, so if there _is_ a non-dummy 
thread then the callback will get the correct label for the thread
object.

However, if we're on the dummy thread, then we'll hit the call
to _eglDebugReportFull(objectLabel=NULL), which will correctly call the
callback with both labels NULL. Arguably _eglSetFuncName should also
clear ->CurrentObjectLabel in this case.

>  - display - eglGetCurrentDisplay (B)

It's somewhat irrelevant since our implementation never throws an error
on this path (and it's not clear that any implementation ever would),
but: what do you mean by "spec bug" here?

>  - context - eglQueryAPI (M),

eglQueryAPI is _defined_ as never throwing an error, so I'm not sure
this is really "missing". However, the dummy thread's ->CurrentAPI is
initialized to 0, but "no API" is EGL_NONE which is not zero but
0x3038, so that really is a bug; I'll fix that up.

>  eglGetCurrentContext (B)

Again, this is defined as not throwing an error, so as long as we never
trigger the debug callback there's no problem here.

>  - surface - eglSwapInterval (B)

Again, not sure what you mean by "spec bug" here. But there is an
implementation bug, we should pass ctx->DrawSurface as the active
object to _EGL_FUNC_START since we're already locked; if it's NULL and
we have a live thread then _eglSetFuncName will clear the current
object label correctly. I'll fix that up.

>  eglGetCurrentSurface(B)

The weird part about this one is that we might need to throw an error
before we've found a valid surface to operate with. The spec allows the
object label to be NULL in this case, but _eglSetFuncName isn't
clearing the current object label when initialized with a NULL object.
I'll fix that too.

- ajax


More information about the mesa-dev mailing list