[Mesa-dev] [PATCH mesa 3/8] eglapi: add entrypoint for eglClientWaitSyncKHR

Eric Engestrom eric at engestrom.ch
Sun Feb 19 23:51:18 UTC 2017


On Sunday, 2017-02-19 18:33:16 -0500, Ilia Mirkin wrote:
> Why are patches 1-3 necessary?

They allow patch #4, which makes use of a macro to simplify the list,
(requires a 1:1 mapping of entrypoint to function) which also allows for
the simple sorting test script in patch #7.
I could do without, but honestly I just thought this looked cleaner.

Also, I think the debug extension would print the wrong function names
before these patches? Not tested though, maybe it somehow worked.

> 
> On Sun, Feb 19, 2017 at 6:23 PM, Eric Engestrom <eric at engestrom.ch> wrote:
> > Signed-off-by: Eric Engestrom <eric at engestrom.ch>
> > ---
> >  src/egl/main/eglapi.c | 31 ++++++++++++++++++++++++-------
> >  1 file changed, 24 insertions(+), 7 deletions(-)
> >
> > diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
> > index e149c0f8d1..e44375a106 100644
> > --- a/src/egl/main/eglapi.c
> > +++ b/src/egl/main/eglapi.c
> > @@ -1762,16 +1762,13 @@ eglDestroySyncKHR(EGLDisplay dpy, EGLSync sync)
> >  }
> >
> >
> > -EGLint EGLAPIENTRY
> > -eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
> > +static EGLint
> > +_eglClientWaitSyncCommon(_EGLDisplay *disp, EGLDisplay dpy,
> > +                         _EGLSync *s, EGLint flags, EGLTime timeout)
> >  {
> > -   _EGLDisplay *disp = _eglLockDisplay(dpy);
> > -   _EGLSync *s = _eglLookupSync(sync, disp);
> >     _EGLDriver *drv;
> >     EGLint ret;
> >
> > -   _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
> > -
> >     _EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv);
> >     assert(disp->Extensions.KHR_reusable_sync ||
> >            disp->Extensions.KHR_fence_sync ||
> > @@ -1800,6 +1797,26 @@ eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout)
> >        RETURN_EGL_EVAL(disp, ret);
> >  }
> >
> > +EGLint EGLAPIENTRY
> > +eglClientWaitSync(EGLDisplay dpy, EGLSync sync,
> > +                  EGLint flags, EGLTime timeout)
> > +{
> > +   _EGLDisplay *disp = _eglLockDisplay(dpy);
> > +   _EGLSync *s = _eglLookupSync(sync, disp);
> > +   _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
> > +   return _eglClientWaitSyncCommon(disp, dpy, s, flags, timeout);
> > +}
> > +
> > +static EGLint EGLAPIENTRY
> > +eglClientWaitSyncKHR(EGLDisplay dpy, EGLSync sync,
> > +                     EGLint flags, EGLTime timeout)
> > +{
> > +   _EGLDisplay *disp = _eglLockDisplay(dpy);
> > +   _EGLSync *s = _eglLookupSync(sync, disp);
> > +   _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
> > +   return _eglClientWaitSyncCommon(disp, dpy, s, flags, timeout);
> > +}
> > +
> >
> >  static EGLint
> >  _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags)
> > @@ -2393,7 +2410,7 @@ eglGetProcAddress(const char *procname)
> >        { "eglCreateSyncKHR", (_EGLProc) eglCreateSyncKHR },
> >        { "eglCreateSync64KHR", (_EGLProc) eglCreateSync64KHR },
> >        { "eglDestroySyncKHR", (_EGLProc) eglDestroySyncKHR },
> > -      { "eglClientWaitSyncKHR", (_EGLProc) eglClientWaitSync },
> > +      { "eglClientWaitSyncKHR", (_EGLProc) eglClientWaitSyncKHR },
> >        { "eglWaitSyncKHR", (_EGLProc) eglWaitSyncKHR },
> >        { "eglSignalSyncKHR", (_EGLProc) eglSignalSyncKHR },
> >        { "eglGetSyncAttribKHR", (_EGLProc) eglGetSyncAttribKHR },
> > --
> > Cheers,
> >   Eric
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list