aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-02 12:11:09 +0200
committeremersion <contact@emersion.fr>2018-10-04 22:00:24 +0200
commiteac7c2ad2faf49084342d9f805cf06b773723fdd (patch)
tree6fbd71fd0fe6f06183a7ee94b03727f69341328b /include
parentabd3e995ab446b5487f4d2ff16d9e2c3f1baade1 (diff)
output: add presentation refresh prediction
Diffstat (limited to 'include')
-rw-r--r--include/wlr/interfaces/wlr_output.h4
-rw-r--r--include/wlr/types/wlr_output.h13
2 files changed, 15 insertions, 2 deletions
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index b06c5db0..52581768 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -45,7 +45,7 @@ void wlr_output_update_enabled(struct wlr_output *output, bool enabled);
void wlr_output_update_needs_swap(struct wlr_output *output);
void wlr_output_damage_whole(struct wlr_output *output);
void wlr_output_send_frame(struct wlr_output *output);
-void wlr_output_send_present(struct wlr_output *output, struct timespec *when,
- unsigned seq, uint32_t flags);
+void wlr_output_send_present(struct wlr_output *output,
+ struct wlr_output_event_present *event);
#endif
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index fb3becd1..9ccfbbb5 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -130,15 +130,28 @@ struct wlr_output_event_swap_buffers {
};
enum wlr_output_present_flag {
+ // The presentation was synchronized to the "vertical retrace" by the
+ // display hardware such that tearing does not happen.
WLR_OUTPUT_PRESENT_VSYNC = 0x1,
+ // The display hardware provided measurements that the hardware driver
+ // converted into a presentation timestamp.
WLR_OUTPUT_PRESENT_HW_CLOCK = 0x2,
+ // The display hardware signalled that it started using the new image
+ // content.
WLR_OUTPUT_PRESENT_HW_COMPLETION = 0x4,
+ // The presentation of this update was done zero-copy.
+ WLR_OUTPUT_PRESENT_ZERO_COPY = 0x8,
};
struct wlr_output_event_present {
struct wlr_output *output;
+ // Time when the content update turned into light the first time.
struct timespec *when;
+ // Vertical retrace counter. Zero if unavailable.
unsigned seq;
+ // Prediction of how many nanoseconds after `when` the very next output
+ // refresh may occur. Zero if unknown.
+ int refresh; // nsec
uint32_t flags; // enum wlr_output_present_flag
};