targets/va: Build va driver into libgallium when building with dri

Currently va driver and dri driver are two separate libraries, when
radeonsi is enabled both libraries contain amdgpu winsys. radeonsi
needs shared winsys to ensure sync between OpenGL and VAAPI works.
Build va driver into libgallium to avoid having two instances of amdgpu
winsys.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11598
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31079>
This commit is contained in:
David Rosca 2024-09-10 09:22:46 +02:00 committed by Marge Bot
parent 39f7ed5412
commit 212d57f7e6
3 changed files with 46 additions and 11 deletions

View file

@ -201,6 +201,17 @@ if with_gallium_rusticl
subdir('frontends/rusticl')
subdir('targets/rusticl')
endif
if with_glx == 'xlib'
subdir('winsys/sw/xlib')
subdir('frontends/glx/xlib')
subdir('targets/libgl-xlib')
endif
if with_gallium_va
subdir('frontends/va')
if not with_dri
subdir('targets/va')
endif
endif
if with_dri
subdir('frontends/dri')
subdir('targets/dri')
@ -209,19 +220,10 @@ if with_osmesa
subdir('frontends/osmesa')
subdir('targets/osmesa')
endif
if with_glx == 'xlib'
subdir('winsys/sw/xlib')
subdir('frontends/glx/xlib')
subdir('targets/libgl-xlib')
endif
if with_gallium_vdpau
subdir('frontends/vdpau')
subdir('targets/vdpau')
endif
if with_gallium_va
subdir('frontends/va')
subdir('targets/va')
endif
if with_gallium_xa
subdir('frontends/xa')
subdir('targets/xa')

View file

@ -70,6 +70,7 @@
@amdgpu_winsys_create@
@fd_drm_screen_create_renderonly@
@ac_init_shared_llvm_once@
@va_driver_init@
local:
*;
};

View file

@ -10,6 +10,14 @@ gallium_dri_c_args = []
gallium_dri_ld_args = [cc.get_supported_link_arguments('-Wl,--default-symver')]
gallium_dri_link_depends = []
gallium_dri_drivers = []
gallium_dri_link_with = []
gallium_dri_link_whole = []
if with_gallium_va
gallium_dri_link_with += [libgalliumvlwinsys]
gallium_dri_link_whole += [libva_st]
sym_config.set('va_driver_init', '__vaDriverInit_*_*;')
endif
dri_sym = configure_file(input : 'dri.sym.in', output : 'dri.sym', configuration : sym_config)
@ -41,9 +49,9 @@ libgallium_dri = shared_library(
link_with : [
libmesa, libgalliumvl,
libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
libswkmsdri,
libswkmsdri, gallium_dri_link_with
],
link_whole : [libdri],
link_whole : [libdri, gallium_dri_link_whole],
dependencies : [
dep_selinux, dep_libdrm, dep_llvm, dep_thread, idep_xmlconfig, idep_mesautil,
driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
@ -55,3 +63,27 @@ libgallium_dri = shared_library(
install : true,
name_suffix : 'so',
)
if with_gallium_va
va_drivers = []
foreach d : [[with_gallium_r600, 'r600'],
[with_gallium_radeonsi, 'radeonsi'],
[with_gallium_nouveau, 'nouveau'],
[with_gallium_virgl, 'virtio_gpu'],
[with_gallium_d3d12_video, 'd3d12']]
if d[0]
va_drivers += '@0@_drv_video.so'.format(d[1])
endif
endforeach
if va_drivers.length() > 0
meson.add_install_script(
install_megadrivers_py.full_path(),
libgallium_dri.full_path(),
va_drivers_path,
va_drivers,
'--megadriver_libdir', get_option('libdir'),
install_tag : 'runtime',
)
endif
endif