No, no, no, no, no. If the driver doesn't give you the events you want, fix the driver. diff -up cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c.jx cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c --- cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c.jx 2011-10-17 09:23:13.000000000 -0400 +++ cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c 2011-11-01 18:34:38.731529285 -0400 @@ -56,12 +56,6 @@ #include #include -#ifdef HAVE_DRM -#include -#include -#include -#endif - #define COGL_ONSCREEN_X11_EVENT_MASK StructureNotifyMask typedef struct _CoglContextGLX @@ -423,20 +417,6 @@ update_winsys_features (CoglContext *con COGL_WINSYS_FEATURE_VBLANK_WAIT, TRUE); -#ifdef HAVE_DRM - /* drm is really an extreme fallback -rumoured to work with Via - * chipsets... */ - if (!glx_renderer->pf_glXWaitVideoSync) - { - if (glx_renderer->dri_fd < 0) - glx_renderer->dri_fd = open("/dev/dri/card0", O_RDWR); - if (glx_renderer->dri_fd >= 0) - COGL_FLAGS_SET (context->winsys_features, - COGL_WINSYS_FEATURE_VBLANK_WAIT, - TRUE); - } -#endif - if (glx_renderer->pf_glXCopySubBuffer || context->glBlitFramebuffer) COGL_FLAGS_SET (context->winsys_features, COGL_WINSYS_FEATURE_SWAP_REGION, TRUE); @@ -1046,24 +1026,6 @@ _cogl_winsys_onscreen_bind (CoglOnscreen glx_context->current_drawable = drawable; } -#ifdef HAVE_DRM -static int -drm_wait_vblank (int fd, drm_wait_vblank_t *vbl) -{ - int ret, rc; - - do - { - ret = ioctl (fd, DRM_IOCTL_WAIT_VBLANK, vbl); - vbl->request.type &= ~_DRM_VBLANK_RELATIVE; - rc = errno; - } - while (ret && rc == EINTR); - - return rc; -} -#endif /* HAVE_DRM */ - static void _cogl_winsys_wait_for_vblank (void) { @@ -1082,18 +1044,6 @@ _cogl_winsys_wait_for_vblank (void) (current_count + 1) % 2, ¤t_count); } -#ifdef HAVE_DRM - else - { - drm_wait_vblank_t blank; - - COGL_NOTE (WINSYS, "Waiting for vblank (drm)"); - blank.request.type = _DRM_VBLANK_RELATIVE; - blank.request.sequence = 1; - blank.request.signal = 0; - drm_wait_vblank (glx_renderer->dri_fd, &blank); - } -#endif /* HAVE_DRM */ } static guint32