From 206251e387038697c013e7efea3782d81fd910b8 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 27 Jun 2022 12:01:59 -0700 Subject: 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. --- src/drm_fb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/drm_fb.c') 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; -- cgit v1.2.1