From f68217801710951a81341df24340d671298e381c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 17 May 2022 15:02:20 +0100 Subject: [PATCH] ecore-x - use current time not vblank timestamp for animator time sometimes on some systems and drviers time here is not what we want/expect. it can be in the future. there are reasons so, work around this and use the timestamp of "now" when we get the event as opposed to the timestamp given to work around odd weirdnesses and complaints time went backwards. @fix --- src/lib/ecore_x/ecore_x_vsync.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_x/ecore_x_vsync.c b/src/lib/ecore_x/ecore_x_vsync.c index f505193722..0f7a7368b2 100644 --- a/src/lib/ecore_x/ecore_x_vsync.c +++ b/src/lib/ecore_x/ecore_x_vsync.c @@ -382,7 +382,7 @@ _drm_vblank_handler(int fd EINA_UNUSED, D(" @%1.5f vblank %i\n", ecore_time_get(), frame); if (pframe != frame) { -#define DELTA_COUNT 10 +#if 0 // disable timestamp from vblank and use time event arrived double t = (double)sec + ((double)usec / 1000000); unsigned long long tusec, ptusec, tdelt = 0; static unsigned int psec = 0, pusec = 0; @@ -411,10 +411,15 @@ _drm_vblank_handler(int fd EINA_UNUSED, } } _drm_fail_count = 0; - _drm_send_time(t); - pframe = frame; - psec = sec; pusec = usec; + psec = sec; +#else + double t = ecore_time_get(); + _drm_send_time(t); + sec = 0; + usec = 0; +#endif + pframe = frame; } } else