summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-02-03 02:26:54 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-02-03 02:26:54 +0000
commit90e5fd831d11a0d378999b90a3c24e6ecef2a284 (patch)
tree838cdf87bf0aa0ee8745f5186498c340a6bf3ce4 /src
parent4013c98af15779e71d3a86ac03dd18796cbdf0e6 (diff)
ecore-x - vsync - also log the direct device timestamp if it goes back
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_x/ecore_x_vsync.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/ecore_x/ecore_x_vsync.c b/src/lib/ecore_x/ecore_x_vsync.c
index 26454a2ae9..5ad828d0fe 100644
--- a/src/lib/ecore_x/ecore_x_vsync.c
+++ b/src/lib/ecore_x/ecore_x_vsync.c
@@ -384,12 +384,20 @@ _drm_vblank_handler(int fd EINA_UNUSED,
384 if (pframe != frame) 384 if (pframe != frame)
385 { 385 {
386#define DELTA_COUNT 10 386#define DELTA_COUNT 10
387 double t = (double)sec + ((double)usec / 1000000);
388 double tnow = ecore_time_get(); 387 double tnow = ecore_time_get();
388 double t = (double)sec + ((double)usec / 1000000);
389 unsigned long long tusec, ptusec;
389 static double tdelta[DELTA_COUNT]; 390 static double tdelta[DELTA_COUNT];
390 static double tdelta_avg = 0.0; 391 static double tdelta_avg = 0.0;
391 static int tdelta_n = 0; 392 static int tdelta_n = 0;
393 static unsigned int psec = 0, pusec = 0;
392 394
395 tusec = ((unsigned long long)sec) * 1000000 + usec;
396 ptusec = ((unsigned long long)psec) * 1000000 + pusec;
397 if (tusec <= ptusec)
398 fprintf(stderr,
399 "EEEEEEK! drm time went backwards! %u.%06u -> %u.%06u\n",
400 psec, pusec, sec, usec);
393 if (t > tnow) 401 if (t > tnow)
394 { 402 {
395 if (tdelta_n > DELTA_COUNT) 403 if (tdelta_n > DELTA_COUNT)
@@ -420,6 +428,8 @@ _drm_vblank_handler(int fd EINA_UNUSED,
420 _drm_fail_count = 0; 428 _drm_fail_count = 0;
421 _drm_send_time(t); 429 _drm_send_time(t);
422 pframe = frame; 430 pframe = frame;
431 psec = sec;
432 pusec = usec;
423 } 433 }
424 } 434 }
425 else 435 else