diff options
author | Simon Ser <contact@emersion.fr> | 2022-10-07 13:51:01 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2022-10-07 19:21:20 +0000 |
commit | 3be6658ee7b6446e438e8d8c6c7bca3c0c0d4bc8 (patch) | |
tree | cbbf662f9caf22c4699e4fe953d60636d46a1bec | |
parent | e92b272616ecd6618d2568c4e8d07228447ff72a (diff) |
output: allocate swapchain on first commit
On first commit, require a new buffer if the compositor called a
mode-setting function, even if the mode won't change. This makes it
so the swapchain is created now.
Stop trying to check whether the backend supports buffer-less modesets
because that makes everything more complicated. For instance, the
DRM backend doesn't need a new buffer if the previous DRM master left
the output enabled.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3502
-rw-r--r-- | types/output/render.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/types/output/render.c b/types/output/render.c index 4ccfb70d..50fbfa2b 100644 --- a/types/output/render.c +++ b/types/output/render.c @@ -209,13 +209,13 @@ bool output_ensure_buffer(struct wlr_output *output, if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) { needs_new_buffer = true; } - if (!needs_new_buffer) { - return true; + if (state->allow_artifacts && output->commit_seq == 0) { + // On first commit, require a new buffer if the compositor called a + // mode-setting function, even if the mode won't change. This makes it + // so the swapchain is created now. + needs_new_buffer = true; } - - // If the backend doesn't necessarily need a new buffer on modeset, don't - // bother allocating one. - if (!output->impl->test || output->impl->test(output, state)) { + if (!needs_new_buffer) { return true; } |