diff options
author | Andri Yngvason <andri@yngvason.is> | 2019-10-19 14:46:24 +0000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-22 10:41:32 -0400 |
commit | 5d8bd4d343397f2f2ef2bb20241363248e034e42 (patch) | |
tree | f2593c0b120248bd0173db4a77c776c22316a164 | |
parent | d113e48a2a32542fe6e12f1759f07888364609bf (diff) |
output: Add commit sequence number
This allows synchronisation between different instances of commit/precommit
callbacks.
-rw-r--r-- | include/wlr/types/wlr_output.h | 3 | ||||
-rw-r--r-- | types/wlr_output.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 01e71206..97aa885e 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -114,6 +114,9 @@ struct wlr_output { struct wlr_output_state pending; + // Commit sequence number. Incremented on each commit, may overflow. + uint32_t commit_seq; + struct { // Request to render a frame struct wl_signal frame; diff --git a/types/wlr_output.c b/types/wlr_output.c index 7ac54083..6555296c 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -311,6 +311,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, wl_list_init(&output->modes); output->transform = WL_OUTPUT_TRANSFORM_NORMAL; output->scale = 1; + output->commit_seq = 0; wl_list_init(&output->cursors); wl_list_init(&output->resources); wl_signal_init(&output->events.frame); @@ -500,6 +501,7 @@ bool wlr_output_commit(struct wlr_output *output) { output->needs_frame = false; output_state_clear(&output->pending); pixman_region32_clear(&output->damage); + output->commit_seq++; return true; } |