From 6fabe39ba8841ffe392c9b659505e12edaff43d6 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 26 Feb 2018 03:29:12 -0800 Subject: rototiller,fb: swap dispatch with page flipping For the sake of sdl_fb, move page flipping into the main thread and run module render dispatch from another thread instead. This eliminates the fb flipper thread, moving its functionality into fb_flip() which synchronously consumes and performs a single flip from the same queue as before - the function is verbatim the loop body of the flipper thread. Now main() calls fb_flip() in a loop where it previously dispatched pages for rendering. Rendering dispatch is now performed in a created thread. See the comment in fb.c for more explanation of this shuffle. --- src/fb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/fb.h') diff --git a/src/fb.h b/src/fb.h index 7743b82..f9d0b77 100644 --- a/src/fb.h +++ b/src/fb.h @@ -47,6 +47,7 @@ void fb_page_put(fb_t *fb, fb_page_t *page); void fb_free(fb_t *fb); void fb_get_put_pages_count(fb_t *fb, unsigned *count); fb_t * fb_new(const fb_ops_t *ops, settings_t *settings, int n_pages); +int fb_flip(fb_t *fb); void fb_fragment_divide(fb_fragment_t *fragment, unsigned n_fragments, fb_fragment_t fragments[]); int fb_fragment_slice_single(const fb_fragment_t *fragment, unsigned n_fragments, unsigned num, fb_fragment_t *res_fragment); int fb_fragment_tile_single(const fb_fragment_t *fragment, unsigned tile_size, unsigned num, fb_fragment_t *res_fragment); -- cgit v1.2.1