mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
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
This commit is contained in:
parent
e92b272616
commit
3be6658ee7
1 changed files with 6 additions and 6 deletions
|
@ -209,13 +209,13 @@ bool output_ensure_buffer(struct wlr_output *output,
|
||||||
if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) {
|
if (state->committed & WLR_OUTPUT_STATE_RENDER_FORMAT) {
|
||||||
needs_new_buffer = true;
|
needs_new_buffer = true;
|
||||||
}
|
}
|
||||||
if (!needs_new_buffer) {
|
if (state->allow_artifacts && output->commit_seq == 0) {
|
||||||
return true;
|
// 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 (!needs_new_buffer) {
|
||||||
// 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)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue