diff --git a/meson.build b/meson.build index 1f3cb629a91..97c2aec1974 100644 --- a/meson.build +++ b/meson.build @@ -690,13 +690,20 @@ _va_drivers = [ with_gallium_virgl, ] +allow_fallback_for_libva = get_option('allow-fallback-for').contains('libva') +fallback_libva_options = [] _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) +dep_va = dependency( + _dep_va_name, version : '>= 1.8.0', + required : _va, + allow_fallback: allow_fallback_for_libva, + default_options: fallback_libva_options +) if dep_va.found() - dep_va_headers = dep_va.partial_dependency(compile_args : true) + dep_va_headers = dep_va.partial_dependency(compile_args : true, includes : true) if cc.has_header_symbol('va/va.h', 'VASurfaceAttribDRMFormatModifiers', dependencies: dep_va_headers) pre_args += '-DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS' diff --git a/meson.options b/meson.options index 5eed6c62a3d..cf28ff85380 100644 --- a/meson.options +++ b/meson.options @@ -846,7 +846,7 @@ option( type : 'array', value : ['perfetto'], choices : [ - 'libdrm', 'perfetto', + 'libdrm', 'libva', 'perfetto', ], description : 'Allows the fallback mechanism if the dependency is not available on the system, or too old.' ) diff --git a/subprojects/libva.wrap b/subprojects/libva.wrap new file mode 100644 index 00000000000..f8bcd3dfde0 --- /dev/null +++ b/subprojects/libva.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = libva-2.22.0 +source_url = https://github.com/intel/libva/archive/refs/tags/2.22.0.tar.gz +source_filename = 2.22.0.tar.gz +source_hash = 467c418c2640a178c6baad5be2e00d569842123763b80507721ab87eb7af8735 +wrapdb_version = 2.22.0-1 + +[provide] +libva = libva_dep \ No newline at end of file