summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-graphics/kmscube/kmscube/0001-drm-common.c-do-not-use-invalid-modifier.patch
blob: 58ff3ba561e3555fd49fdf54d97de8f38b3395b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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]);
 		}