blob: 58ff3ba561e3555fd49fdf54d97de8f38b3395b0 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From bdde833c254092a47df6c7109a9751653c82aaae Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Mon, 8 Aug 2022 20:22:39 +0200
4Subject: [PATCH] drm-common.c: do not use invalid modifier
5
6Prior to kernel 5.19 this was a soft failure, but 5.19
7adds checks that result in a hard syscall fail.
8
9Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/kmscube/-/merge_requests/33]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 drm-common.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/drm-common.c b/drm-common.c
16index 5c9cca2..964e1c3 100644
17--- a/drm-common.c
18+++ b/drm-common.c
19@@ -92,7 +92,7 @@ struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo)
20 modifiers[i] = modifiers[0];
21 }
22
23- if (modifiers[0]) {
24+ if (modifiers[0] && modifiers[0] != DRM_FORMAT_MOD_INVALID) {
25 flags = DRM_MODE_FB_MODIFIERS;
26 printf("Using modifier %" PRIx64 "\n", modifiers[0]);
27 }