summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-08-29 11:06:42 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-08-29 11:46:43 -0700
commiteba46d3c401a57c7ca2f95baa0312bfb09543ed0 (patch)
treee5aa6233ce00fd97973fe09de95928e5d4a7dc55 /src
parentd1be60df24677c5e3fd4e7d363696cfbfb20d70d (diff)
til_fb: track fb page submit-to-present duration
Preparatory commit for returning submit-to-present intervals w/til_fb_page_get().
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