From 9dc4da8a654c30e738049a958576bfd8ec411e83 Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Tue, 5 Jan 2021 14:21:57 +0900 Subject: [PATCH] ecore_evas: fix to notify mainthread just once in tizen, there is an indivisual thread for getting vsync signal. and the thread notifies the main thread every single time it gets vsync signal. so that main thread has a possibility to handle multiple times of thread callbacks (notify handler) when main thread can't iterate within about 16ms which is an interval of the vsync signal. this patch fixes the vsync logic not to notify the main thread when the previous vsync is not handled. Change-Id: I650a6213f7935f00600496aaac398858f5e9ebf2 --- .../engines/wayland/ecore_evas_wayland_vsync.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_vsync.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_vsync.c index 41ac36d..cbcb60e 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_vsync.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_vsync.c @@ -76,9 +76,14 @@ _tdm_send_time(double t) *tim = t; DBG("tdm send time @%1.5f ... send %1.8f\n", ecore_time_get(), t); eina_spinlock_take(&tick_queue_lock); - tick_queue_count++; + if (tick_queue_count == 0) + { + tick_queue_count++; + ecore_thread_feedback(tdm_thread, tim); + } else { + free(tim); + } eina_spinlock_release(&tick_queue_lock); - ecore_thread_feedback(tdm_thread, tim); } traceTaskEnd(); } @@ -245,7 +250,6 @@ _tdm_tick_notify(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, void eina_spinlock_take(&tick_queue_lock); tick_queued = tick_queue_count; - tick_queue_count--; eina_spinlock_release(&tick_queue_lock); DBG("notify.... %3.3f %i", *((double *)msg), tdm_event_is_busy); @@ -269,6 +273,12 @@ _tdm_tick_notify(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, void DBG("skip this vsync for schedule queued %d\n", tick_queued); } } + + eina_spinlock_take(&tick_queue_lock); + tick_queue_count--; + if (tick_queue_count < 0) tick_queue_count = 0; + eina_spinlock_release(&tick_queue_lock); + free(msg); traceTaskEnd(); } -- 2.7.4