From 5be99f176e6bab0d3cb45aa396d4ab852719db5d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 24 Nov 2019 22:05:22 -0800 Subject: snow: only create n_cpus fragments Since snow_context_t needs another member anyways, stick n_cpus in there to inform the fragmenter of precisely how many fragments to make. This renderer doesn't benefit from tiling or any such locality, so it uses the slice fragmenter and really only benefits from as many fragments as there are CPUs. Any additional fragments is just wasted fragmenting overhead. --- src/modules/snow/snow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules/snow') diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c index 3e6331a..2de4d76 100644 --- a/src/modules/snow/snow.c +++ b/src/modules/snow/snow.c @@ -15,7 +15,7 @@ typedef union snow_seed_t { } snow_seed_t; typedef struct snow_context_t { - int foo; /* make the compiler happy */ + unsigned n_cpus; snow_seed_t seeds[]; } snow_context_t; @@ -31,6 +31,8 @@ static void * snow_create_context(unsigned n_cpus) for (unsigned i = 0; i < n_cpus; i++) ctxt->seeds[i].seed = rand(); + ctxt->n_cpus = n_cpus; + return ctxt; } @@ -43,7 +45,9 @@ static void snow_destroy_context(void *context) static int snow_fragmenter(void *context, const fb_fragment_t *fragment, unsigned number, fb_fragment_t *res_fragment) { - return fb_fragment_slice_single(fragment, 32, number, res_fragment); + snow_context_t *ctxt = context; + + return fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); } -- cgit v1.2.3