diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-06-27 12:01:59 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-08-07 06:54:53 -0700 |
commit | 206251e387038697c013e7efea3782d81fd910b8 (patch) | |
tree | 204b28be6aa04f8a96623865777cbc76f8c9d3d2 /src/drm_fb.c | |
parent | 5a0776f1fdc6b7780cd21d568150e804347a6f8a (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/drm_fb.c')
-rw-r--r-- | src/drm_fb.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/drm_fb.c b/src/drm_fb.c index e7f0376..c067b91 100644 --- a/src/drm_fb.c +++ b/src/drm_fb.c @@ -454,7 +454,7 @@ static void drm_fb_release(til_fb_t *fb, void *context) } -static void * drm_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_page) +static void * drm_fb_page_alloc(til_fb_t *fb, void *context, til_fb_fragment_t *res_fragment) { struct drm_mode_create_dumb create_dumb = { .bpp = 32 }; struct drm_mode_map_dumb map_dumb = {}; @@ -491,14 +491,14 @@ static void * drm_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_ p->drm_dumb_handle = map_dumb.handle; p->drm_fb_id = fb_id; - *res_page = (til_fb_page_t){ - .fragment.buf = map, - .fragment.width = c->mode->hdisplay, - .fragment.frame_width = c->mode->hdisplay, - .fragment.height = c->mode->vdisplay, - .fragment.frame_height = c->mode->vdisplay, - .fragment.pitch = create_dumb.pitch >> 2, - .fragment.stride = (create_dumb.pitch >> 2) - c->mode->hdisplay, + *res_fragment = (til_fb_fragment_t){ + .buf = map, + .width = c->mode->hdisplay, + .frame_width = c->mode->hdisplay, + .height = c->mode->vdisplay, + .frame_height = c->mode->vdisplay, + .pitch = create_dumb.pitch >> 2, + .stride = (create_dumb.pitch >> 2) - c->mode->hdisplay, }; return p; |