Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/mesa3d-headers/mesa3d-headers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

# Not possible to directly refer to mesa3d variables, because of
# first/second expansion trickery...
MESA3D_HEADERS_VERSION = 26.1.0
MESA3D_HEADERS_VERSION = 26.1.4
MESA3D_HEADERS_SOURCE = mesa-$(MESA3D_HEADERS_VERSION).tar.xz
MESA3D_HEADERS_SITE = https://archive.mesa3d.org
MESA3D_HEADERS_DL_SUBDIR = mesa3d
Expand Down
147 changes: 79 additions & 68 deletions package/mesa3d/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER
bool
select BR2_PACKAGE_MESA3D_DRIVER

config BR2_PACKAGE_MESA3D_VIDEO_CODEC
bool
select BR2_PACKAGE_MESA3D_DRIVER

config BR2_PACKAGE_MESA3D_DRIVER
bool
select BR2_PACKAGE_XLIB_LIBXSHMFENCE if BR2_PACKAGE_XORG7
Expand Down Expand Up @@ -154,6 +150,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO
# the toolchain having sync4 primitives, which is always a given
# for arm/aarch64.
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_LIBDRM_FREEDRENO
select BR2_PACKAGE_MESA3D_OPENGL_EGL # batocera
help
Expand Down Expand Up @@ -201,6 +198,7 @@ comment "llvmpipe driver needs llvm"
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU
bool "Gallium nouveau driver"
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER
select BR2_PACKAGE_LIBDRM_NOUVEAU
select BR2_PACKAGE_LLVM_RTTI if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
Expand Down Expand Up @@ -240,6 +238,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
(BR2_PACKAGE_MESA3D_LLVM && (BR2_TOOLCHAIN_USES_UCLIBC || \
BR2_TOOLCHAIN_USES_GLIBC)) # elfutils
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER
select BR2_PACKAGE_LIBDRM_RADEON
select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
Expand All @@ -257,17 +256,26 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
bool "Gallium Radeon SI driver"
depends on BR2_USE_MMU # libdrm
depends on BR2_i386 || BR2_x86_64
depends on BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_LIBDRM_AMDGPU
select BR2_PACKAGE_LIBDRM_RADEON
select BR2_PACKAGE_LLVM_AMDGPU
select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_ELFUTILS
select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
help
Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.

Since Mesa 26.0.0, the default shader compiler is ACO,
even when LLVM support is enabled at build time.

Use the env var AMD_DEBUG=usellvm to override the
default and use LLVM at runtime.

https://docs.mesa3d.org/envvars.html#envvar-AMD_DEBUG

config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA
bool "Gallium vmware svga driver"
depends on BR2_i386 || BR2_x86_64
Expand Down Expand Up @@ -321,6 +329,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL
bool "Gallium virgl driver"
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER
select BR2_PACKAGE_MESA3D_OPENGL_EGL
help
virgl is the 3D acceleration backend for the virtio-gpu
Expand All @@ -343,6 +352,7 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
select BR2_PACKAGE_LIBDRM_AMDGPU
select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
RADV is a userspace driver that implements the
Expand All @@ -358,6 +368,13 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_BROADCOM
help
Vulkan broadcom driver.

config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO
bool "Vulkan freedreno driver (turnip)"
select BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan freedreno driver.

config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_IMAGINATION
bool "Vulkan imagination driver"
depends on BR2_arm || BR2_aarch64
Expand Down Expand Up @@ -390,13 +407,6 @@ comment "intel vulkan needs a glibc toolchain w/ headers >= 3.17"
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || \
!BR2_TOOLCHAIN_USES_GLIBC

config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_SWRAST
bool "Vulkan swrast driver"
depends on BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan swrast driver.

# batocera
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_HASWELL
Expand Down Expand Up @@ -428,77 +438,48 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_PANFROST
comment "panfrost vulkan needs llvm"
depends on !BR2_PACKAGE_MESA3D_LLVM

# batocera
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO
bool "Freedreno (Turnip) Vulkan driver"
depends on BR2_arm || BR2_aarch64
depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libxshmfence
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_SWRAST
bool "Vulkan swrast driver"
depends on BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan driver for freedreno supported hardware.

comment "freedreno vulkan needs a glibc toolchain w/ headers >= 3.17"
depends on BR2_arm || BR2_aarch64
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || \
!BR2_TOOLCHAIN_USES_GLIBC
Vulkan swrast driver.

config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_VIRTIO
bool "Vulkan VirtIO driver (Venus)"
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan VirtIO (venus) driver.

