[Mesa-dev] [PATCH 2/2] egl: make eglWaitClient behave like glFinish

Tapani Pälli tapani.palli at intel.com
Thu May 3 16:00:20 UTC 2018


As defined by the spec:
   "All rendering calls for the currently bound context, for
   the current rendering API, made prior to eglWaitClient, are
   guaranteed to be executed before native rendering calls made
   after eglWaitClient which affect the read or draw surfaces
   associated with that context.

   The same result can be achieved using client API-specific calls
   such as glFinish or vgFinish."

v2: call glFinish() to ensure identical behaviour

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106337
---
 src/egl/drivers/dri2/egl_dri2.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index de56c16221..5cf366a04c 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -123,6 +123,7 @@ static void dri2_##x() \
 }\
 
 DECL_GLCALL(glFlush);
+DECL_GLCALL(glFinish);
 
 #undef DECL_GLCALL
 
@@ -1723,17 +1724,14 @@ dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 static EGLBoolean
 dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
 {
-   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
-   _EGLSurface *surf = ctx->DrawSurface;
-   __DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
-
    (void) drv;
+   (void) disp;
+   (void) ctx;
 
    /* FIXME: If EGL allows frontbuffer rendering for window surfaces,
     * we need to copy fake to real here.*/
 
-   if (dri2_dpy->flush != NULL)
-      dri2_dpy->flush->flush(dri_drawable);
+   dri2_glFinish();
 
    return EGL_TRUE;
 }
-- 
2.13.6



More information about the mesa-dev mailing list