diff options
author | emersion <contact@emersion.fr> | 2018-01-28 22:39:24 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-28 22:39:24 +0100 |
commit | 20e6861021ddce3c12f896aa2a961a4da23f98ad (patch) | |
tree | cbd138fefdba06b95a8f2b9b9fd00355263a5d02 | |
parent | 7881d039b6824eb245496becebf02d3eea55a909 (diff) |
Do not flush damage if swapping buffers failed
This should solve issues with multiple outputs on DRM backend.
-rw-r--r-- | backend/drm/drm.c | 2 | ||||
-rw-r--r-- | rootston/output.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 024bc929..a9cfa276 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -210,7 +210,7 @@ static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) { if (conn->pageflip_pending) { wlr_log(L_ERROR, "Skipping pageflip"); - return true; + return false; } if (drm->iface->crtc_pageflip(drm, conn, crtc, fb_id, NULL)) { diff --git a/rootston/output.c b/rootston/output.c index 14840e5b..04a45d1f 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -387,7 +387,9 @@ static void render_output(struct roots_output *output) { } int buffer_age = -1; - wlr_output_make_current(wlr_output, &buffer_age); + if (!wlr_output_make_current(wlr_output, &buffer_age)) { + return; + } int width, height; output_get_transformed_size(output->wlr_output, &width, &height); @@ -482,7 +484,9 @@ static void render_output(struct roots_output *output) { renderer_end: wlr_renderer_scissor(output->desktop->server->renderer, NULL); wlr_renderer_end(server->renderer); - wlr_output_swap_buffers(wlr_output, &now, &damage); + if (!wlr_output_swap_buffers(wlr_output, &now, &damage)) { + goto damage_finish; + } // same as decrementing, but works on unsigned integers output->previous_damage_idx += ROOTS_OUTPUT_PREVIOUS_DAMAGE_LEN - 1; output->previous_damage_idx %= ROOTS_OUTPUT_PREVIOUS_DAMAGE_LEN; |