package/mesa3d: add Gallium VA-API support

Since commit 361bfbc70b (package/mesa3d: disable libva support),
VA-API has been unconditionally disabled in mesa3d due to a circular
dependency between mesa3d, libva and libgl.

The circular dependency only occurs when mesa3d is the libgl provider,
i.e. when GLX is enabled without libglvnd. In that case:
  mesa3d -> libva -> libgl -> mesa3d

Re-enable VA-API support as a new BR2_PACKAGE_MESA3D_GALLIUM_VA option,
guarded by a dependency that prevents the circular case. This allows
hardware video acceleration on AMD, Intel and other GPUs with Gallium
drivers.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Thomas Devoogdt
2026-05-17 10:53:40 +02:00
committed by Arnout Vandecappelle
parent b5124a6ab3
commit 460700d38e
2 changed files with 18 additions and 2 deletions

View File

@@ -507,6 +507,19 @@ config BR2_PACKAGE_MESA3D_OPENGL_ES
endif # BR2_PACKAGE_MESA3D_DRIVER
config BR2_PACKAGE_MESA3D_GALLIUM_VA
bool "Gallium VA-API"
depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
# circular dependency: mesa3d -> libva -> libgl -> mesa3d
depends on !BR2_PACKAGE_MESA3D_OPENGL_GLX || BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_LIBVA
help
Enable VA-API video acceleration support in Gallium drivers.
comment "Gallium VA-API needs a gallium driver, incompatible with GLX w/o libglvnd"
depends on !BR2_PACKAGE_MESA3D_GALLIUM_DRIVER || \
(BR2_PACKAGE_MESA3D_OPENGL_GLX && !BR2_PACKAGE_LIBGLVND)
config BR2_PACKAGE_PROVIDES_LIBGBM
default "mesa3d" if BR2_PACKAGE_MESA3D_GBM

View File

@@ -199,9 +199,12 @@ endif
# - Building OpenGL ES without OpenGL is not supported, so always keep opengl enabled.
MESA3D_CONF_OPTS += -Dopengl=true
# libva and mesa3d have a circular dependency
# we do not need libva support in mesa3d, therefore disable this option
ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_VA),y)
MESA3D_CONF_OPTS += -Dgallium-va=enabled
MESA3D_DEPENDENCIES += libva
else
MESA3D_CONF_OPTS += -Dgallium-va=disabled
endif
# libGL is only provided for a full xorg stack, without libglvnd
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y)