return dri2_drv->get_proc_address(procname);
}
+static EGLBoolean
+dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+ EGLint interval)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ return dri2_dpy->vtbl->swap_interval(drv, dpy, surf, interval);
+}
+
static EGLBoolean
dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
{
dri2_drv->base.API.WaitNative = dri2_wait_native;
dri2_drv->base.API.BindTexImage = dri2_bind_tex_image;
dri2_drv->base.API.ReleaseTexImage = dri2_release_tex_image;
+ dri2_drv->base.API.SwapInterval = dri2_swap_interval;
dri2_drv->base.API.CreateImageKHR = dri2_create_image_khr;
dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
#ifdef HAVE_DRM_PLATFORM
struct dri2_egl_display_vtbl {
int (*authenticate)(_EGLDisplay *disp, uint32_t id);
+
+ EGLBoolean (*swap_interval)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface *surf, EGLint interval);
};
struct dri2_egl_display
--- /dev/null
+/*
+ * Copyright 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+
+#include "egltypedefs.h"
+
+static inline EGLBoolean
+dri2_fallback_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface *surf, EGLint interval)
+{
+ return EGL_FALSE;
+}
#include "loader.h"
#include "egl_dri2.h"
+#include "egl_dri2_fallbacks.h"
#include "gralloc_drm.h"
static int
static struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
+ .swap_interval = dri2_fallback_swap_interval,
};
EGLBoolean
#include <unistd.h>
#include "egl_dri2.h"
+#include "egl_dri2_fallbacks.h"
#include "loader.h"
static struct gbm_bo *
static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.authenticate = dri2_drm_authenticate,
+ .swap_interval = dri2_fallback_swap_interval,
};
EGLBoolean
#include <xf86drm.h>
#include "egl_dri2.h"
+#include "egl_dri2_fallbacks.h"
#include "loader.h"
#include <wayland-client.h>
static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
.authenticate = dri2_wl_authenticate,
+ .swap_interval = dri2_wl_swap_interval,
};
EGLBoolean
drv->API.DestroySurface = dri2_wl_destroy_surface;
drv->API.SwapBuffers = dri2_wl_swap_buffers;
drv->API.SwapBuffersWithDamageEXT = dri2_wl_swap_buffers_with_damage;
- drv->API.SwapInterval = dri2_wl_swap_interval;
drv->API.Terminate = dri2_wl_terminate;
drv->API.QueryBufferAge = dri2_wl_query_buffer_age;
#include <sys/stat.h>
#include "egl_dri2.h"
+#include "egl_dri2_fallbacks.h"
static EGLBoolean
dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.authenticate = NULL,
+ .swap_interval = dri2_fallback_swap_interval,
};
static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
.authenticate = dri2_x11_authenticate,
+ .swap_interval = dri2_x11_swap_interval,
};
static EGLBoolean
drv->API.CreateImageKHR = dri2_x11_create_image_khr;
drv->API.SwapBuffersRegionNOK = dri2_x11_swap_buffers_region;
drv->API.PostSubBufferNV = dri2_x11_post_sub_buffer;
- drv->API.SwapInterval = dri2_x11_swap_interval;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)