handle ephemeral pageflip failures

If a transient failure occurs in wlr_output_commit, re-render until it
doesn't happen.  This could possibly be removed if we decide to
implement damage tracking in the future.
This commit is contained in:
Devin J. Pohly 2021-05-25 02:52:33 -05:00
parent 60c40c0989
commit 823cefd292

6
dwl.c
View File

@ -1726,6 +1726,10 @@ rendermon(struct wl_listener *listener, void *data)
} }
} }
/* HACK: This loop is the simplest way to handle ephemeral pageflip
* failures but probably not the best. Revisit if damage tracking is
* added. */
do {
/* wlr_output_attach_render makes the OpenGL context current. */ /* wlr_output_attach_render makes the OpenGL context current. */
if (!wlr_output_attach_render(m->wlr_output, NULL)) if (!wlr_output_attach_render(m->wlr_output, NULL))
return; return;
@ -1757,7 +1761,7 @@ rendermon(struct wl_listener *listener, void *data)
wlr_renderer_end(drw); wlr_renderer_end(drw);
} }
wlr_output_commit(m->wlr_output); } while (!wlr_output_commit(m->wlr_output));
} }
void void