From 553d233655c1116e7714cba2369be238f48a5c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Thu, 1 Jun 2017 21:06:42 +0200 Subject: [PATCH] Remove old vblank code Since 7115d1b4f4021043bb59e6acafa105cb77fe5b9d we can't disable second (broken) vblank waiting code. This patch removes old code to prevent waiting for vblank twice. --- src/compositor.c | 64 -------------------------------------------------------- src/screen.h | 3 --- 2 files changed, 67 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index dfc279dc..aaaaa63e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1083,29 +1083,6 @@ check_glx_renderer (ScreenInfo *screen_info) return TRUE; } -static void -init_glx_extensions (ScreenInfo *screen_info) -{ - g_return_if_fail (screen_info != NULL); - - TRACE ("entering init_glx_extensions"); - - screen_info->has_glx_sync_control = - epoxy_has_glx_extension (myScreenGetXDisplay (screen_info), - screen_info->screen, - "GLX_OML_sync_control"); - - screen_info->has_glx_video_sync = - epoxy_has_glx_extension (myScreenGetXDisplay (screen_info), - screen_info->screen, - "GLX_SGI_video_sync"); - - screen_info->has_texture_from_pixmap = - epoxy_has_glx_extension (myScreenGetXDisplay (screen_info), - screen_info->screen, - "GLX_EXT_texture_from_pixmap"); -} - static gboolean check_gl_extensions (ScreenInfo *screen_info) { @@ -1325,17 +1302,6 @@ init_glx (ScreenInfo *screen_info) return FALSE; } - init_glx_extensions (screen_info); - if (!screen_info->has_glx_video_sync && !screen_info->has_glx_sync_control) - { - g_warning ("Screen is missing required GLX extension, vsync disabled."); - /* - * Strictly speaking, we /could/ be using GLX without VSync support, but what - * would be the point? Chances are we'd be using swrast anyway... - */ - return FALSE; - } - if (!choose_glx_settings (screen_info)) { g_warning ("Cannot find a matching GLX config, vsync disabled."); @@ -1401,35 +1367,6 @@ init_glx (ScreenInfo *screen_info) return TRUE; } -/* Following routine is taken from gdk GL context code by Alexander Larsson */ -static void -wait_glx_vblank (ScreenInfo *screen_info) -{ - guint32 current_count; - - g_return_if_fail (screen_info != NULL); - - TRACE ("entering wait_glx_vblank"); - - if (screen_info->has_glx_sync_control) - { - gint64 ust, msc, sbc; - - glXGetSyncValuesOML (myScreenGetXDisplay (screen_info), - screen_info->glx_window, - &ust, &msc, &sbc); - glXWaitForMscOML (myScreenGetXDisplay (screen_info), - screen_info->glx_window, - 0, 2, (msc + 1) % 2, - &ust, &msc, &sbc); - } - else if (screen_info->has_glx_video_sync) - { - glXGetVideoSyncSGI (¤t_count); - glXWaitVideoSyncSGI (2, (current_count + 1) % 2, ¤t_count); - } -} - static GLXDrawable create_glx_drawable (ScreenInfo *screen_info, Pixmap pixmap) { @@ -2225,7 +2162,6 @@ paint_all (ScreenInfo *screen_info, XserverRegion region, gushort buffer) if (screen_info->use_glx) /* glx first if available */ { glXWaitX (); - wait_glx_vblank (screen_info); bind_glx_texture (screen_info, screen_info->rootPixmap[buffer]); redraw_glx_texture (screen_info); diff --git a/src/screen.h b/src/screen.h index 13090923..e29f4e9f 100644 --- a/src/screen.h +++ b/src/screen.h @@ -207,9 +207,6 @@ struct _ScreenInfo gboolean use_present; #ifdef HAVE_EPOXY - gboolean has_glx_sync_control; - gboolean has_glx_video_sync; - gboolean has_texture_from_pixmap; gboolean texture_inverted; GLuint rootTexture; -- 2.13.0