summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-06-27 12:01:59 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-08-07 06:54:53 -0700
commit206251e387038697c013e7efea3782d81fd910b8 (patch)
tree204b28be6aa04f8a96623865777cbc76f8c9d3d2 /src/main.c
parent5a0776f1fdc6b7780cd21d568150e804347a6f8a (diff)
til: experimentally fragment-centric page api
It seems like it might be most ergonomic and convenient for everything to just use til_fb_fragment_t and rely on ops.submit to determine if the fragment is a page or not, and if it is how to submit it. This commit brings things into that state of the world, it feels kind of gross at the til_fb_page_*() API. See the large comment in til_fb.c added by this commit for more information. I'm probably going to just run with this for now, it can always get cleaned up later. What's important is to get the general snapshotting concept and functionality in place so modules can make use of it. There will always be things to cleanup in this messy tangle of a program.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/main.c b/src/main.c
index 8648b8e..2f945b1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -319,30 +319,14 @@ static void * rototiller_thread(void *_rt)
struct timeval now;
for (;;) {
- til_fb_page_t *page;
til_fb_fragment_t *fragment;
unsigned ticks;
- page = til_fb_page_get(rt->fb);
- fragment = &page->fragment;
-
+ fragment = til_fb_page_get(rt->fb);
gettimeofday(&now, NULL);
ticks = get_ticks(&rt->start_tv, &now, rt->ticks_offset);
-
- /* 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);
+ til_fb_fragment_submit(fragment);
}
return NULL;
© All Rights Reserved