summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/til_fb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/til_fb.c b/src/til_fb.c
index 1bdb2e7..02259e8 100644
--- a/src/til_fb.c
+++ b/src/til_fb.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdint.h>
+#include "til.h"
#include "til_fb.h"
#include "til_settings.h"
#include "til_util.h"
@@ -117,6 +118,7 @@ struct _til_fb_page_t {
_til_fb_page_t *all_next, *all_previous;
_til_fb_page_t *next, *previous;
_til_fb_fragment_t fragment;
+ unsigned submitted_ticks, presented_ticks;
};
typedef struct til_fb_t {
@@ -180,6 +182,8 @@ int til_fb_flip(til_fb_t *fb)
if (r < 0) /* TODO: vet this: what happens to this page? */
return r;
+ next_active_page->presented_ticks = til_ticks_now();
+
/* now that we're displaying a new page, make the previously active one inactive so rendering can reuse it */
pthread_mutex_lock(&fb->inactive_mutex);
fb->active_page->next = fb->inactive_pages_head;
@@ -277,6 +281,7 @@ static void _til_fb_page_submit(til_fb_fragment_t *fragment)
fb->put_pages_count++;
+ page->submitted_ticks = til_ticks_now();
pthread_mutex_lock(&fb->ready_mutex);
if (fb->ready_pages_tail)
fb->ready_pages_tail->next = page;
© All Rights Reserved