From 5a0776f1fdc6b7780cd21d568150e804347a6f8a Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Jun 2022 02:28:36 -0700 Subject: til: til_fb_fragment_t **fragment_ptr all the things Preparatory commit for enabling cloneable/swappable fragments There's an outstanding issue with the til_fb_page_t submission, see comments. Doesn't matter for now since cloning doesn't happen yet, but will need to be addressed before they do. --- src/main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 7f6557b..8648b8e 100644 --- a/src/main.c +++ b/src/main.c @@ -319,15 +319,28 @@ static void * rototiller_thread(void *_rt) struct timeval now; for (;;) { - til_fb_page_t *page; - unsigned ticks; + til_fb_page_t *page; + til_fb_fragment_t *fragment; + unsigned ticks; page = til_fb_page_get(rt->fb); + fragment = &page->fragment; gettimeofday(&now, NULL); ticks = get_ticks(&rt->start_tv, &now, rt->ticks_offset); - til_module_render(rt->module_context, ticks, &page->fragment); + /* XXX FIXME this needs refactoring, maybe til_fb_fragment_ops_t needs + * to implement the page_put, then til_fb_page_get() just returns a + * fragment with a put method. + * + * I've hacked it for now, but it's broken once cloning becomes a thing + * because we assume that page contains fragment @ put time. When a + * clone could have replaced the fragment, and it's the replacement page + * that must be submitted. what makes a page? being submittable, so + * maybe just make submit another op on the fragment and get rid of the + * til_fb_page_t type altogether... hacked to build for now. + */ + til_module_render(rt->module_context, ticks, &fragment); til_fb_page_put(rt->fb, page); } -- cgit v1.2.3