Compare commits

...

No commits in common. "imports/c8-beta/mesa-20.1.2-3.el8" and "c8" have entirely different histories.

16 changed files with 410 additions and 10160 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/mesa-20.1.2.tar.xz
SOURCES/dataclasses-0.8.tar.gz
SOURCES/mesa-23.1.4.tar.xz
SOURCES/meson-0.61.4.tar.gz

View File

@ -1 +1,3 @@
b90fe9ca8c3bdad043e86cd1af93bcf83e1da3fb SOURCES/mesa-20.1.2.tar.xz
ef25d3e9e2523805baa314a4adcb915ae901740e SOURCES/dataclasses-0.8.tar.gz
8a48c0e1fbda2c9563ddcf95b05012ab00a8a692 SOURCES/mesa-23.1.4.tar.xz
b0ab169abd8ec87ce773a02b2c7d6a8664b8db00 SOURCES/meson-0.61.4.tar.gz

View File

@ -0,0 +1,127 @@
From 2d4fe5f229791fde52846b3f583c12508b5109d6 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 25 Aug 2023 12:43:44 +1000
Subject: [PATCH] clover/llvm: move to modern pass manager.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This seems like it should work, but I haven't tested it yet.
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
---
.../frontends/clover/llvm/invocation.cpp | 64 +++++++++++++++----
1 file changed, 51 insertions(+), 13 deletions(-)
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
index 7a50fea3323..43d26fe1abb 100644
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
@@ -27,13 +27,17 @@
#include <llvm/IR/DiagnosticPrinter.h>
#include <llvm/IR/DiagnosticInfo.h>
#include <llvm/IR/LLVMContext.h>
+#include <llvm/IR/Module.h>
#include <llvm/Support/raw_ostream.h>
-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
+#include <llvm/Transforms/IPO/Internalize.h>
#include <llvm-c/Target.h>
#ifdef HAVE_CLOVER_SPIRV
#include <LLVMSPIRVLib/LLVMSPIRVLib.h>
#endif
+#include <llvm-c/TargetMachine.h>
+#include <llvm-c/Transforms/PassBuilder.h>
+#include <llvm/Support/CBindingWrapping.h>
#include <clang/CodeGen/CodeGenAction.h>
#include <clang/Lex/PreprocessorOptions.h>
#include <clang/Frontend/TextDiagnosticBuffer.h>
@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
namespace {
void
- optimize(Module &mod, unsigned optimization_level,
+ optimize(Module &mod,
+ const std::string& ir_target,
+ unsigned optimization_level,
bool internalize_symbols) {
- ::llvm::legacy::PassManager pm;
-
// By default, the function internalizer pass will look for a function
// called "main" and then mark all other functions as internal. Marking
// functions as internal enables the optimizer to perform optimizations
@@ -458,19 +462,53 @@ namespace {
if (internalize_symbols) {
std::vector<std::string> names =
map(std::mem_fn(&Function::getName), get_kernels(mod));
- pm.add(::llvm::createInternalizePass(
+ internalizeModule(mod,
[=](const ::llvm::GlobalValue &gv) {
return std::find(names.begin(), names.end(),
gv.getName()) != names.end();
- }));
+ });
}
- ::llvm::PassManagerBuilder pmb;
- pmb.OptLevel = optimization_level;
- pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
- ::llvm::Triple(mod.getTargetTriple()));
- pmb.populateModulePassManager(pm);
- pm.run(mod);
+
+ const char *opt_str = NULL;
+ LLVMCodeGenOptLevel level;
+ switch (optimization_level) {
+ case 0:
+ default:
+ opt_str = "default<O0>";
+ level = LLVMCodeGenLevelNone;
+ break;
+ case 1:
+ opt_str = "default<O1>";
+ level = LLVMCodeGenLevelLess;
+ break;
+ case 2:
+ opt_str = "default<O2>";
+ level = LLVMCodeGenLevelDefault;
+ break;
+ case 3:
+ opt_str = "default<O3>";
+ level = LLVMCodeGenLevelAggressive;
+ break;
+ }
+
+ const target &target = ir_target;
+ LLVMTargetRef targ;
+ char *err_message;
+
+ if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
+ return;
+ LLVMTargetMachineRef tm =
+ LLVMCreateTargetMachine(targ, target.triple.c_str(),
+ target.cpu.c_str(), "", level,
+ LLVMRelocDefault, LLVMCodeModelDefault);
+
+ if (!tm)
+ return;
+ LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
+ LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
+
+ LLVMDisposeTargetMachine(tm);
}
std::unique_ptr<Module>
@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
auto mod = link(*ctx, *c, binaries, r_log);
- optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
+ optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
static std::atomic_uint seq(0);
const std::string id = "." + mod->getModuleIdentifier() + "-" +
--
2.42.0

View File

@ -1,45 +0,0 @@
From fcf3f45728a22250ad15db7e230545147fc28c2e Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 29 Jun 2020 14:59:20 +1000
Subject: [PATCH] gallivm/nir: fix big-endian 64-bit splitting/merging.
The shuffles need to be swapped to do this properly on big-endian
---
src/gallium/auxiliary/gallivm/lp_bld_nir.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index f14475e839d..2c4135ccc05 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -353,8 +353,13 @@ static LLVMValueRef split_64bit(struct lp_build_nir_context *bld_base,
LLVMValueRef shuffles2[LP_MAX_VECTOR_WIDTH/32];
int len = bld_base->base.type.length * 2;
for (unsigned i = 0; i < bld_base->base.type.length; i++) {
+#if UTIL_ARCH_LITTLE_ENDIAN
shuffles[i] = lp_build_const_int32(gallivm, i * 2);
shuffles2[i] = lp_build_const_int32(gallivm, (i * 2) + 1);
+#else
+ shuffles[i] = lp_build_const_int32(gallivm, (i * 2) + 1);
+ shuffles2[i] = lp_build_const_int32(gallivm, (i * 2));
+#endif
}
src = LLVMBuildBitCast(gallivm->builder, src, LLVMVectorType(LLVMInt32TypeInContext(gallivm->context), len), "");
@@ -378,8 +383,13 @@ merge_64bit(struct lp_build_nir_context *bld_base,
assert(len <= (2 * (LP_MAX_VECTOR_WIDTH/32)));
for (i = 0; i < bld_base->base.type.length * 2; i+=2) {
+#if UTIL_ARCH_LITTLE_ENDIAN
shuffles[i] = lp_build_const_int32(gallivm, i / 2);
shuffles[i + 1] = lp_build_const_int32(gallivm, i / 2 + bld_base->base.type.length);
+#else
+ shuffles[i] = lp_build_const_int32(gallivm, i / 2 + bld_base->base.type.length);
+ shuffles[i + 1] = lp_build_const_int32(gallivm, i / 2);
+#endif
}
return LLVMBuildShuffleVector(builder, input, input2, LLVMConstVector(shuffles, len), "");
}
--
2.26.2

View File

@ -1,33 +0,0 @@
From ea7bf3941eeef8320c711a6f66b5e73077cc6e6b Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 29 Jun 2020 07:40:13 +1000
Subject: [PATCH] gallivm/nir: fix const loading on big endian systems
The code was expecting the lower 32-bits of the 64-bit to be
what it wanted, don't be implicit, pull the value from the union.
This should fix rendering on big endian systems since NIR was
introduced.
Fixes: 44a6b0107b37 ("gallivm: add nir->llvm translation (v2)")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
---
src/gallium/auxiliary/gallivm/lp_bld_nir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index 9aa582a0e8a..f14475e839d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -865,7 +865,7 @@ static void visit_load_const(struct lp_build_nir_context *bld_base,
LLVMValueRef result[NIR_MAX_VEC_COMPONENTS];
struct lp_build_context *int_bld = get_int_bld(bld_base, true, instr->def.bit_size);
for (unsigned i = 0; i < instr->def.num_components; i++)
- result[i] = lp_build_const_int_vec(bld_base->base.gallivm, int_bld->type, instr->value[i].u64);
+ result[i] = lp_build_const_int_vec(bld_base->base.gallivm, int_bld->type, instr->def.bit_size == 32 ? instr->value[i].u32 : instr->value[i].u64);
assign_ssa_dest(bld_base, &instr->def, result);
}
--
2.26.2

View File

@ -1,81 +0,0 @@
From 5fc0b580cecb1529659d5d3719412fb7cbffac0d Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 29 Jun 2020 13:26:56 +1000
Subject: [PATCH] glsl: fix constant packing for 64-bit big endian.
In a piglit run on s390 a lot of double tests fail, explicitly
packing/shifting things rather than using memcpy seems to help
---
src/compiler/glsl/ir_constant_expression.cpp | 15 +++++++++++++++
src/compiler/glsl/ir_expression_operation.py | 20 ++++++++++----------
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp
index 636196886b3..595cc821797 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -452,6 +452,21 @@ isub64_saturate(int64_t a, int64_t b)
return a - b;
}
+static uint64_t
+pack_2x32(uint32_t a, uint32_t b)
+{
+ uint64_t v = a;
+ v |= (uint64_t)b << 32;
+ return v;
+}
+
+static void
+unpack_2x32(uint64_t p, uint32_t *a, uint32_t *b)
+{
+ *a = p & 0xffffffff;
+ *b = (p >> 32);
+}
+
/**
* Get the constant that is ultimately referenced by an r-value, in a constant
* expression evaluation context.
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py
index d2c4d41024f..1c4e6b358e1 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -560,14 +560,14 @@ ir_expression_operation = [
operation("saturate", 1, printable_name="sat", source_types=(float_type,), c_expression="CLAMP({src0}, 0.0f, 1.0f)"),
# Double packing, part of ARB_gpu_shader_fp64.
- operation("pack_double_2x32", 1, printable_name="packDouble2x32", source_types=(uint_type,), dest_type=double_type, c_expression="memcpy(&data.d[0], &op[0]->value.u[0], sizeof(double))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("unpack_double_2x32", 1, printable_name="unpackDouble2x32", source_types=(double_type,), dest_type=uint_type, c_expression="memcpy(&data.u[0], &op[0]->value.d[0], sizeof(double))", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("pack_double_2x32", 1, printable_name="packDouble2x32", source_types=(uint_type,), dest_type=double_type, c_expression="data.u64[0] = pack_2x32(op[0]->value.u[0], op[0]->value.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("unpack_double_2x32", 1, printable_name="unpackDouble2x32", source_types=(double_type,), dest_type=uint_type, c_expression="unpack_2x32(op[0]->value.u64[0], &data.u[0], &data.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
# Sampler/Image packing, part of ARB_bindless_texture.
- operation("pack_sampler_2x32", 1, printable_name="packSampler2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="memcpy(&data.u64[0], &op[0]->value.u[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("pack_image_2x32", 1, printable_name="packImage2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="memcpy(&data.u64[0], &op[0]->value.u[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("unpack_sampler_2x32", 1, printable_name="unpackSampler2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="memcpy(&data.u[0], &op[0]->value.u64[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("unpack_image_2x32", 1, printable_name="unpackImage2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="memcpy(&data.u[0], &op[0]->value.u64[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("pack_sampler_2x32", 1, printable_name="packSampler2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="data.u64[0] = pack_2x32(op[0]->value.u[0], op[0]->value.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("pack_image_2x32", 1, printable_name="packImage2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="data.u64[0] = pack_2x32(op[0]->value.u[0], op[0]->value.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("unpack_sampler_2x32", 1, printable_name="unpackSampler2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="unpack_2x32(op[0]->value.u64[0], &data.u[0], &data.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("unpack_image_2x32", 1, printable_name="unpackImage2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="unpack_2x32(op[0]->value.u64[0], &data.u[0], &data.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
operation("frexp_sig", 1),
operation("frexp_exp", 1),
@@ -592,10 +592,10 @@ ir_expression_operation = [
operation("ssbo_unsized_array_length", 1),
# 64-bit integer packing ops.
- operation("pack_int_2x32", 1, printable_name="packInt2x32", source_types=(int_type,), dest_type=int64_type, c_expression="memcpy(&data.i64[0], &op[0]->value.i[0], sizeof(int64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("pack_uint_2x32", 1, printable_name="packUint2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="memcpy(&data.u64[0], &op[0]->value.u[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("unpack_int_2x32", 1, printable_name="unpackInt2x32", source_types=(int64_type,), dest_type=int_type, c_expression="memcpy(&data.i[0], &op[0]->value.i64[0], sizeof(int64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
- operation("unpack_uint_2x32", 1, printable_name="unpackUint2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="memcpy(&data.u[0], &op[0]->value.u64[0], sizeof(uint64_t))", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("pack_int_2x32", 1, printable_name="packInt2x32", source_types=(int_type,), dest_type=int64_type, c_expression="data.u64[0] = pack_2x32(op[0]->value.u[0], op[0]->value.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("pack_uint_2x32", 1, printable_name="packUint2x32", source_types=(uint_type,), dest_type=uint64_type, c_expression="data.u64[0] = pack_2x32(op[0]->value.u[0], op[0]->value.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("unpack_int_2x32", 1, printable_name="unpackInt2x32", source_types=(int64_type,), dest_type=int_type, c_expression="unpack_2x32(op[0]->value.u64[0], &data.u[0], &data.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
+ operation("unpack_uint_2x32", 1, printable_name="unpackUint2x32", source_types=(uint64_type,), dest_type=uint_type, c_expression="unpack_2x32(op[0]->value.u64[0], &data.u[0], &data.u[1])", flags=frozenset((horizontal_operation, non_assign_operation))),
operation("add", 2, printable_name="+", source_types=numeric_types, c_expression="{src0} + {src1}", flags=vector_scalar_operation),
operation("sub", 2, printable_name="-", source_types=numeric_types, c_expression="{src0} - {src1}", flags=vector_scalar_operation),
--
2.26.2

View File

@ -0,0 +1,41 @@
From 9ba416cdc67073cdda9a73fe9d37304b82bdd526 Mon Sep 17 00:00:00 2001
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Date: Fri, 12 May 2023 09:58:26 +0200
Subject: [PATCH] llvmpipe: only include old Transform includes when needed
This fixes building with recent LLVM where these 2 .h files
were removed.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8671
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980>
---
src/gallium/auxiliary/gallivm/lp_bld_init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 24d082398e9..9e0d6a5f643 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -42,14 +42,14 @@
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Analysis.h>
-#include <llvm-c/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR >= 7
-#include <llvm-c/Transforms/Utils.h>
-#endif
#include <llvm-c/BitWriter.h>
#if GALLIVM_USE_NEW_PASS == 1
#include <llvm-c/Transforms/PassBuilder.h>
#elif GALLIVM_HAVE_CORO == 1
+#include <llvm-c/Transforms/Scalar.h>
+#if LLVM_VERSION_MAJOR >= 7
+#include <llvm-c/Transforms/Utils.h>
+#endif
#if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
#include <llvm-c/Transforms/IPO.h>
#endif
--
2.42.0

View File

@ -0,0 +1,28 @@
From 460d2c46a903fed295a1528c8b6273dd6b0e0d19 Mon Sep 17 00:00:00 2001
From: thfrwn <11335318+rfht@users.noreply.github.com>
Date: Fri, 9 Feb 2024 17:00:55 -0500
Subject: [PATCH] mesa: fix off-by-one for newblock allocation in dlist_alloc
Cc: mesa-stable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27556>
---
src/mesa/main/dlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b0184a24e20..9213641699a 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1220,7 +1220,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8)
ctx->ListState.CurrentPos++;
}
- if (ctx->ListState.CurrentPos + numNodes + contNodes > BLOCK_SIZE) {
+ if (ctx->ListState.CurrentPos + numNodes + contNodes >= BLOCK_SIZE) {
/* This block is full. Allocate a new block and chain to it */
Node *newblock;
Node *n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
--
2.45.2

View File

@ -1,34 +0,0 @@
From d3ec950f0d8492b980a91844ffd744d7e7824277 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Sat, 6 Jun 2020 16:58:00 +1000
Subject: [PATCH] nir: use bitfield_insert instead of bfi in
nir_lower_double_ops
NVIDIA hardware doesn't have an equivilant to bfi, but we do already have
a lowering for bitfield_insert->bfi.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5373>
---
src/compiler/nir/nir_lower_double_ops.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c
index f9c93a910a5..73226fd62ef 100644
--- a/src/compiler/nir/nir_lower_double_ops.c
+++ b/src/compiler/nir/nir_lower_double_ops.c
@@ -49,7 +49,9 @@ set_exponent(nir_builder *b, nir_ssa_def *src, nir_ssa_def *exp)
/* The exponent is bits 52-62, or 20-30 of the high word, so set the exponent
* to 1023
*/
- nir_ssa_def *new_hi = nir_bfi(b, nir_imm_int(b, 0x7ff00000), exp, hi);
+ nir_ssa_def *new_hi = nir_bitfield_insert(b, hi, exp,
+ nir_imm_int(b, 20),
+ nir_imm_int(b, 11));
/* recombine */
return nir_pack_64_2x32_split(b, lo, new_hi);
}
--
2.26.2

