summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-12-31 11:38:20 -0800
committerVito Caputo <vcaputo@pengaru.com>2018-01-01 22:27:40 -0800
commit9e5f4de8ecc1408fe8b65f5eee442a38322b8ac8 (patch)
tree5568744c3e1c3069b959420034223c780e4909bb
parent0b7361bb55d91b49dea75dd332294c6b75c501e7 (diff)
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.
-rw-r--r--src/fb.h9
1 files changed, 9 insertions, 0 deletions
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);
© All Rights Reserved