Compare commits
No commits in common. "imports/c9/mesa-22.1.5-2.el9" and "c8" have entirely different histories.
imports/c9
...
c8
|
@ -1 +1,3 @@
|
|||
SOURCES/mesa-22.1.5.tar.xz
|
||||
SOURCES/dataclasses-0.8.tar.gz
|
||||
SOURCES/mesa-23.1.4.tar.xz
|
||||
SOURCES/meson-0.61.4.tar.gz
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
d2e6d071e560c0f92a519a7c4b38d4c43f6dae19 SOURCES/mesa-22.1.5.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
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From 0db29ee48d4f4fd0858bcf7def39926e2ee19d63 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Airlie <airlied@redhat.com>
|
||||
Date: Thu, 1 Sep 2022 11:37:27 +1000
|
||||
Subject: [PATCH] llvmpipe: finish rendering before flushing frontbuffer
|
||||
resources.
|
||||
|
||||
Fixes misrendering on front with mesa demos
|
||||
---
|
||||
src/gallium/drivers/llvmpipe/lp_screen.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
index 333d7695ee7..0fcbcccedd2 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "lp_limits.h"
|
||||
#include "lp_rast.h"
|
||||
#include "lp_cs_tpool.h"
|
||||
+#include "lp_flush.h"
|
||||
|
||||
#include "frontend/sw_winsys.h"
|
||||
|
||||
@@ -835,8 +836,11 @@ llvmpipe_flush_frontbuffer(struct pipe_screen *_screen,
|
||||
struct llvmpipe_resource *texture = llvmpipe_resource(resource);
|
||||
|
||||
assert(texture->dt);
|
||||
- if (texture->dt)
|
||||
+
|
||||
+ if (texture->dt) {
|
||||
+ llvmpipe_flush_resource(_pipe, resource, 0, true, true, false, "frontbuffer");
|
||||
winsys->displaytarget_display(winsys, texture->dt, context_private, sub_box);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
From 64e7c42f1b68250d2280320e01da2f5a0c4b07eb Mon Sep 17 00:00:00 2001
|
||||
From: Dave Airlie <airlied@redhat.com>
|
||||
Date: Fri, 22 Jul 2022 11:12:58 +1000
|
||||
Subject: [PATCH 1/2] llvmpipe: make last_fence a screen/rast object not a
|
||||
context one.
|
||||
|
||||
When a flush happens the per-context setup is used to hold the fence
|
||||
for the last scene sent to the rasterizer. However when multiple
|
||||
contexts are in use, this fence won't get returned to be blocked on.
|
||||
|
||||
Instead move the last fence to the rasterizer object, and return
|
||||
that instead as it should be valid across contexts.
|
||||
|
||||
Fixes gtk4 bugs on llvmpipe since overlapping vertex/fragment.
|
||||
|
||||
Fixes: 6bbbe15a783a ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
|
||||
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
|
||||
---
|
||||
src/gallium/drivers/llvmpipe/lp_flush.c | 12 ++++++---
|
||||
src/gallium/drivers/llvmpipe/lp_rast.c | 14 +++++++++-
|
||||
src/gallium/drivers/llvmpipe/lp_rast.h | 3 ++-
|
||||
src/gallium/drivers/llvmpipe/lp_rast_priv.h | 2 ++
|
||||
src/gallium/drivers/llvmpipe/lp_setup.c | 26 +++++--------------
|
||||
src/gallium/drivers/llvmpipe/lp_setup.h | 1 -
|
||||
.../drivers/llvmpipe/lp_setup_context.h | 1 -
|
||||
7 files changed, 33 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
index c231f334eaf..c72944232e7 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
@@ -38,7 +38,9 @@
|
||||
#include "lp_flush.h"
|
||||
#include "lp_context.h"
|
||||
#include "lp_setup.h"
|
||||
-
|
||||
+#include "lp_fence.h"
|
||||
+#include "lp_screen.h"
|
||||
+#include "lp_rast.h"
|
||||
|
||||
/**
|
||||
* \param fence if non-null, returns pointer to a fence which can be waited on
|
||||
@@ -49,11 +51,15 @@ llvmpipe_flush( struct pipe_context *pipe,
|
||||
const char *reason)
|
||||
{
|
||||
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
|
||||
-
|
||||
+ struct llvmpipe_screen *screen = llvmpipe_screen(pipe->screen);
|
||||
draw_flush(llvmpipe->draw);
|
||||
|
||||
/* ask the setup module to flush */
|
||||
- lp_setup_flush(llvmpipe->setup, fence, reason);
|
||||
+ lp_setup_flush(llvmpipe->setup, reason);
|
||||
+
|
||||
+ lp_rast_fence(screen->rast, (struct lp_fence **)fence);
|
||||
+ if (fence && (!*fence))
|
||||
+ *fence = (struct pipe_fence_handle *)lp_fence_create(0);
|
||||
|
||||
/* Enable to dump BMPs of the color/depth buffers each frame */
|
||||
if (0) {
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
|
||||
index e27d78a3432..6cdaa51b62d 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "gallivm/lp_bld_format.h"
|
||||
#include "gallivm/lp_bld_debug.h"
|
||||
#include "lp_scene.h"
|
||||
+#include "lp_screen.h"
|
||||
#include "lp_tex_sample.h"
|
||||
|
||||
|
||||
@@ -1128,6 +1129,10 @@ lp_rast_queue_scene( struct lp_rasterizer *rast,
|
||||
{
|
||||
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
|
||||
|
||||
+ lp_fence_reference(&rast->last_fence, scene->fence);
|
||||
+ if (rast->last_fence)
|
||||
+ rast->last_fence->issued = TRUE;
|
||||
+
|
||||
if (rast->num_threads == 0) {
|
||||
/* no threading */
|
||||
unsigned fpstate = util_fpstate_get();
|
||||
@@ -1384,6 +1389,8 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
|
||||
align_free(rast->tasks[i].thread_data.cache);
|
||||
}
|
||||
|
||||
+ lp_fence_reference(&rast->last_fence, NULL);
|
||||
+
|
||||
/* for synchronizing rasterization threads */
|
||||
if (rast->num_threads > 0) {
|
||||
util_barrier_destroy( &rast->barrier );
|
||||
@@ -1394,4 +1401,9 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
|
||||
FREE(rast);
|
||||
}
|
||||
|
||||
-
|
||||
+void lp_rast_fence(struct lp_rasterizer *rast,
|
||||
+ struct lp_fence **fence)
|
||||
+{
|
||||
+ if (fence)
|
||||
+ lp_fence_reference((struct lp_fence **)fence, rast->last_fence);
|
||||
+}
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h
|
||||
index 14a2710f7f5..1756345737f 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_rast.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_rast.h
|
||||
@@ -388,5 +388,6 @@ lp_debug_draw_bins_by_cmd_length( struct lp_scene *scene );
|
||||
void
|
||||
lp_debug_draw_bins_by_coverage( struct lp_scene *scene );
|
||||
|
||||
-
|
||||
+void lp_rast_fence(struct lp_rasterizer *rast,
|
||||
+ struct lp_fence **fence);
|
||||
#endif
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
|
||||
index c4da9cca2ff..8b28893aa22 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
|
||||
@@ -129,6 +129,8 @@ struct lp_rasterizer
|
||||
|
||||
/** For synchronizing the rasterization threads */
|
||||
util_barrier barrier;
|
||||
+
|
||||
+ struct lp_fence *last_fence;
|
||||
};
|
||||
|
||||
void
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
|
||||
index ce681792683..ad92e2557c2 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
|
||||
@@ -207,11 +207,6 @@ lp_setup_rasterize_scene( struct lp_setup_context *setup )
|
||||
|
||||
lp_scene_end_binning(scene);
|
||||
|
||||
- lp_fence_reference(&setup->last_fence, scene->fence);
|
||||
-
|
||||
- if (setup->last_fence)
|
||||
- setup->last_fence->issued = TRUE;
|
||||
-
|
||||
mtx_lock(&screen->rast_mutex);
|
||||
lp_rast_queue_scene(screen->rast, scene);
|
||||
mtx_unlock(&screen->rast_mutex);
|
||||
@@ -387,17 +382,10 @@ fail:
|
||||
|
||||
|
||||
void
|
||||
-lp_setup_flush( struct lp_setup_context *setup,
|
||||
- struct pipe_fence_handle **fence,
|
||||
- const char *reason)
|
||||
+lp_setup_flush(struct lp_setup_context *setup,
|
||||
+ const char *reason)
|
||||
{
|
||||
- set_scene_state( setup, SETUP_FLUSHED, reason );
|
||||
-
|
||||
- if (fence) {
|
||||
- lp_fence_reference((struct lp_fence **)fence, setup->last_fence);
|
||||
- if (!*fence)
|
||||
- *fence = (struct pipe_fence_handle *)lp_fence_create(0);
|
||||
- }
|
||||
+ set_scene_state(setup, SETUP_FLUSHED, reason);
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +559,7 @@ lp_setup_clear( struct lp_setup_context *setup,
|
||||
if (flags & PIPE_CLEAR_DEPTHSTENCIL) {
|
||||
unsigned flagszs = flags & PIPE_CLEAR_DEPTHSTENCIL;
|
||||
if (!lp_setup_try_clear_zs(setup, depth, stencil, flagszs)) {
|
||||
- lp_setup_flush(setup, NULL, __FUNCTION__);
|
||||
+ set_scene_state( setup, SETUP_FLUSHED, __FUNCTION__ );
|
||||
|
||||
if (!lp_setup_try_clear_zs(setup, depth, stencil, flagszs))
|
||||
assert(0);
|
||||
@@ -583,7 +571,7 @@ lp_setup_clear( struct lp_setup_context *setup,
|
||||
for (i = 0; i < setup->fb.nr_cbufs; i++) {
|
||||
if ((flags & (1 << (2 + i))) && setup->fb.cbufs[i]) {
|
||||
if (!lp_setup_try_clear_color_buffer(setup, color, i)) {
|
||||
- lp_setup_flush(setup, NULL, __FUNCTION__);
|
||||
+ set_scene_state( setup, SETUP_FLUSHED, __FUNCTION__ );
|
||||
|
||||
if (!lp_setup_try_clear_color_buffer(setup, color, i))
|
||||
assert(0);
|
||||
@@ -1589,7 +1577,6 @@ lp_setup_destroy( struct lp_setup_context *setup )
|
||||
|
||||
LP_DBG(DEBUG_SETUP, "number of scenes used: %d\n", setup->num_active_scenes);
|
||||
slab_destroy(&setup->scene_slab);
|
||||
- lp_fence_reference(&setup->last_fence, NULL);
|
||||
|
||||
FREE( setup );
|
||||
}
|
||||
@@ -1758,7 +1745,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
|
||||
}
|
||||
}
|
||||
else {
|
||||
- lp_fence_reference(&pq->fence, setup->last_fence);
|
||||
+ struct llvmpipe_screen *screen = llvmpipe_screen(setup->pipe->screen);
|
||||
+ lp_rast_fence(screen->rast, &pq->fence);
|
||||
}
|
||||
|
||||
fail:
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h
|
||||
index 5ecef123417..fe360be63ca 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_setup.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_setup.h
|
||||
@@ -64,7 +64,6 @@ lp_setup_clear(struct lp_setup_context *setup,
|
||||
|
||||
void
|
||||
lp_setup_flush( struct lp_setup_context *setup,
|
||||
- struct pipe_fence_handle **fence,
|
||||
const char *reason);
|
||||
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h
|
||||
index 420b78e2f52..fac84fb56ec 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
|
||||
@@ -96,7 +96,6 @@ struct lp_setup_context
|
||||
struct lp_scene *scenes[MAX_SCENES]; /**< all the scenes */
|
||||
struct lp_scene *scene; /**< current scene being built */
|
||||
|
||||
- struct lp_fence *last_fence;
|
||||
struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES];
|
||||
unsigned active_binned_queries;
|
||||
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -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
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
From af0e5160c4d81beed879b4669b7f3bb875056d1e Mon Sep 17 00:00:00 2001
|
||||
From: Dave Airlie <airlied@redhat.com>
|
||||
Date: Mon, 25 Jul 2022 13:28:08 +1000
|
||||
Subject: [PATCH 2/2] llvmpipe: keep context list and use to track resource
|
||||
usage.
|
||||
|
||||
Just check across all contexts if a resource is referenced.
|
||||
|
||||
Fixes: 6bbbe15a783a ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
|
||||
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17702>
|
||||
---
|
||||
src/gallium/drivers/llvmpipe/lp_context.c | 12 ++++++++++--
|
||||
src/gallium/drivers/llvmpipe/lp_context.h | 2 ++
|
||||
src/gallium/drivers/llvmpipe/lp_flush.c | 10 ++++++----
|
||||
src/gallium/drivers/llvmpipe/lp_screen.c | 2 ++
|
||||
src/gallium/drivers/llvmpipe/lp_screen.h | 4 ++++
|
||||
5 files changed, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
|
||||
index 8038e219015..3cce460f213 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_context.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
|
||||
@@ -57,8 +57,12 @@
|
||||
static void llvmpipe_destroy( struct pipe_context *pipe )
|
||||
{
|
||||
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
|
||||
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(pipe->screen);
|
||||
uint i;
|
||||
|
||||
+ mtx_lock(&lp_screen->ctx_mutex);
|
||||
+ list_del(&llvmpipe->list);
|
||||
+ mtx_unlock(&lp_screen->ctx_mutex);
|
||||
lp_print_counters();
|
||||
|
||||
if (llvmpipe->csctx) {
|
||||
@@ -189,8 +193,9 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
|
||||
unsigned flags)
|
||||
{
|
||||
struct llvmpipe_context *llvmpipe;
|
||||
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(screen);
|
||||
|
||||
- if (!llvmpipe_screen_late_init(llvmpipe_screen(screen)))
|
||||
+ if (!llvmpipe_screen_late_init(lp_screen))
|
||||
return NULL;
|
||||
|
||||
llvmpipe = align_malloc(sizeof(struct llvmpipe_context), 16);
|
||||
@@ -254,7 +259,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
|
||||
goto fail;
|
||||
|
||||
draw_set_disk_cache_callbacks(llvmpipe->draw,
|
||||
- llvmpipe_screen(screen),
|
||||
+ lp_screen,
|
||||
lp_draw_disk_cache_find_shader,
|
||||
lp_draw_disk_cache_insert_shader);
|
||||
|
||||
@@ -307,6 +312,9 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
|
||||
*/
|
||||
llvmpipe->dirty |= LP_NEW_SCISSOR;
|
||||
|
||||
+ mtx_lock(&lp_screen->ctx_mutex);
|
||||
+ list_addtail(&llvmpipe->list, &lp_screen->ctx_list);
|
||||
+ mtx_unlock(&lp_screen->ctx_mutex);
|
||||
return &llvmpipe->pipe;
|
||||
|
||||
fail:
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
|
||||
index 1cabf98177f..f6b7719c6de 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_context.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "draw/draw_vertex.h"
|
||||
#include "util/u_blitter.h"
|
||||
+#include "util/list.h"
|
||||
|
||||
#include "lp_tex_sample.h"
|
||||
#include "lp_jit.h"
|
||||
@@ -58,6 +59,7 @@ struct lp_velems_state;
|
||||
struct llvmpipe_context {
|
||||
struct pipe_context pipe; /**< base class */
|
||||
|
||||
+ struct list_head list;
|
||||
/** Constant state objects */
|
||||
const struct pipe_blend_state *blend;
|
||||
struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
index c72944232e7..c49836432a9 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
|
||||
@@ -111,10 +111,12 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
|
||||
boolean do_not_block,
|
||||
const char *reason)
|
||||
{
|
||||
- unsigned referenced;
|
||||
-
|
||||
- referenced = llvmpipe_is_resource_referenced(pipe, resource, level);
|
||||
-
|
||||
+ unsigned referenced = 0;
|
||||
+ struct llvmpipe_screen *lp_screen = llvmpipe_screen(pipe->screen);
|
||||
+ mtx_lock(&lp_screen->ctx_mutex);
|
||||
+ list_for_each_entry(struct llvmpipe_context, ctx, &lp_screen->ctx_list, list)
|
||||
+ referenced |= llvmpipe_is_resource_referenced((struct pipe_context *)ctx, resource, level);
|
||||
+ mtx_unlock(&lp_screen->ctx_mutex);
|
||||
if ((referenced & LP_REFERENCED_FOR_WRITE) ||
|
||||
((referenced & LP_REFERENCED_FOR_READ) && !read_only)) {
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
index 359c200279f..9c67d874c5f 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
|
||||
@@ -1085,6 +1085,8 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
|
||||
|
||||
snprintf(screen->renderer_string, sizeof(screen->renderer_string), "llvmpipe (LLVM " MESA_LLVM_VERSION_STRING ", %u bits)", lp_native_vector_width );
|
||||
|
||||
+ list_inithead(&screen->ctx_list);
|
||||
+ (void) mtx_init(&screen->ctx_mutex, mtx_plain);
|
||||
(void) mtx_init(&screen->cs_mutex, mtx_plain);
|
||||
(void) mtx_init(&screen->rast_mutex, mtx_plain);
|
||||
|
||||
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h
|
||||
index c72bf838acb..18635c687bc 100644
|
||||
--- a/src/gallium/drivers/llvmpipe/lp_screen.h
|
||||
+++ b/src/gallium/drivers/llvmpipe/lp_screen.h
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "os/os_thread.h"
|
||||
+#include "util/list.h"
|
||||
#include "gallivm/lp_bld.h"
|
||||
#include "gallivm/lp_bld_misc.h"
|
||||
|
||||
@@ -67,6 +68,9 @@ struct llvmpipe_screen
|
||||
mtx_t late_mutex;
|
||||
bool late_init_done;
|
||||
|
||||
+ mtx_t ctx_mutex;
|
||||
+ struct list_head ctx_list;
|
||||
+
|
||||
char renderer_string[100];
|
||||
|
||||
struct disk_cache *disk_shader_cache;
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -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}
|
|
@ -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',
|
||||
'''
|
|
@ -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" />
|
|
@ -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)
|
|
@ -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
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
1058
SPECS/mesa.spec
1058
SPECS/mesa.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue