diff options
author | emersion <contact@emersion.fr> | 2018-01-21 00:06:35 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-21 00:06:35 +0100 |
commit | 0365b587f03411d6a55017e111a991d466decc35 (patch) | |
tree | 8d4668c9c51e60535b560a3f3e367fc421c9b72b /backend/drm/drm.c | |
parent | 78c13ead163e76b1c0ff344eefeadcaeffb3890e (diff) |
output: add damage tracking via buffer age
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 72acbeab..72fc1441 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -183,12 +183,13 @@ void wlr_drm_resources_free(struct wlr_drm_backend *drm) { free(drm->planes); } -static void wlr_drm_connector_make_current(struct wlr_output *output) { +static bool wlr_drm_connector_make_current(struct wlr_output *output, + int *buffer_age) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - wlr_drm_surface_make_current(&conn->crtc->primary->surf); + return wlr_drm_surface_make_current(&conn->crtc->primary->surf, buffer_age); } -static void wlr_drm_connector_swap_buffers(struct wlr_output *output) { +static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; @@ -203,7 +204,7 @@ static void wlr_drm_connector_swap_buffers(struct wlr_output *output) { if (conn->pageflip_pending) { wlr_log(L_ERROR, "Skipping pageflip"); - return; + return true; } if (drm->iface->crtc_pageflip(drm, conn, crtc, fb_id, NULL)) { @@ -212,6 +213,8 @@ static void wlr_drm_connector_swap_buffers(struct wlr_output *output) { wl_event_source_timer_update(conn->retry_pageflip, 1000000.0f / conn->output.current_mode->refresh); } + + return true; } static void wlr_drm_connector_set_gamma(struct wlr_output *output, @@ -595,7 +598,7 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, return false; } - wlr_drm_surface_make_current(&plane->surf); + wlr_drm_surface_make_current(&plane->surf, NULL); wlr_texture_upload_pixels(plane->wlr_tex, WL_SHM_FORMAT_ARGB8888, stride, width, height, buf); |