summaryrefslogtreecommitdiff
path: root/src/mem_fb.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/mem_fb.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/mem_fb.c')
-rw-r--r--src/mem_fb.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mem_fb.c b/src/mem_fb.c
index a564c1f..c4633c5 100644
--- a/src/mem_fb.c
+++ b/src/mem_fb.c
@@ -111,7 +111,7 @@ static void mem_fb_release(til_fb_t *fb, void *context)
}
-static void * mem_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_page)
+static void * mem_fb_page_alloc(til_fb_t *fb, void *context, til_fb_fragment_t *res_fragment)
{
mem_fb_t *c = context;
mem_fb_page_t *p;
@@ -120,13 +120,13 @@ static void * mem_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_
if (!p)
return NULL;
- *res_page = (til_fb_page_t){
- .fragment.buf = p->buf,
- .fragment.width = c->setup.width,
- .fragment.frame_width = c->setup.width,
- .fragment.height = c->setup.height,
- .fragment.frame_height = c->setup.height,
- .fragment.pitch = c->setup.width,
+ *res_fragment = (til_fb_fragment_t){
+ .buf = p->buf,
+ .width = c->setup.width,
+ .frame_width = c->setup.width,
+ .height = c->setup.height,
+ .frame_height = c->setup.height,
+ .pitch = c->setup.width,
};
return p;
© All Rights Reserved