aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_x/xlib/ecore_x_vsync.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 18:26:58 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 18:26:58 +0900
commite4ed80dc1ec9207c33ab42d52b66704756987e2b (patch)
treed3d7cb482600853c707f27e63f2afa0cfac0197e /src/lib/ecore_x/xlib/ecore_x_vsync.c
parentecore_getopt - fix possible null arg (diff)
downloadefl-e4ed80dc1ec9207c33ab42d52b66704756987e2b.tar.gz
ecore vsync - work around old kernels by blacklisting them
this is a bug workaround apparently old kernels that seems to get vsync and timestamps wrong. 3.14 kernels and up only for now @bug
Diffstat (limited to 'src/lib/ecore_x/xlib/ecore_x_vsync.c')
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_vsync.c21
1 files changed, 21 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 a854af843d..eda7fce136 100644
--- a/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -356,6 +356,27 @@ _drm_init(void)
*/
return 0;
}
+ // only do this on new kernels = let's say 3.14 and up. 3.16 definitely
+ // works
+ {
+ Eina_Bool ok = EINA_FALSE;
+
+ FILE *fp = fopen("/proc/sys/kernel/osrelease", "r");
+ if (fp)
+ {
+ if (fgets(buf, sizeof(buf), fp))
+ {
+ int vmaj = 0, vmin = 0;
+
+ if (sscanf(buf, "%i.%i.%*s", &vmaj, &vmin) == 2)
+ {
+ if ((vmaj >= 3) && (vmin >= 14)) ok = EINA_TRUE;
+ }
+ }
+ fclose(fp);
+ }
+ if (!ok) return 0;
+ }
snprintf(buf, sizeof(buf), "/dev/dri/card1");
if (stat(buf, &st) == 0)