From 0910fa917981bea48475e37b57b549e11bf0f1b4 Mon Sep 17 00:00:00 2001 From: Austin Shafer Date: Wed, 17 May 2023 13:07:29 -0400 Subject: [PATCH] drm_plane_pick_render_format: return false if no format could be found Commit 90d08f8f1c40e2a302d62052435ff2abdb08a854 changed the way wlr_drm_format_intersect worked, including passing in a destination format list. This breaks scenarios where the intersection doesn't find any matching formats, since we still have a valid destination format set. This changes it to only return true if more than one matching format is present in the intersection list. --- backend/drm/renderer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index 8d137ae1..26cf2158 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -177,6 +177,12 @@ bool drm_plane_pick_render_format(struct wlr_drm_plane *plane, return false; } + if (fmt->len == 0) { + wlr_drm_format_finish(fmt); + wlr_log(WLR_DEBUG, "Failed to find matching plane and renderer modifiers"); + return false; + } + return true; }