gallium/va: set up symlinks in build-dir
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Without this libva won't be able to find the driver without
LIBVA_DRIVER_NAME trickery, because the driver has a generic name.
But in the DRI case, even LIBVA_DRIVER_NAME won't do, because the driver
name needs to end with "_drv_video.so", which it doesn't.

So let's instead set up symlinks in the build-dir, like DRIL does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40136>
This commit is contained in:
Erik Faye-Lund 2026-02-27 10:27:37 +01:00 committed by Marge Bot
parent 7e4744909b
commit 608d65db5b
4 changed files with 25 additions and 3 deletions

View file

@ -2099,6 +2099,8 @@ else
prog_flex_cpp = prog_flex
endif
prog_ln = find_program('ln', required : false)
_libunwind = get_option('libunwind') \
.require(not with_platform_android, error_message : 'Android requires the use of the backtrace library, not libunwind')
if host_machine.system() == 'darwin'

View file

@ -75,7 +75,17 @@ if with_gallium_va
[with_gallium_virgl, 'virtio_gpu'],
[with_gallium_d3d12_video, 'd3d12']]
if d[0]
va_drivers += '@0@_drv_video.so'.format(d[1])
name = '@0@_drv_video.so'.format(d[1])
va_drivers += name
if prog_ln.found()
custom_target(
name,
output : name,
command : [prog_ln, '-sf', libgallium_dri.full_path(), '@OUTPUT@'],
build_by_default : true,
)
endif
endif
endforeach

View file

@ -131,7 +131,6 @@ foreach d : [[with_gallium_kmsro, [
endforeach
# This only works on Unix-like oses, which is probably fine for dri
prog_ln = find_program('ln', required : false)
if prog_ln.found()
foreach d : dril_drivers
custom_target(

View file

@ -92,7 +92,18 @@ else
[with_gallium_virgl, 'virtio_gpu'],
[with_gallium_d3d12_video, 'd3d12']]
if d[0]
va_drivers += '@0@_drv_video.so'.format(d[1])
name = '@0@_drv_video.so'.format(d[1])
va_drivers += name
if prog_ln.found()
custom_target(
name,
output : name,
command : [prog_ln, '-sf', libva_gallium.full_path(), '@OUTPUT@'],
build_by_default : true,
)
endif
endif
endforeach