# batocera - codecs
config BR2_PACKAGE_MESA3D_VIDEO_CODEC_VC1DEC
bool "VC1DEC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
VC1 hardware decoding on supported hardware.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_H264DEC
bool "H264DEC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
H.264 hardware decoding on supported hardware.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_H264ENC
bool "H264ENC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
H.264 hardware encoding on supported hardware.
comment "Host native context drivers"
depends on BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_H265DEC
bool "H265DEC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_AMDGPU
bool "amdgpu-virtio"
depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI || \
BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD
help
H.265 hardware decoding on supported hardware.
Enable VirtIO support for AMDGPU native contexts
used by the radeonsi (OpenGL) and RADV (Vulkan) drivers.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_H265ENC
bool "H265ENC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
H.265 hardware encoding on supported hardware.
Select this when running Mesa inside a virtual machine
with virtio-gpu host native context support.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_AV1DEC
bool "AV1DEC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO
bool "freedreno-virtio"
depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO || \
BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO
help
AV1 hardware decoding on supported hardware.
Enable VirtIO support for freedreno native contexts
used by the freedreno (OpenGL) and Turnip (Vulkan)
drivers.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_AV1ENC
bool "AV1ENC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
AV1 hardware encoding on supported hardware.
Select this when running Mesa inside a virtual machine
with virtio-gpu host native context support.

config BR2_PACKAGE_MESA3D_VIDEO_CODEC_VP9DEC
bool "VP9DEC video codec support"
select BR2_PACKAGE_MESA3D_VIDEO_CODEC
help
VP9 hardware decoding on supported hardware.
config BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_SUPPORTED_DRIVER
bool

if BR2_PACKAGE_MESA3D_DRIVER

Expand Down Expand Up @@ -549,6 +530,36 @@ config BR2_PACKAGE_MESA3D_OPENGL_ES

endif # BR2_PACKAGE_MESA3D_DRIVER

config BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER
bool

config BR2_PACKAGE_MESA3D_GALLIUM_VA
bool "Gallium VA-API"
depends on BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_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 supported gallium driver, incompatible with GLX w/o libglvnd"
depends on !BR2_PACKAGE_MESA3D_GALLIUM_VA_SUPPORTED_DRIVER || \
(BR2_PACKAGE_MESA3D_OPENGL_GLX && !BR2_PACKAGE_LIBGLVND)

config BR2_PACKAGE_MESA3D_PATENTED_VIDEO_CODECS
bool "patented video codecs (H.264, H.265)"
depends on BR2_PACKAGE_MESA3D_GALLIUM_VA || BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Enable patent-encumbered video codec support (H.264, H.265,
VC-1 decode/encode) for Gallium VA-API and/or Vulkan video.

Without this, only royalty-free codecs are supported
(AV1, VP9, MPEG-1/2, JPEG).

comment "patented video codecs need Gallium VA-API or a Vulkan driver"
depends on !BR2_PACKAGE_MESA3D_GALLIUM_VA && \
!BR2_PACKAGE_MESA3D_VULKAN_DRIVER

config BR2_PACKAGE_PROVIDES_LIBGBM
default "mesa3d" if BR2_PACKAGE_MESA3D_GBM

Expand Down
6 changes: 3 additions & 3 deletions package/mesa3d/mesa3d.hash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From https://docs.mesa3d.org/relnotes/26.1.2.html
sha256 bac2bca9121897a2b8162e79636b50ac998fca799c8e6cf914edd85962babdf0 mesa-26.1.2.tar.xz
sha512 08e7b6357c27bf6e13f59e6fb0f84b73ec25c2d1a01cd09ffcc35ab263f278f10f3bd36fde419f60e78e781abcb315a432d0d5ceb3bab0bca26b8a2a39758e03 mesa-26.1.2.tar.xz
# From https://lists.freedesktop.org/archives/mesa-announce/2026-July/000857.html
sha256 072705caa9adf4740f1489194b13e278ad959166863b5271fe423a86353c9ab6 mesa-26.1.4.tar.xz
sha512 39d15574e876005fd1a483d1cb3c801b08297ec73820a89cbf368d0f2a922cc770d0e623e99acc66b71791332cdadc6cc3095f059f713b09128921ff2d0197a8 mesa-26.1.4.tar.xz
# License
sha256 0d1a0472ecc81830e75c20d59b0ea02841e3db21255e0ebad97ab682c54d6615 docs/license.rst
sha256 323c587d0ccf10e376f8bf9a7f31fb4ca6078105194b42e0b1e0ee2bc9bde71f licenses/MIT
Expand Down
60 changes: 33 additions & 27 deletions package/mesa3d/mesa3d.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
################################################################################

