From 9e5f4de8ecc1408fe8b65f5eee442a38322b8ac8 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 31 Dec 2017 11:38:20 -0800 Subject: fb: introduce fb_ops_t Hooks for fb acquire/release, page allocate, free, and flip. This should encompass everything currently needed for the drm backend, which will move behind this abstraction in a later commit. --- src/fb.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/fb.h b/src/fb.h index 5cb8676..5b21cc8 100644 --- a/src/fb.h +++ b/src/fb.h @@ -28,6 +28,15 @@ typedef struct fb_page_t { fb_fragment_t fragment; } fb_page_t; +/* Supply this struct to fb_new() with the appropriate context */ +typedef struct fb_ops_t { + int (*acquire)(void *context, void *page); + void (*release)(void *context); + void * (*page_alloc)(void *context, fb_page_t *res_page); + int (*page_free)(void *context, void *page); + int (*page_flip)(void *context, void *page); +} fb_ops_t; + typedef struct fb_t fb_t; fb_page_t * fb_page_get(fb_t *fb); -- cgit v1.2.1