aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-04-10 15:00:00 +0200
committerDrew DeVault <sir@cmpwn.com>2020-04-10 15:52:20 +0200
commit83c1ba77834d7710918e4fe15c5cb40c4736d6db (patch)
tree2bfbe6780b779cb63a4c10af6a31ae1d9be49f5e /backend
parent50ade3671fb6776379b0923ca230e7105f25bbc2 (diff)
backend/wayland: check scan-out buffer is compatible in output_test
If the buffer doesn't have a supported format/modifier, make the test fail.
Diffstat (limited to 'backend')
-rw-r--r--backend/wayland/output.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 1f56eabe..077aa16d 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -190,6 +190,9 @@ static struct wlr_wl_buffer *create_wl_buffer(struct wlr_wl_backend *wl,
}
static bool output_test(struct wlr_output *wlr_output) {
+ struct wlr_wl_output *output =
+ get_wl_output_from_output(wlr_output);
+
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
wlr_log(WLR_DEBUG, "Cannot disable a Wayland output");
return false;
@@ -199,6 +202,12 @@ static bool output_test(struct wlr_output *wlr_output) {
assert(wlr_output->pending.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);
}
+ if ((wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) &&
+ wlr_output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT &&
+ !test_buffer(output->backend, wlr_output->pending.buffer)) {
+ return false;
+ }
+
return true;
}