aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-08-02 16:49:02 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-08-04 10:18:59 -0400
commitdf0e75ba05e20a47fa8d2264d990757100ca9983 (patch)
tree2f9ad9e9695bbd5dcba7542b3225c3024bf1760e
parent8a3cd28973210b1c91d822c0f371b888641d05d8 (diff)
output: try skipping buffer allocation if the backend allows it
When enabling an output, skip the empty buffer allocation if the backend accepts modesets without a buffer. This fixes mode-setting with the noop backend.
-rw-r--r--types/wlr_output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 47ee55be..394f82cd 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -677,6 +677,12 @@ static bool output_ensure_buffer(struct wlr_output *output) {
return 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)) {
+ return true;
+ }
+
wlr_log(WLR_DEBUG, "Attaching empty buffer to output for modeset");
if (!output_attach_empty_buffer(output)) {