egl/x11: fix build with DRI3 disabled
[mesa.git] / meson.build
index 9a538e99511e6cd9096261c34562f149cae82ba9..4aafba802a5e4d842825199a8769560b2b09abe8 100644 (file)
@@ -137,7 +137,7 @@ with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
 with_gallium_vc4 = false
-with_gallium_vc5 = false
+with_gallium_v3d = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_tegra = false
@@ -155,7 +155,7 @@ if _drivers.contains('auto')
       ]
     elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
       _drivers = [
-        'pl111', 'vc4', 'vc5', 'freedreno', 'etnaviv', 'imx', 'nouveau',
+        'pl111', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'imx', 'nouveau',
         'tegra', 'virgl', 'swrast',
       ]
     else
@@ -175,8 +175,8 @@ if _drivers != ['']
   with_gallium_nouveau = _drivers.contains('nouveau')
   with_gallium_freedreno = _drivers.contains('freedreno')
   with_gallium_softpipe = _drivers.contains('swrast')
+  with_gallium_v3d = _drivers.contains('v3d')
   with_gallium_vc4 = _drivers.contains('vc4')
-  with_gallium_vc5 = _drivers.contains('vc5')
   with_gallium_etnaviv = _drivers.contains('etnaviv')
   with_gallium_imx = _drivers.contains('imx')
   with_gallium_tegra = _drivers.contains('tegra')
@@ -344,11 +344,7 @@ endif
 pre_args += '-DGLX_USE_TLS'
 if with_glx != 'disabled'
   if not (with_platform_x11 and with_any_opengl)
-    if with_glx == 'auto'
-      with_glx = 'disabled'
-    else
-      error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
-    endif
+    error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
   elif with_glx == 'gallium-xlib' 
     if not with_gallium
       error('Gallium-xlib based GLX requires at least one gallium driver')
@@ -361,8 +357,12 @@ if with_glx != 'disabled'
     if with_dri
       error('xlib conflicts with any dri driver')
     endif
-  elif with_glx == 'dri' and not with_dri
-    error('dri based GLX requires at least one DRI driver')
+  elif with_glx == 'dri'
+    if not with_dri
+      error('dri based GLX requires at least one DRI driver')
+    elif not with_shared_glapi
+      error('dri based GLX requires shared-glapi')
+    endif
   endif
 endif
 
@@ -1055,6 +1055,12 @@ _libdrm_checks = [
   ['freedreno', with_gallium_freedreno],
 ]
 
+# VC4 only needs core libdrm support of this version, not a libdrm_vc4
+# library.
+if with_gallium_vc4
+  _drm_ver = '2.4.89'
+endif
+
 # Loop over the enables versions and get the highest libdrm requirement for all
 # active drivers.
 foreach d : _libdrm_checks
@@ -1101,7 +1107,9 @@ if with_gallium_opencl
   # TODO: optional modules
 endif
 
-if with_amd_vk or with_gallium_radeonsi or with_gallium_swr
+if with_amd_vk or with_gallium_radeonsi
+  _llvm_version = '>= 5.0.0'
+elif with_gallium_swr
   _llvm_version = '>= 4.0.0'
 elif with_gallium_opencl or with_gallium_r600
   _llvm_version = '>= 3.9.0'