aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorAustin Shafer <ashafer@nvidia.com>2023-05-17 13:07:29 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-05-17 18:24:20 +0000
commit0910fa917981bea48475e37b57b549e11bf0f1b4 (patch)
tree1ae8d808ca54f0286a0a653959f7b83f8f7bc88c /backend
parent3dc5c7e5e789d061feaea505da66e1a5690973cc (diff)
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.
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/renderer.c6
1 files changed, 6 insertions, 0 deletions
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;
}