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