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

Eric Engestrom eric.engestrom at imgtec.com
Wed Jan 31 11:47:25 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 80ea60ffa7d915654a89..30c2198d77dde383d7ac 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 : '>= ' + 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 : '>= ' + 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 : '>= ' + 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 : '>= ' + 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 : '>= ' + 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 : '>= ' + 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 : '>= ' + libdrm_freedreno_version)
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
@@ -1203,7 +1217,7 @@ gl_priv_reqs = [
   'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
   'xcb-glx >= 1.8.1']
 if dep_libdrm.found()
-  gl_priv_reqs += 'libdrm >= 2.4.75'
+  gl_priv_reqs += 'libdrm >= ' + libdrm_version
 endif
 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..498737d1edbf39b3bea2 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 >= ' + libdrm_version,
 )
diff --git a/src/mesa/drivers/dri/meson.build b/src/mesa/drivers/dri/meson.build
index 87021fba885ab148988d..2a2757577828598489c9 100644
--- a/src/mesa/drivers/dri/meson.build
+++ b/src/mesa/drivers/dri/meson.build
@@ -69,7 +69,7 @@ endif
 if with_dri
   dri_req_private = []
   if dep_libdrm.found()
-    dri_req_private = ['libdrm >= 2.4.75']  # FIXME: don't hardcode this
+    dri_req_private += 'libdrm >= ' + libdrm_version
   endif
 
   pkg.generate(
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list