[Mesa-dev] [PATCH mesa 1/2] meson: centralise the libdrm versions information

Eric Engestrom eric.engestrom at imgtec.com
Mon Jan 29 18:15:50 UTC 2018


The big comment is taken from the equivalent block in configure.ac

Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 meson.build                                 | 30 +++++++++++++++++++++--------
 src/gallium/targets/d3dadapter9/meson.build |  2 +-
 src/mesa/drivers/dri/meson.build            |  2 +-
 3 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/meson.build b/meson.build
index 0a00798c2a5093ec803b..6d7a8e976ff6ad002d9a 100644
--- a/meson.build
+++ b/meson.build
@@ -41,6 +41,20 @@ pre_args = [
   '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"',
 ]
 
+# The idea is that libdrm is distributed as one cohesive package, even
+# though it is composed of multiple libraries. However some drivers
+# may have different version requirements than others. This list
+# codifies which drivers need which version of libdrm. Any libdrm
+# version dependencies in non-driver-specific code should be reflected
+# in the first entry.
+libdrm_version           = '2.4.75'
+libdrm_amdgpu_version    = '2.4.89'
+libdrm_etnaviv_version   = '2.4.82'
+libdrm_freedreno_version = '2.4.82'
+libdrm_intel_version     = '2.4.75'
+libdrm_nouveau_version   = '2.4.66'
+libdrm_radeon_version    = '2.4.71'
+
 with_vulkan_icd_dir = get_option('vulkan-icd-dir')
 with_tests = get_option('build-tests')
 with_valgrind = get_option('valgrind')
@@ -199,7 +213,7 @@ endif
 
 dep_libdrm_intel = []
 if with_dri_i915 or with_gallium_i915
-  dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
+  dep_libdrm_intel = dependency('libdrm_intel', version : '>= @0@'.format(libdrm_intel_version))
 endif
 
 system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
@@ -922,7 +936,7 @@ else
 endif
 
 with_gallium_drisw_kms = false
-dep_libdrm = dependency('libdrm', version : '>= 2.4.75',
+dep_libdrm = dependency('libdrm', version : '>= @0@'.format(libdrm_version),
                         required : with_dri2 or with_dri3)
 if dep_libdrm.found()
   pre_args += '-DHAVE_LIBDRM'
@@ -957,20 +971,20 @@ dep_libdrm_nouveau = []
 dep_libdrm_etnaviv = []
 dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
-  dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.89')
+  dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= @0@'.format(libdrm_amdgpu_version))
 endif
 if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
     with_gallium_r300 or with_gallium_r600)
-  dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
+  dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= @0@'.format(libdrm_radeon_version))
 endif
 if with_gallium_nouveau or with_dri_nouveau
-  dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
+  dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= @0@'.format(libdrm_nouveau_version))
 endif
 if with_gallium_etnaviv
-  dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= 2.4.82')
+  dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= @0@'.format(libdrm_etnaviv_version))
 endif
 if with_gallium_freedreno
-  dep_libdrm_freedreno = dependency('libdrm_freedreno', version : '>= 2.4.89')
+  dep_libdrm_freedreno = dependency('libdrm_freedreno', version : '>= @0@'.format(libdrm_freedreno_version))
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
@@ -1201,7 +1215,7 @@ inc_include = include_directories('include')
 
 gl_priv_reqs = [
   'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
-  'xcb-glx >= 1.8.1', 'libdrm >= 2.4.75',
+  'xcb-glx >= 1.8.1', 'libdrm >= @0@'.format(libdrm_version),
 ]
 if dep_xxf86vm != [] and dep_xxf86vm.found()
   gl_priv_reqs += 'xxf86vm'
diff --git a/src/gallium/targets/d3dadapter9/meson.build b/src/gallium/targets/d3dadapter9/meson.build
index 5476e80e70cf9e2dba5a..ef8062beef06a5daaa52 100644
--- a/src/gallium/targets/d3dadapter9/meson.build
+++ b/src/gallium/targets/d3dadapter9/meson.build
@@ -78,5 +78,5 @@ pkg.generate(
   name : 'd3d',
   description : 'Native D3D driver modules',
   version : '.'.join(nine_version),
-  requires_private : 'libdrm >= 2.4.75',
+  requires_private : 'libdrm >= @0@'.format(libdrm_version),
 )
diff --git a/src/mesa/drivers/dri/meson.build b/src/mesa/drivers/dri/meson.build
index 94798b0f5dadccb651ab..519639e8a4ec1d08b8f2 100644
--- a/src/mesa/drivers/dri/meson.build
+++ b/src/mesa/drivers/dri/meson.build
@@ -73,6 +73,6 @@ if with_dri
     description : 'Direct Rendering Infrastructure',
     version : meson.project_version(),
     variables : ['dridriverdir=${prefix}/' + dri_drivers_path],
-    requires_private : ['libdrm >= 2.4.75'],  # FIXME: don't hardcode this
+    requires_private : ['libdrm >= @0@'.format(libdrm_version)],
   )
 endif
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list