[Mesa-dev] [PATCH mesa] egl: check the correct function pointer

Eric Engestrom eric.engestrom at imgtec.com
Wed Aug 2 16:47:02 UTC 2017


`.swap_interval` != `.SwapInterval`...

Fixes: 991ec1b81a76de24fd01 "egl: make platform's SwapInterval() optional"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102015
Cc: Cedric Sodhi <manday at openmail.cc>
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 src/egl/drivers/dri2/egl_dri2.c | 2 ++
 src/egl/main/eglapi.c           | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index a197e0456f..733659d547 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1455,6 +1455,8 @@ dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
                    EGLint interval)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+   if (!dri2_dpy->vtbl->swap_interval)
+      return EGL_TRUE;
    return dri2_dpy->vtbl->swap_interval(drv, dpy, surf, interval);
 }
 
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index f32f1a80b0..1fa9f5441d 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1205,7 +1205,7 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval)
                     surf->Config->MinSwapInterval,
                     surf->Config->MaxSwapInterval);
 
-   if (surf->SwapInterval != interval && drv->API.SwapInterval)
+   if (surf->SwapInterval != interval)
       ret = drv->API.SwapInterval(drv, disp, surf, interval);
    else
       ret = EGL_TRUE;
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list