View File

@ -1,4 +1,4 @@
VERSION ?= 20.1.2
VERSION ?= 23.1.4
SANITIZE ?= 1
DIRNAME = mesa-${VERSION}

12
SOURCES/fix-py-ver.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up mesa-23.1.4/meson.build.dma mesa-23.1.4/meson.build
--- mesa-23.1.4/meson.build.dma 2023-07-28 10:15:41.807945483 +1000
+++ mesa-23.1.4/meson.build 2023-07-28 10:15:46.465030794 +1000
@@ -835,7 +835,7 @@ if get_option('allow-kcmp') \
pre_args += '-DALLOW_KCMP'
endif
-prog_python = import('python').find_installation('python3')
+prog_python = import('python').find_installation('python3.6')
has_mako = run_command(
prog_python, '-c',
'''

View File

@ -0,0 +1,11 @@
diff -up mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf
--- mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma 2022-11-25 10:32:32.175879868 +1000
+++ mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf 2022-11-25 10:32:43.743067470 +1000
@@ -653,6 +653,7 @@ TODO: document the other workarounds.
<application name="gnome-shell" executable="gnome-shell">
<option name="adaptive_sync" value="false" />
<option name="v3d_nonmsaa_texture_size_limit" value="true" />
+ <option name="mesa_glthread" value="false"/>
</application>
<application name="Desktop — Plasma" executable="plasmashell">
<option name="adaptive_sync" value="false" />

View File

@ -0,0 +1,13 @@
diff -up mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.cdma mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.c
--- mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.cdma 2021-11-18 06:16:20.000000000 +1000
+++ mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.c 2021-11-18 07:03:17.652283186 +1000
@@ -213,6 +213,9 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_Creat
if (pAllocator == NULL)
pAllocator = vk_default_allocator();
+ if (!getenv("RH_SW_VULKAN"))
+ return VK_ERROR_INITIALIZATION_FAILED;
+
instance = vk_zalloc(pAllocator, sizeof(*instance), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!instance)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
diff -up mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h.dma mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
--- mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h.dma 2023-01-25 06:17:54.993167334 +1000
+++ mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 2023-01-25 06:17:57.363203425 +1000
@@ -1,7 +1,6 @@
// DriConf options specific to radeonsi
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
-DRI_CONF_MESA_GLTHREAD(true)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG

View File

@ -9,30 +9,26 @@
%endif
%ifarch %{ix86} x86_64
%define platform_drivers ,i965
%define with_vmware 1
%define with_xa 1
%define with_iris 1
%define with_crocus 1
%endif
%ifarch %{ix86} x86_64
%define with_vulkan 1
%define with_vulkan_hw 1
%else
%define with_vulkan 0
%define with_vulkan_hw 0
%endif
%ifarch %{arm} aarch64
%define with_xa 1
%endif
%ifnarch %{x86}
%global with_asm 1
%endif
%global dri_drivers %{?platform_drivers}
%if 0%{?with_vulkan}
%define vulkan_drivers intel,amd
%if 0%{?with_vulkan_hw}
%define vulkan_drivers swrast,intel,intel_hasvk,amd
%else
%define vulkan_drivers swrast
%endif
%global sanitize 0
@ -41,7 +37,7 @@
Name: mesa
Summary: Mesa graphics libraries
Version: 20.1.2
Version: 23.1.4
Release: 3%{?rctag:.%{rctag}}%{?dist}
License: MIT
@ -56,23 +52,31 @@ Source3: Makefile
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
Source4: Mesa-MLAA-License-Clarification-Email.txt
# fix llvmpipe big-endian (#1847064)
Patch1: 0001-gallivm-nir-fix-const-loading-on-big-endian-systems.patch
Patch2: 0001-glsl-fix-constant-packing-for-64-bit-big-endian.patch
Patch3: 0001-gallivm-nir-fix-big-endian-64-bit-splitting-merging.patch
# build our own newer meson
Source5: meson-0.61.4.tar.gz
Source6: dataclasses-0.8.tar.gz
# Add support for TU11x nvidia
Patch10: 0001-nir-use-bitfield_insert-instead-of-bfi-in-nir_lower_.patch
Patch11: nouveau-tu1xx-support.patch
Patch0: lavapipe-disable-env-var.patch
Patch1: fix-py-ver.patch
Patch10: gnome-shell-glthread-disable.patch
Patch12: radeonsi-turn-off-glthread.patch
# Required to build against LLVM 17
Patch13: 0001-llvmpipe-only-include-old-Transform-includes-when-ne.patch
Patch14: 0001-clover-llvm-move-to-modern-pass-manager.patch
# https://issues.redhat.com/browse/RHEL-40566
Patch15: 0001-mesa-fix-off-by-one-for-newblock-allocation-in-dlist.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: meson >= 0.45
BuildRequires: meson
%if %{with_hardware}
BuildRequires: kernel-headers
%endif
BuildRequires: libdrm-devel >= 2.4.42
BuildRequires: libdrm-devel >= 2.4.103
BuildRequires: libXxf86vm-devel
BuildRequires: expat-devel
BuildRequires: xorg-x11-proto-devel
@ -87,6 +91,7 @@ BuildRequires: libxshmfence-devel
BuildRequires: elfutils
BuildRequires: python3-devel
BuildRequires: gettext
BuildRequires: glslang
BuildRequires: %{llvm_pkg_prefix}llvm-devel >= 3.4-7
%if 0%{?with_opencl}
BuildRequires: %{llvm_pkg_prefix}clang-devel >= 3.0
@ -94,7 +99,7 @@ BuildRequires: %{llvm_pkg_prefix}clang-devel >= 3.0
BuildRequires: elfutils-libelf-devel
BuildRequires: libudev-devel
BuildRequires: bison flex
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-client) >= 1.21.0
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(wayland-protocols)
%if 0%{?with_vdpau}
@ -162,6 +167,7 @@ Requires: libglvnd-egl%{?_isa} >= 1:1.2.0-1
Summary: Mesa libEGL development package
Requires: %{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libglvnd-devel%{?_isa} >= 1:1.2.0-1
Requires: libwayland-client >= 1.21.0
Provides: libEGL-devel
Provides: libEGL-devel%{?_isa}
@ -171,6 +177,7 @@ Provides: libEGL-devel%{?_isa}
%package dri-drivers
Summary: Mesa-based DRI drivers
Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libdrm >= 2.4.103
%description dri-drivers
%{summary}.
@ -287,14 +294,15 @@ Requires: %{name}-libd3d%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release
%{summary}.
%endif
%if 0%{?with_vulkan}
%package vulkan-drivers
Summary: Mesa Vulkan drivers
Requires: vulkan%{_isa}
Requires: libwayland-client >= 1.21.0
%description vulkan-drivers
The drivers with support for the Vulkan API.
%if 0%{?with_vulkan_hw}
%package vulkan-devel
Summary: Mesa Vulkan development files
Requires: %{name}-vulkan-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
@ -318,54 +326,77 @@ Headers for development with the Vulkan API.
cp %{SOURCE4} docs/
tar -xvf %{SOURCE5}
tar -xvf %{SOURCE6}
pathfix.py -i %{__python3} -pn bin/*.py src/egl/generate/*.py \
src/gallium/tools/trace/*.py \
src/compiler/glsl/tests/*.py \
src/compiler/glsl/glcpp/tests/*.py
%build
cd meson-0.61.4
%py3_build
%py3_install
cd -
cd dataclasses-0.8
%py3_build
%py3_install
cd -
export ASFLAGS="--generate-missing-build-notes=yes"
%meson -Dcpp_std=gnu++14 \
%global __meson %{buildroot}/usr/bin/meson
export PYTHONPATH=/usr/lib/python3.6/site-packages/:%{buildroot}/usr/lib/python3.6/site-packages/
%meson -Dcpp_std=gnu++17 \
-Db_ndebug=true \
-Dplatforms=x11,wayland,drm,surfaceless \
-Ddri3=true \
-Ddri-drivers=%{?dri_drivers} \
-Dplatforms=x11,wayland \
-Ddri3=enabled \
-Dosmesa=true \
%if 0%{?with_hardware}
-Dgallium-drivers=swrast%{?with_iris:,iris},virgl,nouveau%{?with_vmware:,svga},radeonsi,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro} \
-Dgallium-drivers=swrast%{?with_crocus:,crocus}%{?with_iris:,iris},virgl,nouveau%{?with_vmware:,svga},radeonsi,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro} \
%else
-Dgallium-drivers=swrast,virgl \
%endif
-Dgallium-vdpau=%{?with_vdpau:true}%{!?with_vdpau:false} \
-Dgallium-xvmc=false \
-Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \
-Dgallium-omx=%{?with_omx:bellagio}%{!?with_omx:disabled} \
-Dgallium-va=%{?with_vaapi:true}%{!?with_vaapi:false} \
-Dgallium-xa=%{?with_xa:true}%{!?with_xa:false} \
-Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \
-Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \
-Dvulkan-drivers=%{?vulkan_drivers} \
-Dshared-glapi=true \
-Dgles1=false \
-Dgles2=true \
-Dvulkan-layers=device-select \
-Dshared-glapi=enabled \
-Dgles1=disabled \
-Dgles2=enabled \
-Dopengl=true \
-Dgbm=true \
-Dgbm=enabled \
-Dglx=dri \
-Degl=true \
-Degl=enabled \
-Dglvnd=true \
-Dasm=%{?with_asm:true}%{!?with_asm:false} \
-Dmicrosoft-clc=disabled \
-Dllvm=true \
-Dshared-llvm=true \
-Dvalgrind=%{?with_valgrind:true}%{!?with_valgrind:false} \
-Dbuild-tests=false \
-Dselinux=true \
-Dosmesa=gallium \
-Dvulkan-device-select-layer=true \
-Dlibunwind=disabled \
-Dlmsensors=disabled \
-Dandroid-libbacktrace=disabled \
%{nil}
%meson_build
%install
cd meson-0.61.4
%py3_install
cd -
export PYTHONPATH=%{buildroot}/usr/lib/python3.6/site-packages/
%meson_install
#nuke the meson install bits
rm -rf %{buildroot}/usr/lib/python3.6/
rm -f %{buildroot}/usr/bin/meson
rm -rf %{buildroot}/usr/share/man/
rm -f %{buildroot}/usr/share/polkit-1/actions/com.mesonbuild.install.policy
# libvdpau opens the versioned name, don't bother including the unversioned
rm -vf %{buildroot}%{_libdir}/vdpau/*.so
# likewise glvnd
@ -418,7 +449,7 @@ done
%files libEGL-devel
%dir %{_includedir}/EGL
%{_includedir}/EGL/eglmesaext.h
%{_includedir}/EGL/eglextchromium.h
%{_includedir}/EGL/eglext_angle.h
%post libglapi -p /sbin/ldconfig
%postun libglapi -p /sbin/ldconfig
@ -493,7 +524,7 @@ done
%{_libdir}/dri/r600_dri.so
%{_libdir}/dri/radeonsi_dri.so
%ifarch %{ix86} x86_64
%{_libdir}/dri/i965_dri.so
%{_libdir}/dri/crocus_dri.so
%{_libdir}/dri/iris_dri.so
%endif
%if 0%{?with_vc4}
@ -526,31 +557,117 @@ done
%endif
%if 0%{?with_vdpau}
%files vdpau-drivers
%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
%{_libdir}/vdpau/libvdpau_nouveau.so.1*
%{_libdir}/vdpau/libvdpau_r600.so.1*
%{_libdir}/vdpau/libvdpau_radeonsi.so.1*
%endif
%endif
%if 0%{?with_vulkan}
%files vulkan-drivers
%if 0%{?with_vulkan_hw}
%{_libdir}/libvulkan_intel.so
%{_libdir}/libvulkan_intel_hasvk.so
%{_libdir}/libvulkan_radeon.so
%{_datadir}/drirc.d/00-radv-defaults.conf
%ifarch x86_64
%{_datadir}/vulkan/icd.d/intel_icd.x86_64.json
%{_datadir}/vulkan/icd.d/intel_hasvk_icd.x86_64.json
%{_datadir}/vulkan/icd.d/radeon_icd.x86_64.json
%else
%{_datadir}/vulkan/icd.d/intel_icd.i686.json
%{_datadir}/vulkan/icd.d/intel_hasvk_icd.i686.json
%{_datadir}/vulkan/icd.d/radeon_icd.i686.json
%endif
%endif
%{_libdir}/libvulkan_lvp.so
%{_datadir}/vulkan/icd.d/lvp_icd.*.json
%{_libdir}/libVkLayer_MESA_device_select.so
%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
%if 0%{?with_vulkan_hw}
%files vulkan-devel
%{_includedir}/vulkan/
%endif
%changelog
* Thu Jun 20 2024 José Expósito <jexposit@redhat.com> - 23.1.4-3
- Fix off-by-one error for newblock allocation in dlist_alloc
Resolves: https://issues.redhat.com/browse/RHEL-40566
* Thu Nov 23 2023 José Expósito <jexposit@redhat.com> - 23.1.4-2
- Rebuild against LLVM 17
* Thu Jul 27 2023 Dave Airlie <airlied@redhat.com> - 23.1.4-1
- Update to 23.1.4
* Mon May 22 2023 Dave Airlie <airlied@redhat.com> - 23.1.0-1
- Update to 23.1.0
* Fri Jan 27 2023 Dave Airlie <airlied@redhat.com> - 22.3.0-2
- disable glthread for radeonsi (breaks totem)
* Wed Dec 07 2022 Dave Airlie <airlied@redhat.com> - 22.3.0-1
- Update to 22.3.0 final + fix mit-shm regression
* Fri Nov 25 2022 Dave Airlie <airlied@redhat.com> - 22.3.0-0.4
- Disable glthread for gnome-shell
* Thu Nov 24 2022 Dave Airlie <airlied@redhat.com> - 22.3.0-0.3
- Update to 22.3.0-rc4 + fix wayland dep version
* Wed Nov 23 2022 Dave Airlie <airlied@redhat.com> - 22.3.0-0.2
- Update to 22.3.0-rc3 + fix glthread regression fix
* Fri Nov 11 2022 Dave Airlie <airlied@redhat.com> - 22.3.0-0.1
- Update to 22.3.0-rc2
* Tue Aug 09 2022 Dave Airlie <airlied@redhat.com> - 22.1.5-1
- Update to 22.1.5 - add some crocus and llvmpipe fixes
* Mon Jun 06 2022 Dave Airlie <airlied@redhat.com> - 22.1.1-1
- Update to 22.1.1 - switch to crocus, drop legacy unused i965 driver.
* Tue Jan 25 2022 Dave Airlie <airlied@redhat.com> - 21.3.4-1
- Update to 23.1.4 for gbm and leak fixes, add iris regression fix
* Thu Nov 18 2021 Dave Airlie <airlied@redhat.com> - 21.3.0-1
- rebase to 23.1.0
* Thu Jul 22 2021 Dave Airlie <airlied@redhat.com> - 21.1.5-1
- Fix vulkan sw with wayland, pull in .4 + .5 fixes
* Sat Jun 19 2021 Dave Airlie <airlied@redhat.com> - 21.1.3-1
- rebase to 21.1.3
* Tue Jun 01 2021 Dave Airlie <airlied@redhat.com> - 21.1.1-2
- rebuild against llvm 12
* Thu May 20 2021 Dave Airlie <airlied@redhat.com> - 21.1.1-1
- Update to 21.1.1
* Tue Feb 16 2021 Dave Airlie <airlied@redhat.com> - 20.3.3-1
- Update to 20.3.3 + upstream fixes for qemu regression
* Mon Jan 11 2021 Dave Airlie <airlied@redhat.com> - 20.3.2-1
- Update to 20.3.2 for upstream fixes
* Mon Dec 21 2020 Dave Airlie <airlied@redhat.com> - 20.3.1-1
- Update to 20.3.1 for radeon fix
* Mon Dec 07 2020 Dave Airlie <airlied@redhat.com> - 20.3.0-2
- Fix regression with radeon si/cik cards
* Fri Dec 04 2020 Dave Airlie <airlied@redhat.com> - 20.3.0-1
- Update to 20.3.0 release
* Thu Nov 19 2020 Dave Airlie <airlied@redhat.com> - 20.3.0-0.1.rc2
- Update 20.3.0-rc2
- enable lavapipe behind env var so it can be used for testing
* Wed Aug 05 2020 Dave Airlie <airlied@redhat.com> - 20.1.4-1
- Update to 20.1.4
- Update nouveau tu1xx support patch (Karol)
* Mon Jun 29 2020 Dave Airlie <airlied@redhat.com> - 20.1.2-3
- a fix on top of the big-endian fix (#1847064)