Compare commits

...

No commits in common. "imports/c9-beta/mesa-21.3.4-2.el9" and "c8" have entirely different histories.

13 changed files with 622 additions and 762 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/mesa-21.3.4.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 @@
80187e8dd7701a931676058ce456de008fdcaf8c SOURCES/mesa-21.3.4.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,58 +0,0 @@
From 07dc3d4238e57901ccf98e0b506d9aad2c86b9d9 Mon Sep 17 00:00:00 2001
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date: Mon, 10 Jan 2022 17:18:05 -0800
Subject: [PATCH] iris: implement inter-context busy-tracking
Previously, no buffers were ever marked as EXEC_OBJECT_ASYNC so the
Kernel would ensure dependency tracking for us. After we implemented
explicit busy tracking in commit 89a34cb8450a, only the external
objects kept relying on the Kernel's implicit tracking and Iris did
inter-batch busy tracking, meaning we lost inter-screen and
inter-context synchronization. This seemed fine to me since, as far as
I understood, it is the duty of the application to synchronize itself
against multiple screens and contexts.
The problem here is that applications were actually relying on the old
behavior where the Kernel guarantees synchronization, so 89a34cb8450a
can be seen as a regression. This commit addresses the inter-context
synchronization case.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5731
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5812
Fixes: 89a34cb8450a ("iris: switch to explicit busy tracking")
Tested-by: Konstantin Kharlamov <hi-angel@yandex.ru>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
src/gallium/drivers/iris/iris_batch.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index b7bde60aae7..1b0c5896d4f 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -835,6 +835,12 @@ update_bo_syncobjs(struct iris_batch *batch, struct iris_bo *bo, bool write)
move_syncobj_to_batch(batch, &deps->write_syncobjs[other_batch_idx],
I915_EXEC_FENCE_WAIT);
+ /* If it's being written by our screen, wait on it too. This is relevant
+ * when there are multiple contexts on the same screen. */
+ if (deps->write_syncobjs[batch_idx])
+ move_syncobj_to_batch(batch, &deps->write_syncobjs[batch_idx],
+ I915_EXEC_FENCE_WAIT);
+
struct iris_syncobj *batch_syncobj = iris_batch_get_signal_syncobj(batch);
if (write) {
@@ -847,6 +853,8 @@ update_bo_syncobjs(struct iris_batch *batch, struct iris_bo *bo, bool write)
move_syncobj_to_batch(batch, &deps->read_syncobjs[other_batch_idx],
I915_EXEC_FENCE_WAIT);
+ move_syncobj_to_batch(batch, &deps->read_syncobjs[batch_idx],
+ I915_EXEC_FENCE_WAIT);
} else {
/* If we're reading, replace the other read from our batch index. */
--
GitLab

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

23
SOURCES/Makefile Normal file
View File

@ -0,0 +1,23 @@
VERSION ?= 23.1.4
SANITIZE ?= 1
DIRNAME = mesa-${VERSION}
all: archive
clean:
rm -rf $(DIRNAME)/
rm -f mesa-${VERSION}.tar.xz
clone: clean
curl -O https://archive.mesa3d.org/mesa-${VERSION}.tar.xz
tar xf mesa-${VERSION}.tar.xz
sanitize: clone vl_mpeg12_decoder.c vl_decoder.c
ifdef SANITIZE
cat < vl_mpeg12_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
cat < vl_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_decoder.c
endif
archive: clone sanitize
tar caf ${DIRNAME}.tar.xz ${DIRNAME}

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)

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

20
SOURCES/vl_decoder.c Normal file
View File

@ -0,0 +1,20 @@
#include "vl_decoder.h"
bool
vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile,
enum pipe_video_entrypoint entrypoint)
{
return false;
}
int
vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile)
{
return 0;
}
struct pipe_video_codec *
vl_create_decoder(struct pipe_context *pipe,
const struct pipe_video_codec *templat)
{
return NULL;
}

View File

@ -0,0 +1,7 @@
#include "vl_mpeg12_decoder.h"
struct pipe_video_codec *
vl_create_mpeg12_decoder(struct pipe_context *context,
const struct pipe_video_codec *templat)
{
return NULL;
}

File diff suppressed because it is too large Load Diff