aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_x/xlib/ecore_x_vsync.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-10-31 11:27:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-10-31 11:28:03 +0900
commit779e0829c07ba5834f3a56acd4fdad0bfaa53bca (patch)
tree744d9f3fada135bfdfcc26dd1df10bf20b075126 /src/lib/ecore_x/xlib/ecore_x_vsync.c
parenteina: clear up eina_tmpstr length information (diff)
downloadefl-779e0829c07ba5834f3a56acd4fdad0bfaa53bca.tar.gz
ecore vsync - add debug and files to touch to disable vsync
this makes it just that much more convenient to disable the ecore x vsync stuff in case you have troubles
Diffstat (limited to 'src/lib/ecore_x/xlib/ecore_x_vsync.c')
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_vsync.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_vsync.c b/src/lib/ecore_x/xlib/ecore_x_vsync.c
index 3710958f0f..bc4b70ebcd 100644
--- a/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -207,6 +207,7 @@ _drm_send_time(double t)
{
*tim = t;
DBG(" ... send %1.8f", t);
+ D(" @%1.5f ... send %1.8f\n", ecore_time_get(), t);
ecore_thread_feedback(drm_thread, tim);
}
}
@@ -222,14 +223,18 @@ _drm_vblank_handler(int fd EINA_UNUSED,
{
static unsigned int pframe = 0;
- D("vblank %i\n", frame);
DBG("vblank %i", frame);
+ D(" @%1.5f vblank %i\n", ecore_time_get(), frame);
if (pframe != frame)
{
_drm_send_time((double)sec + ((double)usec / 1000000));
pframe = frame;
}
}
+ else
+ {
+ D(" @%1.5f vblank drm event when not busy!\n", ecore_time_get());
+ }
}
static void
@@ -242,9 +247,11 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
while (!ecore_thread_check(thread))
{
DBG("------- drm_event_is_busy=%i", drm_event_is_busy);
+ D(" @%1.5f ------- drm_event_is_busy=%i\n", ecore_time_get(), drm_event_is_busy);
if (!drm_event_is_busy)
{
DBG("wait...");
+ D(" @1.5f wait...\n", ecore_time_get());
msg = eina_thread_queue_wait(thq, &ref);
if (msg)
{
@@ -257,6 +264,7 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
do
{
DBG("poll...");
+ D(" @%1.5f poll...\n", ecore_time_get());
msg = eina_thread_queue_poll(thq, &ref);
if (msg)
{
@@ -267,6 +275,7 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
while (msg);
}
DBG("tick = %i", tick);
+ D(" @%1.5f tick = %i\n", ecore_time_get(), tick);
if (tick == -1)
{
drm_thread = NULL;
@@ -283,7 +292,7 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
if (!_drm_tick_schedule())
{
- D("@%1.5f schedule fail\n", ecore_time_get());
+ D(" @%1.5f schedule fail\n", ecore_time_get());
_drm_fail_count = 999999;
}
max_fd = 0;
@@ -297,11 +306,11 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
tv.tv_usec = _drm_fail_time2 * 1000000;
else
tv.tv_usec = _drm_fail_time * 1000000;
- D("@%1.5f wait %ims\n", ecore_time_get(), (int)(tv.tv_usec /1000));
+ D(" @%1.5f wait %ims\n", ecore_time_get(), (int)(tv.tv_usec /1000));
ret = select(max_fd + 1, &rfds, &wfds, &exfds, &tv);
if ((ret == 1) && (FD_ISSET(drm_fd, &rfds)))
{
- D("@%1.5f have event\n", ecore_time_get());
+ D(" @%1.5f have event\n", ecore_time_get());
sym_drmHandleEvent(drm_fd, &drm_evctx);
_drm_fail_count = 0;
}
@@ -310,7 +319,7 @@ _drm_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread)
// timeout
_drm_send_time(ecore_time_get());
_drm_fail_count++;
- D("@%1.5f fail count %i\n", ecore_time_get(), _drm_fail_count);
+ D(" @%1.5f fail count %i\n", ecore_time_get(), _drm_fail_count);
}
}
}
@@ -320,13 +329,14 @@ static void
_drm_tick_notify(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, void *msg)
{
DBG("notify.... %3.3f %i", *((double *)msg), drm_event_is_busy);
+ D("notify.... %3.3f %i\n", *((double *)msg), drm_event_is_busy);
if (drm_event_is_busy)
{
double *t = msg;
static double pt = 0.0;
- D("VSYNC %1.8f = delt %1.8f\n", *t, *t - pt);
DBG("VSYNC %1.8f = delt %1.8f", *t, *t - pt);
+ D("VSYNC %1.8f = delt %1.8f\n", *t, *t - pt);
ecore_loop_time_set(*t);
ecore_animator_custom_tick();
pt = *t;
@@ -820,7 +830,16 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
if (vsync_veto == -1)
{
+ char buf[4096];
+ const char *home;
+ struct stat st;
+
+ home = getenv("HOME");
+ if (!home) home = "/tmp";
+ snprintf(buf, sizeof(buf), "%s/.ecore-no-vsync", home);
if (getenv("ECORE_NO_VSYNC")) vsync_veto = 1;
+ else if (stat(buf, &st) == 0) vsync_veto = 1;
+ else if (stat("/etc/.ecore-no-vsync", &st) == 0) vsync_veto = 1;
else vsync_veto = 0;
}
if (vsync_veto == 1) return EINA_FALSE;