mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-07-25 17:11:16 +00:00
Upgraded Mesa from 23.2.1 to 23.3.4
DirectX-headers now built seperately.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Mesa with Xorg
|
||||
# Source: https://archive.mesa3d.org/mesa-23.2.1.tar.xz
|
||||
# Source: https://archive.mesa3d.org/mesa-23.3.4.tar.xz
|
||||
#
|
||||
# $BUILD = Directory to temporarily install
|
||||
# $PKGS = Directory to store built packages
|
||||
@ -11,26 +11,21 @@
|
||||
# Recommended: Libva, libvdpau(for Xorg), wayland-protocols, libglvnd, spirv-headers
|
||||
# Optional: libgcrypt, lm-sensors, nettle, valgrind, libunwind, vulkan-headers (vulkan support/driver)
|
||||
# Optional: vulkan-loader (vulkan support), libclc(vulkan-support), libxcb(for Xorg), libX11(for Xorg)
|
||||
# Optional: libxshmfence(for Xorg), libXxf86vm(for Xorg), libXrandr(for Xorg)
|
||||
# Optional: libxshmfence(for Xorg), libXxf86vm(for Xorg), libXrandr(for Xorg), DirectX-headers
|
||||
|
||||
# As of version 22.x.x, Mesa's classic OpenGL drivers (non-Gallium3D) have been removed. These are the
|
||||
# old Radeon R100 and R200 drivers, the original Nouveau code, and the Intel i915 and i965 drivers.
|
||||
# More info at https://www.phoronix.com/scan.php?page=news_item&px=Mesa-Classic-Retired
|
||||
|
||||
# Apply patches from Chimera Linux
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/001-2d4fe5f229791fde52846b3f583c12508b5109d6.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/002-d6613deed935d097cce796b3f485d07450fad33c.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/003-6388896985da7495ad0968322491953894d29637.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/9590bce3e249a34665b2c42b20bfdbdc7f32147f.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/disable-ppc64-asm.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/fix-meson-build.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/musl-endian.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/musl-stacksize.patch
|
||||
patch -Np1 -i ../patches/mesa-23.2.1-chimera/musl.patch
|
||||
|
||||
# Not sure if "initial-exec TLS" works now with mesa 22.x.x. Enabling for now
|
||||
#patch -Np1 -i ../patches/mesa-alpine-21.2.1/add-use-elf-tls.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/disable-ppc64-asm.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/fix-meson-build.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/musl-endian.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/musl-stacksize.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/musl.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/no-unlink-megadrivers.patch
|
||||
patch -Np1 -i ../patches/mesa-23.3.4-chimera/vec-clang.patch
|
||||
|
||||
# If optimizing, use these flags
|
||||
# LTO is not recommended
|
||||
@ -48,9 +43,6 @@ case $(uname -m) in
|
||||
export V_DRIVERS="swrast" ;;
|
||||
esac
|
||||
|
||||
#export MESA_GIT_SHA1_OVERRIDE=53b2b224dc2de982c37915a0ad218e33365ff75e &&
|
||||
#python3 bin/git_sha1_gen.py --output include/git_sha1.h &&
|
||||
|
||||
# Set configure flags
|
||||
export BUILDOPT="-Dbuildtype=release "
|
||||
export BUILDOPT+="-Dllvm=enabled "
|
||||
@ -72,7 +64,6 @@ export DRVROPT="-Degl-native-platform=wayland "
|
||||
|
||||
export GALLIUMOPT="-Dgallium-va=enabled "
|
||||
export GALLIUMOPT+="-Dgallium-xa=enabled "
|
||||
#export GALLIUMOPT+="-Dgallium-xvmc=true "
|
||||
export GALLIUMOPT+="-Dgallium-nine=true "
|
||||
export GALLIUMOPT+="-Dgallium-vdpau=enabled "
|
||||
|
||||
@ -99,15 +90,18 @@ export V_DRIVERS="swrast,intel"
|
||||
# If glslang is installed, vulkan layers an be built
|
||||
export V_LAYERS="-Dvulkan-layers=device-select,overlay,intel-nullhw "
|
||||
|
||||
meson --prefix=/usr \
|
||||
-Dvulkan-drivers="${V_DRIVERS}" -Dgallium-drivers="${GLL_DRV}" \
|
||||
# If compiling with clang-17, add flag:
|
||||
LDFLAGS="-Wl,--undefined-version" \
|
||||
meson setup --prefix=/usr -Dvulkan-drivers="${V_DRIVERS}" \
|
||||
-Dgallium-drivers="${GLL_DRV}" \
|
||||
-Dplatforms=wayland,x11 -Dtools=glsl \
|
||||
$BUILDOPT $GFXOPT $DRVROPT $GALLIUMOPT $V_LAYERS $XTRA_OPTS OUT
|
||||
|
||||
read -p "Compile?" && ninja -C OUT -j2 &&
|
||||
|
||||
sudo -S DESTDIR=$BUILD ninja -C OUT install &&
|
||||
unset CFLAGS GLL_DRV DRI_DRIVERS MESA_GIT_SHA1_OVERRIDE V_DRIVERS &&
|
||||
unset CFLAGS GLL_DRV V_DRIVERS BUILDOPT
|
||||
unset GFXOPT DRVROPT GALLIUMOPT V_LAYERS XTRA_OPTS &&
|
||||
|
||||
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
|
||||
cat > /tmp/slack-desc << "EOF"
|
||||
@ -132,5 +126,5 @@ mesa:
|
||||
mesa:
|
||||
EOF
|
||||
sudo -S mv -v /tmp/slack-desc install/ &&
|
||||
sudo -S makepkg -l y -c n $PKGS/mesa-23.2.1-$PSUFFIX &&
|
||||
sudo -S makepkg -l y -c n $PKGS/mesa-23.3.4-$PSUFFIX &&
|
||||
sudo -S rm -rf ${BUILD}/*
|
||||
|
@ -0,0 +1,38 @@
|
||||
From d72aa8ae74ffb7329003f9f23ffa05833af951ab Mon Sep 17 00:00:00 2001
|
||||
From: Jon Nettleton <jon@solid-run.com>
|
||||
Date: Fri, 14 Aug 2020 13:36:08 +0200
|
||||
Subject: [PATCH] radeonsi: On Aarch64 force persistent buffers to GTT
|
||||
|
||||
This fixes a glamore corruption issue on the HoneyComb and by
|
||||
internet reports should also fix problems seen on Huaweii
|
||||
Kunpeng hardware.
|
||||
|
||||
The root cause of the corruption needs to be worked out, but
|
||||
this patch also adds a noticable performance improvement. The
|
||||
aquarium webgl demo under chromium increases from 39-49 FPS
|
||||
when 5000 fish being rendered is selected. Glmark scores also
|
||||
improve by ~200 with no specific tests showing any regression.
|
||||
|
||||
Signed-off-by: Jon Nettleton <jon@solid-run.com>
|
||||
---
|
||||
src/gallium/drivers/radeonsi/si_buffer.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c
|
||||
index 6b58aebee2d..c9e983367a0 100644
|
||||
--- a/src/gallium/drivers/radeonsi/si_buffer.c
|
||||
+++ b/src/gallium/drivers/radeonsi/si_buffer.c
|
||||
@@ -151,6 +151,11 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res,
|
||||
*/
|
||||
if (!sscreen->info.kernel_flushes_hdp_before_ib || !sscreen->info.is_amdgpu)
|
||||
res->domains = RADEON_DOMAIN_GTT;
|
||||
+
|
||||
+#if defined(PIPE_ARCH_AARCH64)
|
||||
+ if (size <= 1024 * 1024)
|
||||
+ res->domains = RADEON_DOMAIN_GTT;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Tiled textures are unmappable. Always put them in VRAM. */
|
||||
--
|
||||
2.26.2
|
25
patches/mesa-23.3.4-chimera/disable-ppc64-asm.patch
Normal file
25
patches/mesa-23.3.4-chimera/disable-ppc64-asm.patch
Normal file
@ -0,0 +1,25 @@
|
||||
commit 40a554d5ca9c08a4dd3181bb47339aded5252628
|
||||
Author: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Thu Jan 20 03:32:35 2022 +0100
|
||||
|
||||
disable ppc64le asm
|
||||
|
||||
This is problematic in threaded applications with musl, so
|
||||
just fall back to plain-C version.
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index bd54e78..eafdfad 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1346,11 +1346,6 @@ elif host_machine.cpu_family() == 'sparc64'
|
||||
with_asm_arch = 'sparc'
|
||||
pre_args += ['-DUSE_SPARC_ASM']
|
||||
endif
|
||||
-elif host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little'
|
||||
- if system_has_kms_drm
|
||||
- with_asm_arch = 'ppc64le'
|
||||
- pre_args += ['-DUSE_PPC64LE_ASM']
|
||||
- endif
|
||||
elif host_machine.cpu_family() == 'mips64' and host_machine.endian() == 'little'
|
||||
if system_has_kms_drm
|
||||
with_asm_arch = 'mips64el'
|
28
patches/mesa-23.3.4-chimera/fix-meson-build.patch
Normal file
28
patches/mesa-23.3.4-chimera/fix-meson-build.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
|
||||
index 4bde074..41df740 100644
|
||||
--- a/src/gallium/frontends/rusticl/meson.build
|
||||
+++ b/src/gallium/frontends/rusticl/meson.build
|
||||
@@ -342,6 +342,7 @@ rusticl_proc_macros = shared_library(
|
||||
'rusticl_proc_macros',
|
||||
[rusticl_proc_macros_files],
|
||||
rust_crate_type : 'proc-macro',
|
||||
+ native: true,
|
||||
rust_args : [
|
||||
rusticl_args,
|
||||
],
|
||||
@@ -353,6 +354,7 @@ librusticl = static_library(
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
rust_crate_type : 'staticlib',
|
||||
rust_args : [
|
||||
+ '--extern', 'rusticl_proc_macros=' + meson.current_build_dir() / 'librusticl_proc_macros.so',
|
||||
rusticl_args,
|
||||
],
|
||||
link_with : [
|
||||
@@ -360,7 +362,6 @@ librusticl = static_library(
|
||||
libmesa_rust_gen,
|
||||
libmesa_rust_util,
|
||||
rusticl_opencl_gen,
|
||||
- rusticl_proc_macros,
|
||||
],
|
||||
dependencies : [
|
||||
idep_rusticl_gen,
|
19
patches/mesa-23.3.4-chimera/musl-endian.patch
Normal file
19
patches/mesa-23.3.4-chimera/musl-endian.patch
Normal file
@ -0,0 +1,19 @@
|
||||
--- a/src/util/u_endian.h 2017-12-21 18:31:22.000000000 +0100
|
||||
+++ b/src/util/u_endian.h 2017-12-26 09:22:52.597199480 +0100
|
||||
@@ -68,6 +68,16 @@
|
||||
|
||||
#define PIPE_ARCH_LITTLE_ENDIAN
|
||||
|
||||
+#else
|
||||
+/* Musl libc */
|
||||
+#include <endian.h>
|
||||
+
|
||||
+#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
+# define PIPE_ARCH_LITTLE_ENDIAN
|
||||
+#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
+# define PIPE_ARCH_BIG_ENDIAN
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
|
||||
#endif
|
33
patches/mesa-23.3.4-chimera/musl-stacksize.patch
Normal file
33
patches/mesa-23.3.4-chimera/musl-stacksize.patch
Normal file
@ -0,0 +1,33 @@
|
||||
--- a/src/c11/impl/threads_posix.c
|
||||
+++ b/src/c11/impl/threads_posix.c
|
||||
@@ -255,15 +255,29 @@ static inline int
|
||||
thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
|
||||
{
|
||||
struct impl_thrd_param *pack;
|
||||
+#ifdef __GLIBC__
|
||||
+ pthread_attr_t *attrp = NULL;
|
||||
+#else
|
||||
+ pthread_attr_t attr = { 0 };
|
||||
+ pthread_attr_init(&attr);
|
||||
+ pthread_attr_setstacksize(&attr, 8388608);
|
||||
+ pthread_attr_t *attrp = &attr;
|
||||
+#endif
|
||||
assert(thr != NULL);
|
||||
pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param));
|
||||
if (!pack) return thrd_nomem;
|
||||
pack->func = func;
|
||||
pack->arg = arg;
|
||||
- if (pthread_create(thr, NULL, impl_thrd_routine, pack) != 0) {
|
||||
+ if (pthread_create(thr, attrp, impl_thrd_routine, pack) != 0) {
|
||||
+#ifndef __GLIBC__
|
||||
+ pthread_attr_destroy(&attr);
|
||||
+#endif
|
||||
free(pack);
|
||||
return thrd_error;
|
||||
}
|
||||
+#ifndef __GLIBC__
|
||||
+ pthread_attr_destroy(&attr);
|
||||
+#endif
|
||||
return thrd_success;
|
||||
}
|
||||
|
40
patches/mesa-23.3.4-chimera/musl.patch
Normal file
40
patches/mesa-23.3.4-chimera/musl.patch
Normal file
@ -0,0 +1,40 @@
|
||||
--- a/src/util/rand_xor.c 2020-10-03 12:27:48.489024729 +0200
|
||||
+++ b/src/util/rand_xor.c 2020-10-03 12:31:05.927113521 +0200
|
||||
@@ -28,6 +28,7 @@
|
||||
#if defined(HAVE_GETRANDOM)
|
||||
#include <sys/random.h>
|
||||
#endif
|
||||
+#include <sys/types.h> /* size_t, ssize_t */
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
|
||||
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <amdgpu.h>
|
||||
#include <pthread.h>
|
||||
+#include <sys/types.h>
|
||||
#include "util/list.h"
|
||||
#include "util/rwlock.h"
|
||||
#include "ac_gpu_info.h"
|
||||
--- a/src/gallium/frontends/nine/nine_debug.c 2020-03-06 07:46:48.278918421 +0100
|
||||
+++ b/src/gallium/frontends/nine/nine_debug.c 2020-03-06 07:51:32.919964119 +0100
|
||||
@@ -65,7 +65,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
{
|
||||
static boolean first = TRUE;
|
||||
static unsigned long dbg_flags = DBG_ERROR | DBG_WARN;
|
||||
- unsigned long tid = 0;
|
||||
+ pthread_t tid = 0;
|
||||
|
||||
if (first) {
|
||||
first = FALSE;
|
||||
@@ -74,7 +74,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
|
||||
#if defined(HAVE_PTHREAD)
|
||||
if (dbg_flags & DBG_TID)
|
||||
- tid = (unsigned long)pthread_self();
|
||||
+ tid = pthread_self();
|
||||
#endif
|
||||
|
||||
if (dbg_flags & flag) {
|
25
patches/mesa-23.3.4-chimera/no-unlink-megadrivers.patch
Normal file
25
patches/mesa-23.3.4-chimera/no-unlink-megadrivers.patch
Normal file
@ -0,0 +1,25 @@
|
||||
This converts megadriver installation to use symlinks so that we do
|
||||
not have to deal with skipping the strip stage for some files, as
|
||||
a result simplifying our template greatly.
|
||||
|
||||
--- a/bin/install_megadrivers.py
|
||||
+++ b/bin/install_megadrivers.py
|
||||
@@ -56,7 +56,7 @@ def main():
|
||||
if os.path.lexists(abs_driver):
|
||||
os.unlink(abs_driver)
|
||||
print('installing {} to {}'.format(args.megadriver, abs_driver))
|
||||
- os.link(master, abs_driver)
|
||||
+ os.symlink(os.path.basename(master), abs_driver)
|
||||
|
||||
try:
|
||||
ret = os.getcwd()
|
||||
@@ -71,8 +71,7 @@ def main():
|
||||
finally:
|
||||
os.chdir(ret)
|
||||
|
||||
- # Remove meson-created master .so and symlinks
|
||||
- os.unlink(master)
|
||||
+ # Remove meson-created symlinks
|
||||
name, ext = os.path.splitext(master)
|
||||
while ext != '.so':
|
||||
if os.path.lexists(name):
|
19
patches/mesa-23.3.4-chimera/vec-clang.patch
Normal file
19
patches/mesa-23.3.4-chimera/vec-clang.patch
Normal file
@ -0,0 +1,19 @@
|
||||
commit 22a4067ede3b1c78b4291c3ff96e95a9301646c4
|
||||
Author: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Sun May 21 16:14:06 2023 +0200
|
||||
|
||||
fix power8 intrinsics detection with clang
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 22385d8..3245115 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -709,7 +709,7 @@ if _power8.allowed()
|
||||
int main() {
|
||||
vector unsigned char r;
|
||||
vector unsigned int v = vec_splat_u32 (1);
|
||||
- r = __builtin_vec_vgbbd ((vector unsigned char) v);
|
||||
+ r = __builtin_altivec_vgbbd ((vector unsigned char) v);
|
||||
return 0;
|
||||
}''',
|
||||
args : '-mpower8-vector',
|
Reference in New Issue
Block a user