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/modules/checkers/checkers.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules/checkers') diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c index 20ecd63..32b5aa3 100644 --- a/src/modules/checkers/checkers.c +++ b/src/modules/checkers/checkers.c @@ -200,9 +200,10 @@ static int checkers_fragmenter(til_module_context_t *context, const til_fb_fragm } -static void checkers_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t *fragment, til_frame_plan_t *res_frame_plan) +static void checkers_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan) { checkers_context_t *ctxt = (checkers_context_t *)context; + til_fb_fragment_t *fragment = *fragment_ptr; /* XXX: note cpu_affinity is required when fill_module is used, to ensure module_contexts * have a stable relationship to fragnum. Otherwise the output would be unstable because the @@ -227,9 +228,11 @@ static inline unsigned hash(unsigned x) } -static void checkers_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t *fragment) +static void checkers_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr) { checkers_context_t *ctxt = (checkers_context_t *)context; + til_fb_fragment_t *fragment = *fragment_ptr; + uint32_t color = ctxt->setup.color, flags = 0; checkers_fill_t fill = ctxt->setup.fill; int state; @@ -293,7 +296,7 @@ static void checkers_render_fragment(til_module_context_t *context, unsigned tic til_fb_fragment_fill(fragment, flags, color); else { /* TODO: we need a way to send down color and flags, and use the module render as a brush of sorts */ - til_module_render(ctxt->fill_module_contexts[cpu], ticks, fragment); + til_module_render(ctxt->fill_module_contexts[cpu], ticks, fragment_ptr); } } } -- cgit v1.2.1