aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-09-29 22:38:13 +0200
committeremersion <contact@emersion.fr>2018-10-04 21:56:38 +0200
commit78389fe72225f9baf7def744825323f54ac4ee8e (patch)
tree17d005298165399ae931692e8b75472cbd3d5985 /backend
parent3aad9fd6a96aa7c7d0fcf0dfa421c49caae83625 (diff)
output: add present event
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index fa9a95ae..ace0835e 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1149,8 +1149,8 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
}
static void page_flip_handler(int fd, unsigned seq,
- unsigned tv_sec, unsigned tv_usec, void *user) {
- struct wlr_drm_connector *conn = user;
+ unsigned tv_sec, unsigned tv_usec, void *data) {
+ struct wlr_drm_connector *conn = data;
struct wlr_drm_backend *drm =
get_drm_backend_from_backend(conn->output.backend);
@@ -1170,6 +1170,14 @@ static void page_flip_handler(int fd, unsigned seq,
post_drm_surface(&conn->crtc->primary->mgpu_surf);
}
+ struct timespec present_time = {
+ .tv_sec = tv_sec,
+ .tv_nsec = tv_usec * 1000,
+ };
+ uint32_t present_flags = WLR_OUTPUT_PRESENT_VSYNC |
+ WLR_OUTPUT_PRESENT_HW_CLOCK | WLR_OUTPUT_PRESENT_HW_COMPLETION;
+ wlr_output_send_present(&conn->output, &present_time, seq, present_flags);
+
if (drm->session->active) {
wlr_output_send_frame(&conn->output);
}