diff options
author | Scott Anderson <ascent12@hotmail.com> | 2017-08-11 11:12:41 +1200 |
---|---|---|
committer | Scott Anderson <ascent12@hotmail.com> | 2017-08-11 11:12:41 +1200 |
commit | fe2fbd0fad96624ab64a86b0b8eb8ead769908f2 (patch) | |
tree | 69338b78870aedd9b0f477d85d2d49a758567680 /backend/drm | |
parent | 5465621d0a1892275ae05a69481eda1140c4461f (diff) |
Fix possible use of CRTC after monitor is unplugged
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 1c83af3e..b5742eca 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -785,14 +785,18 @@ static void page_flip_handler(int fd, unsigned seq, struct wlr_backend_state *drm = wl_container_of(output->renderer, drm, renderer); + output->pageflip_pending = false; + if (output->state != WLR_DRM_OUTPUT_CONNECTED) { + return; + } + struct wlr_drm_plane *plane = output->crtc->primary; if (plane->front) { gbm_surface_release_buffer(plane->gbm, plane->front); plane->front = NULL; } - output->pageflip_pending = false; - if (output->state == WLR_DRM_OUTPUT_CONNECTED && drm->session->active) { + if (drm->session->active) { wl_signal_emit(&output->base->events.frame, output->base); } } |