summaryrefslogtreecommitdiff
path: root/src/fb.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-02-18 11:53:17 -0800
committerVito Caputo <vcaputo@pengaru.com>2018-02-22 14:14:08 -0800
commit6e687a50a93ae780b5a7cbc03193f40f6e80eaa6 (patch)
tree42aa4a2f4acf0f411c9d5e50b35886385b1634ac /src/fb.c
parentbdd87e11c050819fea910bcc36865b84b59733ad (diff)
*: embrace new generic settings paradigm
This should probably be split into multiple commits, but for simplicity sake it's all cut over at once. drm_fb.c sees major changes, migrating the remaining drm-specific bits from drmsetup into it, behind the settings API. rototiller.c sees a bunch of scaffolding surrounding the settings API and wiring it up into the commandline handling and renderers and video backends. fb.[ch] see minor changes as settings get plumbed to the backend drmsetup.[ch] goes bye bye
Diffstat (limited to 'src/fb.c')
-rw-r--r--src/fb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fb.c b/src/fb.c
index a23bce5..f398d43 100644
--- a/src/fb.c
+++ b/src/fb.c
@@ -5,6 +5,7 @@
#include <stdint.h>
#include "fb.h"
+#include "settings.h"
#include "util.h"
/* Copyright (C) 2016-2017 Vito Caputo <vcaputo@pengaru.com> */
@@ -240,6 +241,9 @@ void fb_free(fb_t *fb)
/* TODO: free all the pages */
+ if (fb->ops->shutdown && fb->ops_context)
+ fb->ops->shutdown(fb->ops_context);
+
pthread_mutex_destroy(&fb->ready_mutex);
pthread_cond_destroy(&fb->ready_cond);
pthread_mutex_destroy(&fb->inactive_mutex);
@@ -250,7 +254,7 @@ void fb_free(fb_t *fb)
/* create a new fb instance */
-fb_t * fb_new(const fb_ops_t *ops, void *context, int n_pages)
+fb_t * fb_new(const fb_ops_t *ops, settings_t *settings, int n_pages)
{
_fb_page_t *page;
fb_t *fb;
@@ -271,7 +275,11 @@ fb_t * fb_new(const fb_ops_t *ops, void *context, int n_pages)
return NULL;
fb->ops = ops;
- fb->ops_context = context;
+ if (ops->init) {
+ fb->ops_context = ops->init(settings);
+ if (!fb->ops_context)
+ goto fail;
+ }
for (i = 0; i < n_pages; i++)
fb_page_new(fb);
© All Rights Reserved