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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
Drop after graphics/libdrm >= 2.4.125 update
--- meson.build.orig 2025-06-09 12:43:22 UTC
+++ meson.build
@@ -41,7 +41,7 @@ libdrm = dependency('libdrm',
#
# We need to make sure we don't use any new libdrm functions, but those
# are added very infrequently, so this is unlikely to be an issue.
-if libdrm.version().version_compare('<2.4.125')
+if libdrm.version().version_compare('<2.4.123')
if libdrm.type_name() == 'internal'
error('libdrm subproject out of date. Run `meson subprojects update`.')
endif
@@ -65,6 +65,11 @@ else
fourcc_h = meson.current_source_dir() / 'subprojects/libdrm/include/drm/drm_fourcc.h'
else
fourcc_h = libdrm.get_variable(pkgconfig: 'pc_sysrootdir') + libdrm.get_variable(pkgconfig: 'includedir') / 'libdrm/drm_fourcc.h'
+endif
+
+# DRM_FORMAT_MOD_VENDOR_MTK and its information is included in libdrm v2.4.125
+if libdrm.version().version_compare('>=2.4.125')
+ add_project_arguments('-DHAVE_MEDIATEK', language: 'c')
endif
if libpci.found()
--- modifiers.c.orig 2025-06-09 12:43:22 UTC
+++ modifiers.c
@@ -298,6 +298,7 @@ static void print_vivante_modifier(uint64_t mod) {
printf(")");
}
+#ifdef HAVE_MEDIATEK
static const char *mediatek_tile_layout_str(uint64_t tile_layout) {
switch (tile_layout) {
case MTK_FMT_MOD_TILE_NONE:
@@ -343,6 +344,7 @@ static void print_mediatek_modifier(uint64_t mod) {
mediatek_compression_str(compression),
mediatek_10bit_layout_str(layout_10bit));
}
+#endif
static uint8_t mod_vendor(uint64_t mod) {
return (uint8_t)(mod >> 56);
@@ -365,9 +367,11 @@ void print_modifier(uint64_t mod) {
case DRM_FORMAT_MOD_VENDOR_VIVANTE:
print_vivante_modifier(mod);
break;
+#ifdef HAVE_MEDIATEK
case DRM_FORMAT_MOD_VENDOR_MTK:
print_mediatek_modifier(mod);
break;
+#endif
default:
printf("%s", basic_modifier_str(mod));
}
|