egl: check the correct function pointer
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 2 Aug 2017 16:25:44 +0000 (17:25 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Wed, 2 Aug 2017 17:03:47 +0000 (18:03 +0100)
`.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@openmail.cc>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Cedric Sodhi <manday@openmail.cc>
src/egl/drivers/dri2/egl_dri2.c
src/egl/main/eglapi.c

index a197e0456fd2536d37d1b641041d73d7f8fe9b06..733659d547f2258809c5dd8a2a5033cb17c15938 100644 (file)
@@ -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);
 }
 
index 65fb117f08759418a5393f9b3312da032b61bcb9..c5e3955c48c79fd904b0ff03bcc331af969d0fc2 100644 (file)
@@ -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;