From 0d32118a8087061c17eac30e9b00ee527d6d3a4e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 1 Dec 2021 08:49:48 +0100 Subject: output: fix modifier stripping DRM formats with an empty modifier list are invalid. Instead of emptying the list, reduce it to { INVALID }. Add a check to make sure the renderer and backend support implicit modifiers, so that we don't fallback on e.g. Vulkan. Closes: https://github.com/swaywm/sway/issues/6692 --- types/output/render.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/output/render.c b/types/output/render.c index 97c62a58..985b93a9 100644 --- a/types/output/render.c +++ b/types/output/render.c @@ -74,7 +74,14 @@ static bool output_create_swapchain(struct wlr_output *output, format->format, output->name); if (!allow_modifiers && (format->len != 1 || format->modifiers[0] != DRM_FORMAT_MOD_LINEAR)) { + if (!wlr_drm_format_has(format, DRM_FORMAT_MOD_INVALID)) { + wlr_log(WLR_DEBUG, "Implicit modifiers not supported"); + free(format); + return false; + } + format->len = 0; + wlr_drm_format_add(&format, DRM_FORMAT_MOD_INVALID); } struct wlr_swapchain *swapchain = -- cgit v1.2.3