From 33eba9080c5fb54484bd6f39a9f38d48b31a2dd4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 19 Nov 2021 15:24:07 +0100 Subject: [PATCH] output: fix renderer buffer cap sanity check in wlr_output_init_render The backend and renderer don't directly interact together, so there's no point in checking that their buffer caps intersect. What we want to check is that: - The backend and allocator buffer caps are compatible, because the backend consumes buffers to display them. - The renderer and allocator buffer caps are compatible, because the renderer imports buffers to sample them or render to them. For instance, when running with the DRM backend and the Pixman renderer, the (backend & renderer) check will fail because backend = DMABUF and renderer = DATA_PTR. --- types/output/render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/output/render.c b/types/output/render.c index 2f6fe260..5bf5530e 100644 --- a/types/output/render.c +++ b/types/output/render.c @@ -23,8 +23,8 @@ bool wlr_output_init_render(struct wlr_output *output, wlr_log(WLR_ERROR, "output backend and allocator buffer capabilities " "don't match"); return false; - } else if (!(backend_caps & renderer_caps)) { - wlr_log(WLR_ERROR, "output backend and renderer buffer capabilities " + } else if (!(renderer_caps & allocator->buffer_caps)) { + wlr_log(WLR_ERROR, "renderer and allocator buffer capabilities " "don't match"); return false; }