meson: use a feature option for gallium-va
authorDylan Baker <dylan.c.baker@intel.com>
Tue, 20 Dec 2022 23:05:26 +0000 (15:05 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 Jan 2023 16:29:03 +0000 (16:29 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

.gitlab-ci/build/gitlab-ci.yml
.gitlab-ci/windows/mesa_build.ps1
meson.build
meson_options.txt

index 8d89718..e3171e2 100644 (file)
@@ -652,7 +652,7 @@ debian-mingw32-x86_64:
       -D microsoft-clc=enabled
       -D static-libclc=all
       -D llvm=enabled
-      -D gallium-va=true
+      -D gallium-va=enabled
       -D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
     EXTRA_OPTION: >
       -D min-windows-version=7
index 69d0246..25a6565 100644 (file)
@@ -49,7 +49,7 @@ meson `
 -Dshared-llvm=disabled `
 -Dvulkan-drivers="swrast,amd,microsoft-experimental" `
 -Dgallium-drivers="swrast,d3d12,zink" `
--Dgallium-va=true `
+-Dgallium-va=enabled `
 -Dvideo-codecs="h264dec,h264enc,h265dec,h265enc,vc1dec" `
 -Dshared-glapi=enabled `
 -Dgles1=enabled `
index 7f5709d..2aa7e7b 100644 (file)
@@ -756,44 +756,27 @@ if with_gallium_omx != 'disabled'
   endif
 endif
 
-_va = get_option('gallium-va')
-if _va == 'true'
-  _va = 'enabled'
-  warning('gallium-va option "true" deprecated, please use "enabled" instead.')
-elif _va == 'false'
-  _va = 'disabled'
-  warning('gallium-va option "false" deprecated, please use "disabled" instead.')
-endif
-if not [
-         with_gallium_d3d12_video,
-         with_gallium_nouveau,
-         with_gallium_r600,
-         with_gallium_radeonsi,
-         with_gallium_virgl,
-       ].contains(true)
-  if _va == 'enabled'
-    error('VA state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau, d3d12 (with option gallium-d3d12-video), virgl.')
-  else
-    _va = 'disabled'
-  endif
-endif
-with_gallium_va = false
-dep_va = null_dep
-if _va != 'disabled'
-  _dep_va_name = 'libva'
-  if host_machine.system() == 'windows'
-    _dep_va_name = 'libva-win32'
-  endif
-  dep_va = dependency(_dep_va_name, version : '>= 1.8.0', required : _va == 'enabled')
-  if dep_va.found()
-    dep_va_headers = dep_va.partial_dependency(compile_args : true)
-    with_gallium_va = true
-    if cc.has_header_symbol('va/va.h', 'VASurfaceAttribDRMFormatModifiers',
-                            dependencies: dep_va_headers)
-      pre_args += '-DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS'
-    endif
+_va_drivers = [
+  with_gallium_d3d12_video,
+  with_gallium_nouveau,
+  with_gallium_r600,
+  with_gallium_radeonsi,
+  with_gallium_virgl,
+]
+
+_va = get_option('gallium-va') \
+  .require(_va_drivers.contains(true),
+           error_message : 'VA state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau, d3d12 (with option gallium-d3d12-video), virgl.')
+_dep_va_name = host_machine.system() == 'windows' ? 'libva-win32' : 'libva'
+dep_va = dependency(_dep_va_name, version : '>= 1.8.0', required : _va)
+if dep_va.found()
+  dep_va_headers = dep_va.partial_dependency(compile_args : true)
+  if cc.has_header_symbol('va/va.h', 'VASurfaceAttribDRMFormatModifiers',
+                          dependencies: dep_va_headers)
+    pre_args += '-DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS'
   endif
 endif
+with_gallium_va = dep_va.found()
 
 va_drivers_path = get_option('va-libs-path')
 if va_drivers_path == ''
index 76bdcd4..7471361 100644 (file)
@@ -109,9 +109,7 @@ option(
 )
 option(
   'gallium-va',
-  type : 'combo',
-  value : 'auto',
-  choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
+  type : 'feature',
   description : 'enable gallium va frontend.',
 )
 option(