diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-11-17 14:34:32 -0500 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-11-17 14:34:32 -0500 |
commit | b06d58fa8b6bb5d9a154f795ec595477e13998bc (patch) | |
tree | d363d35ddf72388b8ce5171f76162caee11958e6 /backend | |
parent | 3aed24b8d4572eb4cd2488113f1c1a23ceb290d8 (diff) |
backend/drm: Destroy page flips on backend destroy
When we destroy the backend, page flips will no longer be invoked meaning
those won't clean up the page flips for us.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/backend.c | 5 | ||||
-rw-r--r-- | backend/drm/drm.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 5ff2b90c..40597dae 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -39,6 +39,11 @@ static void backend_destroy(struct wlr_backend *backend) { destroy_drm_connector(conn); } + struct wlr_drm_page_flip *page_flip, *page_flip_tmp; + wl_list_for_each_safe(page_flip, page_flip_tmp, &drm->page_flips, link) { + drm_page_flip_destroy(page_flip); + } + wlr_backend_finish(backend); wl_list_remove(&drm->display_destroy.link); diff --git a/backend/drm/drm.c b/backend/drm/drm.c index eb9e8267..0af93802 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -420,7 +420,7 @@ static void drm_connector_set_pending_page_flip(struct wlr_drm_connector *conn, conn->pending_page_flip = page_flip; } -static void page_flip_destroy(struct wlr_drm_page_flip *page_flip) { +void drm_page_flip_destroy(struct wlr_drm_page_flip *page_flip) { if (!page_flip) { return; } @@ -476,7 +476,7 @@ static bool drm_crtc_commit(struct wlr_drm_connector *conn, drm_fb_clear(&layer->pending_fb); } - page_flip_destroy(page_flip); + drm_page_flip_destroy(page_flip); } return ok; } @@ -1696,7 +1696,7 @@ static void handle_page_flip(int fd, unsigned seq, if (conn != NULL) { conn->pending_page_flip = NULL; } - page_flip_destroy(page_flip); + drm_page_flip_destroy(page_flip); if (conn == NULL) { return; |