radv: drop unused r600_htile_info.
[mesa.git] / meson.build
index fecb5dbac814275d26d3a4f3e93ef9680662c0d9..82c4d2ed12c0132b2cd6aaa7993264feb10af011 100644 (file)
@@ -91,11 +91,21 @@ if _drivers != ''
 endif
 
 with_gallium = false
+with_gallium_pl111 = false
 with_gallium_radeonsi = false
+with_gallium_nouveau = false
+with_gallium_softpipe = false
+with_gallium_vc4 = false
+with_gallium_vc5 = false
 _drivers = get_option('gallium-drivers')
 if _drivers != ''
   _split = _drivers.split(',')
+  with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
+  with_gallium_nouveau = _split.contains('nouveau')
+  with_gallium_softpipe = _split.contains('swrast')
+  with_gallium_vc4 = _split.contains('vc4')
+  with_gallium_vc5 = _split.contains('vc5')
   with_gallium = true
   with_dri = true
 endif
@@ -108,6 +118,10 @@ if not (with_dri or with_gallium)
   with_shared_glapi = false
 endif
 
+if with_dri_swrast and with_gallium_softpipe
+  error('Only one swrast provider can be built')
+endif
+
 dep_libdrm_intel = []
 if with_dri_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
@@ -522,10 +536,14 @@ else
   dep_clock = cc.find_library('rt')
 endif
 
+with_gallium_drisw_kms = false
 dep_libdrm = dependency('libdrm', version : '>= 2.4.75',
                         required : with_dri2 or with_dri3)
 if dep_libdrm.found()
   pre_args += '-DHAVE_LIBDRM'
+  if with_dri_platform == 'drm' and with_dri
+    with_gallium_drisw_kms = true
+  endif
 endif
 
 # TODO: some of these may be conditional
@@ -535,14 +553,26 @@ if dep_thread.found() and host_machine.system() == 'linux'
   pre_args += '-DHAVE_PTHREAD'
 endif
 dep_elf = dependency('libelf', required : false)
-if not dep_elf.found()
-  dep_elf = cc.find_library('elf', required : with_amd_vk) # TODO: clover, r600, radeonsi
+if not dep_elf.found() and (with_amd_vk or with_gallium_radeonsi) # TODO: clover, r600
+  dep_elf = cc.find_library('elf')
 endif
 dep_expat = dependency('expat')
 # this only exists on linux so either this is linux and it will be found, or
 # its not linux and and wont
 dep_m = cc.find_library('m', required : false)
-dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.82', required : with_amd_vk)
+
+dep_libdrm_amdgpu = []
+dep_libdrm_radeon = []
+dep_libdrm_nouveau = []
+if with_amd_vk or with_gallium_radeonsi
+  dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.84')
+endif
+if with_gallium_radeonsi # older radeon too
+  dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
+endif
+if with_gallium_nouveau
+  dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
+endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
 if with_amd_vk
@@ -565,12 +595,14 @@ if with_llvm
       '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
     ]
   else
-    if with_amd_vk
-      error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM was not found.')
+    if with_gallium_softpipe
+      error('Cannot find LLVM to build LLVMPipe. If you wanted softpipe pass -Dllvm=false to meson')
+    elif with_amd_vk or with_gallium_radeonsi # etc
+      error('The following drivers requires LLVM: Radv, RadeonSI. One of these is enabled, but LLVM was not found.')
     endif
   endif
-elif with_amd_vk
-  error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM is disabled.')
+elif with_amd_vk or with_gallium_radeonsi
+  error('The following drivers requires LLVM: Radv, RadeonSI. One of these is enabled, but LLVM is disabled.')
 endif
 
 dep_glvnd = []
@@ -646,7 +678,7 @@ if with_platform_x11
     dep_xdamage = dependency('xdamage', version : '>= 1.1')
     dep_xfixes = dependency('xfixes')
     dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
-    dep_xf86vm = dependency('xf86vm', required : false)
+    dep_xf86vm = dependency('xxf86vm', required : false)
   endif
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
     dep_xcb = dependency('xcb')