summaryrefslogtreecommitdiff
path: root/src/fb.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-02-18 03:16:21 -0800
committerVito Caputo <vcaputo@pengaru.com>2021-02-18 03:36:51 -0800
commit6661cb3d0cbbc170b385d1ff66f525aac899df6a (patch)
treecfb7e0bcbccf4025b484c3dfe283079b9e46446c /src/fb.c
parent0536326f814739a4ee6136f4156431e77fe45769 (diff)
fb: remember the page count in fb_t
Adds fb_t.n_pages member, we need the number of pages for queueing rebuilds.
Diffstat (limited to 'src/fb.c')
-rw-r--r--src/fb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fb.c b/src/fb.c
index e17ffd9..f374975 100644
--- a/src/fb.c
+++ b/src/fb.c
@@ -65,6 +65,7 @@ struct _fb_page_t {
typedef struct fb_t {
const fb_ops_t *ops;
void *ops_context;
+ int n_pages;
_fb_page_t *active_page; /* page currently displayed */
@@ -318,6 +319,8 @@ int fb_new(const fb_ops_t *ops, settings_t *settings, int n_pages, fb_t **res_fb
for (int i = 0; i < n_pages; i++)
fb_page_new(fb);
+ fb->n_pages = n_pages;
+
pthread_mutex_init(&fb->ready_mutex, NULL);
pthread_cond_init(&fb->ready_cond, NULL);
pthread_mutex_init(&fb->inactive_mutex, NULL);
© All Rights Reserved