path: root/src/lib/ecore_x/xlib/ecore_x_vsync.c
diff options
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-10-28 14:50:05 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-10-28 22:58:36 +0900
commit973eaedf51a8ab0f9881c1fb900850dd8475bbf7 (patch)
treecfdaae6c7a0da526c63ad82463d294d81d303778 /src/lib/ecore_x/xlib/ecore_x_vsync.c
parentelementary: Don't set "move" cursor on wayland client apps (diff)
improve responsivness of timer sleeping threads for vsync with prctl
prctl allows us on some platforms to request a thread be woken up more agressively e.g. due to a timeout bu setting timerslack. since we use a dedicated thread just for vsync events, this is a very good idea to ask the kernel to be as exact as possible for this thread as it only wakes up once per frame (or should only) and accuracy is important. so use this. also improve prctl checks to be more explicit in configure.ac and use these ifdefs in ecore exe too where prctl is used as well. @feature
Diffstat (limited to 'src/lib/ecore_x/xlib/ecore_x_vsync.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_vsync.c b/src/lib/ecore_x/xlib/ecore_x_vsync.c
index 436645e63c..ee43406ab5 100644
--- a/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -17,6 +17,10 @@
#include <sys/select.h>
#include <fcntl.h>
+#ifdef HAVE_PRCTL
+# include <sys/prctl.h>
static Ecore_X_Window vsync_root = 0;
@@ -286,6 +290,9 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
int tick = 0;
eina_thread_name_set(eina_thread_self(), "Eanimator-vsync");
+#ifdef HAVE_PRCTL
+ prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);
while (!ecore_thread_check(thread))
DBG("------- drm_event_is_busy=%i", drm_event_is_busy);