summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/grdev.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-10-02 18:47:01 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-10-03 15:57:00 +0200
commit66695cc343647dcbf654fbb4b3f38bd1ee092a0d (patch)
tree49e1bc8014b99e0a7ad7aba32a6e1ff243d8d2ec /src/libsystemd-terminal/grdev.h
parent51cff8bdedbc283b2403ab4a688903d8b1f2fab5 (diff)
terminal/grdev: allow arbitrary fb-age contexts
Instead of limiting fb-aging to 64bit integers, allow any arbitrary context together with a release function to free it once the FB is destroyed.
Diffstat (limited to 'src/libsystemd-terminal/grdev.h')
-rw-r--r--src/libsystemd-terminal/grdev.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libsystemd-terminal/grdev.h b/src/libsystemd-terminal/grdev.h
index ca0373ed29..35d6eb2abf 100644
--- a/src/libsystemd-terminal/grdev.h
+++ b/src/libsystemd-terminal/grdev.h
@@ -93,9 +93,15 @@ struct grdev_fb {
uint32_t width;
uint32_t height;
uint32_t format;
- uint64_t age;
int32_t strides[4];
void *maps[4];
+
+ union {
+ void *ptr;
+ uint64_t u64;
+ } data;
+
+ void (*free_fn) (void *ptr);
};
struct grdev_display_target {
@@ -105,8 +111,8 @@ struct grdev_display_target {
uint32_t height;
unsigned int rotate;
unsigned int flip;
- const grdev_fb *front;
- const grdev_fb *back;
+ grdev_fb *front;
+ grdev_fb *back;
};
void grdev_display_set_userdata(grdev_display *display, void *userdata);
@@ -121,7 +127,7 @@ void grdev_display_enable(grdev_display *display);
void grdev_display_disable(grdev_display *display);
const grdev_display_target *grdev_display_next_target(grdev_display *display, const grdev_display_target *prev);
-void grdev_display_flip_target(grdev_display *display, const grdev_display_target *target, uint64_t age);
+void grdev_display_flip_target(grdev_display *display, const grdev_display_target *target);
#define GRDEV_DISPLAY_FOREACH_TARGET(_display, _t) \
for ((_t) = grdev_display_next_target((_display), NULL); \