# When updating the version, please also update mesa3d-headers
MESA3D_VERSION = 26.1.2
MESA3D_VERSION = 26.1.4
MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
MESA3D_SITE = https://archive.mesa3d.org
MESA3D_LICENSE = MIT, SGI, Khronos
Expand Down Expand Up @@ -71,6 +71,12 @@ MESA3D_CONF_OPTS += \
-Drust_std=2021 \
-Dmesa-clc-bundle-headers=enabled

# meson does not allow ccache
# https://github.com/mesonbuild/meson/commit/aac5f78580a3ea1cf0cae487cb46cab68a048660
MESA3D_CONF_ENV += \
CC_FOR_BUILD="$(HOSTCC_NOCCACHE)" \
CXX_FOR_BUILD="$(HOSTCXX_NOCCACHE)"

MESA3D_MESON_EXTRA_BINARIES += \
rust=['$(HOST_DIR)/bin/rustc','--target=$(RUSTC_TARGET_NAME)'] \
rust_ld='$(TARGET_CROSS)gcc'
Expand Down Expand Up @@ -127,7 +133,7 @@ MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D) += v3d
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4) += vc4
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL) += virgl
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ZINK) += zink
# Vulkan Drivers - # batocera - add freedreno & intel_hasvk
# Vulkan Drivers - # batocera - add intel_hasvk
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD) += amd
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_BROADCOM) += broadcom
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO) += freedreno
Expand All @@ -139,16 +145,6 @@ HOST_MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_PANFROST) += panfr
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_SWRAST) += swrast
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_VIRTIO) += virtio

# batocera - Codecs
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_VC1DEC) += vc1dec
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_H264DEC) += h264dec
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_H264ENC) += h264enc
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_H265DEC) += h265dec
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_H265ENC) += h265enc
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_AV1DEC) += av1dec
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_AV1ENC) += av1enc
MESA3D_VIDEO_CODECS-$(BR2_PACKAGE_MESA3D_VIDEO_CODEC_VP9DEC) += vp9dec

ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
MESA3D_CONF_OPTS += \
-Dgallium-drivers= \
Expand All @@ -163,6 +159,22 @@ ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
MESA3D_DEPENDENCIES += host-python-pycparser
endif

ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_AMDGPU),y)
MESA3D_CONF_OPTS += -Damdgpu-virtio=true
else
MESA3D_CONF_OPTS += -Damdgpu-virtio=false
endif

ifneq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO)$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_FREEDRENO),)
MESA3D_FREEDRENO_KMDS = msm
ifeq ($(BR2_PACKAGE_MESA3D_HOST_NATIVE_CONTEXT_DRIVER_FREEDRENO),y)
MESA3D_FREEDRENO_KMDS += virtio
endif

MESA3D_CONF_OPTS += \
-Dfreedreno-kmds=$(subst $(space),$(comma),$(MESA3D_FREEDRENO_KMDS))
endif

ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL),y)
MESA3D_DEPENDENCIES += host-python-ply
endif
Expand All @@ -188,26 +200,13 @@ MESA3D_CONF_OPTS += -Ddisplay-info=disabled
endif
endif

# batocera - video codecs
ifeq ($(BR2_PACKAGE_MESA3D_VIDEO_CODEC),)
MESA3D_CONF_OPTS += \
-Dvideo-codecs=
else
MESA3D_CONF_OPTS += \
-Dvideo-codecs=$(subst $(space),$(comma),$(MESA3D_VIDEO_CODECS-y))
endif

# APIs

# Always enable OpenGL:
# - 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
# batocera - we enable vaapi acceleration
ifneq ($(BR2_PACKAGE_BATOCERA_TARGET_WSL),y)
ifeq ($(BR2_PACKAGE_LIBVA),y)
ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_VA),y)
MESA3D_CONF_OPTS += -Dgallium-va=enabled
MESA3D_DEPENDENCIES += libva
# batocera - we link vaapi acceleration drivers accordingly
Expand All @@ -222,8 +221,11 @@ MESA3D_POST_INSTALL_TARGET_HOOKS += MESA3D_ADD_VA_LINKS
else
MESA3D_CONF_OPTS += -Dgallium-va=disabled
endif

ifeq ($(BR2_PACKAGE_MESA3D_PATENTED_VIDEO_CODECS),y)
MESA3D_CONF_OPTS += -Dvideo-codecs=all
else
MESA3D_CONF_OPTS += -Dgallium-va=disabled
MESA3D_CONF_OPTS += -Dvideo-codecs=all_free
endif

# libGL is only provided for a full xorg stack, without libglvnd
Expand Down Expand Up @@ -291,6 +293,10 @@ else
MESA3D_CONF_OPTS += -Dvalgrind=disabled
endif

ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y)
MESA3D_DEPENDENCIES += libudev
endif

ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
MESA3D_CONF_OPTS += -Dlibunwind=enabled
MESA3D_DEPENDENCIES += libunwind
Expand Down