From 6f66b89ac3676bcdaad0da3b9af8aae0ef6b826a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2022 15:05:26 -0800 Subject: [PATCH] meson: use a feature option for gallium-va Reviewed-by: Jesse Natalie Acked-by: Alyssa Rosenzweig Part-of: --- .gitlab-ci/build/gitlab-ci.yml | 2 +- .gitlab-ci/windows/mesa_build.ps1 | 2 +- meson.build | 55 +++++++++++-------------------- meson_options.txt | 4 +-- 4 files changed, 22 insertions(+), 41 deletions(-) diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index 8d89718c812..e3171e2a181 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -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 diff --git a/.gitlab-ci/windows/mesa_build.ps1 b/.gitlab-ci/windows/mesa_build.ps1 index 69d0246136e..25a6565d3d9 100644 --- a/.gitlab-ci/windows/mesa_build.ps1 +++ b/.gitlab-ci/windows/mesa_build.ps1 @@ -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 ` diff --git a/meson.build b/meson.build index 7f5709d2284..2aa7e7bc011 100644 --- a/meson.build +++ b/meson.build @@ -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 == '' diff --git a/meson_options.txt b/meson_options.txt index 76bdcd454f2..74713614821 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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(