upgrade to mesa-23.3.1

This commit is contained in:
zppzhangpan 2023-12-19 14:35:41 +08:00
parent ce7cf0c06c
commit 497bd3f419
6 changed files with 5 additions and 2633 deletions

View File

@ -1,26 +0,0 @@
From 0ec3bdb2264b491fd3f5dc4e638b4c12611ef219 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 20 Mar 2016 13:27:45 +0100
Subject: [PATCH 3/4] evergreen big endian
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
src/gallium/drivers/r600/r600_state_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index cac240e..4b620a1 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -2716,7 +2716,7 @@ uint32_t r600_translate_colorformat(enum chip_class chip, enum pipe_format forma
uint32_t r600_colorformat_endian_swap(uint32_t colorformat, bool do_endian_swap)
{
- if (R600_BIG_ENDIAN) {
+ if (0 && R600_BIG_ENDIAN) {
switch(colorformat) {
/* 8-bit buffers. */
case V_0280A0_COLOR_4_4:
--
2.7.4

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
From b4cc97ac05b70fa328ad57cf6defee8113666cac Mon Sep 17 00:00:00 2001
From: Alex Fan <alex.fan.q@gmail.com>
Date: Fri, 29 Jul 2022 12:44:14 +1000
Subject: [PATCH] llvmpipe: add riscv support in orcjit
assume cpu supports extension +i,+m,+a,+f,+d,+c
---
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
index 8ea4df7..91dde78 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp
@@ -44,7 +44,7 @@
/* conflict with ObjectLinkingLayer.h */
#include "util/u_memory.h"
-#if (defined(_WIN32) && LLVM_VERSION_MAJOR >= 15)
+#if defined(PIPE_ARCH_RISCV64) || defined(PIPE_ARCH_RISCV32) || (defined(_WIN32) && LLVM_VERSION_MAJOR >= 15)
/* use ObjectLinkingLayer (JITLINK backend) */
#define USE_JITLINK
#endif
@@ -551,6 +551,30 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() {
options.StackAlignmentOverride = 4;
#endif
+#if defined(PIPE_ARCH_RISCV64)
+#if defined(__riscv_float_abi_soft)
+ options.MCOptions.ABIName = "lp64";
+#elif defined(__riscv_float_abi_single)
+ options.MCOptions.ABIName = "lp64f";
+#elif defined(__riscv_float_abi_double)
+ options.MCOptions.ABIName = "lp64d";
+#else
+#error "GALLIVM: unknown target riscv float abi"
+#endif
+#endif
+
+#if defined(PIPE_ARCH_RISCV32)
+#if defined(__riscv_float_abi_soft)
+ options.MCOptions.ABIName = "ilp32";
+#elif defined(__riscv_float_abi_single)
+ options.MCOptions.ABIName = "ilp32f";
+#elif defined(__riscv_float_abi_double)
+ options.MCOptions.ABIName = "ilp32d";
+#else
+#error "GALLIVM: unknown target riscv float abi"
+#endif
+#endif
+
JTMB.setOptions(options);
std::vector<std::string> MAttrs;
@@ -649,6 +673,14 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() {
MAttrs.push_back("+fp64");
#endif
+#if defined(PIPE_ARCH_RISCV64)
+ /* Before riscv is more matured and util_get_cpu_caps() is implemented,
+ * assume this for now since most of linux capable riscv machine are
+ * riscv64gc
+ */
+ MAttrs = {"+m","+c","+a","+d","+f"};
+#endif
+
JTMB.addFeatures(MAttrs);
if (::gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) {
@@ -716,6 +748,30 @@ llvm::orc::JITTargetMachineBuilder LPJit::create_jtdb() {
MCPU = util_get_cpu_caps()->has_msa ? "mips64r5" : "mips64r2";
#endif
+#if defined(PIPE_ARCH_RISCV64)
+ /**
+ * should be fixed with https://reviews.llvm.org/D121149 in llvm 15,
+ * set it anyway for llvm 14
+ */
+ if (MCPU == "generic")
+ MCPU = "generic-rv64";
+
+ JTMB.setCodeModel(CodeModel::Medium);
+ JTMB.setRelocationModel(Reloc::PIC_);
+#endif
+
+#if defined(PIPE_ARCH_RISCV32)
+ /**
+ * should be fixed with https://reviews.llvm.org/D121149 in llvm 15,
+ * set it anyway for llvm 14
+ */
+ if (MCPU == "generic")
+ MCPU = "generic-rv32";
+
+ JTMB.setCodeModel(CodeModel::Medium);
+ JTMB.setRelocationModel(Reloc::PIC_);
+#endif
+
JTMB.setCPU(MCPU);
if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) {
debug_printf("llc -mcpu option: %s\n", MCPU.c_str());
diff --git a/src/util/detect_arch.h b/src/util/detect_arch.h
index 334358f..8c7bd15 100644
--- a/src/util/detect_arch.h
+++ b/src/util/detect_arch.h
@@ -137,4 +137,14 @@
#define DETECT_ARCH_MIPS 0
#endif
+#if defined(__riscv)
+#if __riscv_xlen == 64
+#define PIPE_ARCH_RISCV64
+#elif __riscv_xlen == 32
+#define PIPE_ARCH_RISCV32
+#else
+#error "pipe: unknown target riscv xlen"
+#endif
+#endif
+
#endif /* UTIL_DETECT_ARCH_H_ */

View File

@ -1,23 +0,0 @@
From 3148f08bd0207a8bd50ff5c8b82d7a5b0871c3d1 Mon Sep 17 00:00:00 2001
From: Alex Fan <alex.fan.q@gmail.com>
Date: Mon, 28 Nov 2022 22:29:44 +1100
Subject: [PATCH] llvmpipe: make unnamed global have internal linkage
work around bug https://github.com/llvm/llvm-project/issues/54813
Being unnamed makes it not useable from other module, therefore
changing to internal linkage is safe
Signed-off-by: Alex Fan <alex.fan.q@gmail.com>
---
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 4e0b693..5b29610 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -3320,6 +3320,7 @@ generate_fragment(struct llvmpipe_context *lp,
LLVMValueRef glob_sample_pos =
LLVMAddGlobal(gallivm->module,
LLVMArrayType(flt_type, key->coverage_samples * 2), "");
+ LLVMSetLinkage(glob_sample_pos, LLVMInternalLinkage);
LLVMValueRef sample_pos_array;
if (key->multisample && key->coverage_samples == 4) {

View File

@ -51,7 +51,7 @@
Name: mesa
Summary: Mesa graphics libraries
Version: 23.2.1
Version: 23.3.1
Release: 1
License: MIT
@ -59,10 +59,6 @@ URL: http://www.mesa3d.org
Source0: https://mesa.freedesktop.org/archive/%{name}-%{version}.tar.xz
Patch1: backport-fix-build-err-on-arm.patch
Patch2: 0001-evergreen-big-endian.patch
Patch3: llvmpipe-add-an-implementation-with-llvm-orcjit.patch
Patch4: llvmpipe-add-riscv-support-in-orcjit.patch
Patch5: llvmpipe-make-unnamed-global-have-internal-linkage.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -494,6 +490,7 @@ done
%if 0%{?with_kmsro}
%{_libdir}/dri/armada-drm_dri.so
%{_libdir}/dri/exynos_dri.so
%{_libdir}/dri/hdlcd_dri.so
%{_libdir}/dri/hx8357d_dri.so
%{_libdir}/dri/ili9225_dri.so
%{_libdir}/dri/ili9341_dri.so
@ -571,6 +568,9 @@ done
%endif
%changelog
* Tue Dec 19 2023 zhangpan <zhangpan103@h-partners.com> - 23.3.1-1
- upgrade to mesa-23.3.1
* Thu Nov 02 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 23.2.1-1
- upgrade to version 23.2.1
- fix llvmpipe interface support for the new version