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

Currently vdpau 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 VDPAU works.
Build vdpau driver into libgallium to avoid having two instances of amdgpu
winsys.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31079>
This commit is contained in:
David Rosca 2024-09-10 09:23:03 +02:00 committed by Marge Bot
parent 212d57f7e6
commit b6faf586e6
3 changed files with 35 additions and 9 deletions

View file

@ -212,6 +212,12 @@ if with_gallium_va
subdir('targets/va')
endif
endif
if with_gallium_vdpau
subdir('frontends/vdpau')
if not with_dri
subdir('targets/vdpau')
endif
endif
if with_dri
subdir('frontends/dri')
subdir('targets/dri')
@ -220,10 +226,6 @@ if with_osmesa
subdir('frontends/osmesa')
subdir('targets/osmesa')
endif
if with_gallium_vdpau
subdir('frontends/vdpau')
subdir('targets/vdpau')
endif
if with_gallium_xa
subdir('frontends/xa')
subdir('targets/xa')

View file

@ -71,6 +71,7 @@
@fd_drm_screen_create_renderonly@
@ac_init_shared_llvm_once@
@va_driver_init@
@vdp_imp_device_create_x11@
local:
*;
};

View file

@ -13,10 +13,16 @@ gallium_dri_drivers = []
gallium_dri_link_with = []
gallium_dri_link_whole = []
if with_gallium_va
if with_gallium_va or with_gallium_vdpau
gallium_dri_link_with += [libgalliumvlwinsys]
gallium_dri_link_whole += [libva_st]
sym_config.set('va_driver_init', '__vaDriverInit_*_*;')
if with_gallium_va
gallium_dri_link_whole += [libva_st]
sym_config.set('va_driver_init', '__vaDriverInit_*_*;')
endif
if with_gallium_vdpau
gallium_dri_link_whole += [libvdpau_st]
sym_config.set('vdp_imp_device_create_x11', 'vdp_imp_device_create_x11;')
endif
endif
dri_sym = configure_file(input : 'dri.sym.in', output : 'dri.sym', configuration : sym_config)
@ -64,15 +70,21 @@ libgallium_dri = shared_library(
name_suffix : 'so',
)
if with_gallium_va
if with_gallium_va or with_gallium_vdpau
va_drivers = []
vdpau_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])
if with_gallium_va
va_drivers += '@0@_drv_video.so'.format(d[1])
endif
if with_gallium_vdpau
vdpau_drivers += 'libvdpau_@0@.so.@1@.@2@.0'.format(d[1], VDPAU_MAJOR, VDPAU_MINOR)
endif
endif
endforeach
@ -86,4 +98,15 @@ if with_gallium_va
install_tag : 'runtime',
)
endif
if vdpau_drivers.length() > 0
meson.add_install_script(
install_megadrivers_py.full_path(),
libgallium_dri.full_path(),
vdpau_drivers_path,
vdpau_drivers,
'--megadriver_libdir', get_option('libdir'),
install_tag : 'runtime',
)
endif
endif