summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
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
parentecc3e2fa516d937f65a24ec45c9fa62d8c9b491d (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')
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_vsync.c7
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 436645e..ee43406 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 @@
17#include <sys/select.h> 17#include <sys/select.h>
18#include <fcntl.h> 18#include <fcntl.h>
19 19
20#ifdef HAVE_PRCTL
21# include <sys/prctl.h>
22#endif
23
20#define ECORE_X_VSYNC_DRM 1 24#define ECORE_X_VSYNC_DRM 1
21 25
22static Ecore_X_Window vsync_root = 0; 26static Ecore_X_Window vsync_root = 0;
@@ -286,6 +290,9 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
286 int tick = 0; 290 int tick = 0;
287 291
288 eina_thread_name_set(eina_thread_self(), "Eanimator-vsync"); 292 eina_thread_name_set(eina_thread_self(), "Eanimator-vsync");
293#ifdef HAVE_PRCTL
294 prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);
295#endif
289 while (!ecore_thread_check(thread)) 296 while (!ecore_thread_check(thread))
290 { 297 {
291 DBG("------- drm_event_is_busy=%i", drm_event_is_busy); 298 DBG("------- drm_event_is_busy=%i", drm_event_is_busy);