diff options
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 5afdf3c3..ca4f56c3 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -116,6 +116,21 @@ static void wlr_drm_output_end(struct wlr_output_state *output) { output->bo[0] = bo; } +void wlr_drm_output_pause_renderer(struct wlr_output_state *output) { + if (output->state != DRM_OUTPUT_CONNECTED) { + return; + } + + if (output->bo[1]) { + gbm_surface_release_buffer(output->gbm, output->bo[1]); + output->bo[1] = NULL; + } + if (output->bo[0]) { + gbm_surface_release_buffer(output->gbm, output->bo[0]); + output->bo[0] = NULL; + } +} + void wlr_drm_output_start_renderer(struct wlr_output_state *output) { if (output->state != DRM_OUTPUT_CONNECTED) { return; @@ -608,7 +623,7 @@ static void page_flip_handler(int fd, unsigned seq, } output->pageflip_pending = false; - if (output->state == DRM_OUTPUT_CONNECTED) { + if (output->state == DRM_OUTPUT_CONNECTED && state->session->active) { wlr_drm_output_begin(output); wl_signal_emit(&output->wlr_output->events.frame, output->wlr_output); wlr_drm_output_end(output); |