egl: make platform's SwapInterval() optional
authorEric Engestrom <eric.engestrom@imgtec.com>
Mon, 31 Jul 2017 17:03:16 +0000 (18:03 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 1 Aug 2017 16:36:57 +0000 (17:36 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/egl/drivers/dri2/platform_wayland.c
src/egl/main/eglapi.c

index 02db473c8cac894a5443a0a291502b68035cafb2..73966b7c504c57f70dc6c1a6d07f3ac71664c032 100644 (file)
@@ -1139,15 +1139,6 @@ static const struct wl_registry_listener registry_listener_drm = {
    .global_remove = registry_handle_global_remove
 };
 
-static EGLBoolean
-dri2_wl_swap_interval(_EGLDriver *drv,
-                   _EGLDisplay *disp,
-                   _EGLSurface *surf,
-                   EGLint interval)
-{
-   return EGL_TRUE;
-}
-
 static void
 dri2_wl_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
 {
@@ -1193,7 +1184,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
    .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
    .destroy_surface = dri2_wl_destroy_surface,
    .create_image = dri2_create_image_khr,
-   .swap_interval = dri2_wl_swap_interval,
    .swap_buffers = dri2_wl_swap_buffers,
    .swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
@@ -1894,7 +1884,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = {
    .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
    .destroy_surface = dri2_wl_destroy_surface,
    .create_image = dri2_fallback_create_image_khr,
-   .swap_interval = dri2_wl_swap_interval,
    .swap_buffers = dri2_wl_swrast_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
index c5e3955c48c79fd904b0ff03bcc331af969d0fc2..65fb117f08759418a5393f9b3312da032b61bcb9 100644 (file)
@@ -1205,7 +1205,7 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval)
                     surf->Config->MinSwapInterval,
                     surf->Config->MaxSwapInterval);
 
-   if (surf->SwapInterval != interval)
+   if (surf->SwapInterval != interval && drv->API.SwapInterval)
       ret = drv->API.SwapInterval(drv, disp, surf, interval);
    else
       ret = EGL_TRUE;