1
0
forked from rpms/mesa

Compare commits

...

No commits in common. "c9-beta" and "c8" have entirely different histories.
c9-beta ... c8

16 changed files with 627 additions and 980 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/mesa-23.3.3.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 @@
13b0767105f93a5b2d3c2b620e2f3cd7ce67c0f5 SOURCES/mesa-23.3.3.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

@ -1,40 +0,0 @@
From b673271710047acb1976002e4b84d06b7cefd3d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jexposit@redhat.com>
Date: Wed, 17 Jan 2024 13:20:49 +0100
Subject: [PATCH 1/2] Revert "egl: add automatic zink fallback loading between
hw and sw drivers"
This reverts commit 8cd44b8843877a2f7d559d123eb3694841f16fdc.
---
src/egl/main/eglapi.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index d50be23e871..b1a48668b76 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -695,17 +695,10 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (disp->Options.ForceSoftware)
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
else {
- bool success = false;
- if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) {
- disp->Options.Zink = EGL_TRUE;
- success = _eglDriver.Initialize(disp);
- }
- if (!success) {
- disp->Options.Zink = EGL_FALSE;
- disp->Options.ForceSoftware = EGL_TRUE;
- if (!_eglDriver.Initialize(disp))
- RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
- }
+ disp->Options.Zink = EGL_FALSE;
+ disp->Options.ForceSoftware = EGL_TRUE;
+ if (!_eglDriver.Initialize(disp))
+ RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
}
}
--
2.43.0

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

@ -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,103 +0,0 @@
From 9b9d225931b69532aa1b43abdaf29c826bc47b26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jexposit@redhat.com>
Date: Wed, 17 Jan 2024 13:21:08 +0100
Subject: [PATCH 2/2] Revert "glx: add automatic zink fallback loading between
hw and sw drivers"
This reverts commit 7d9ea77b4598e23d4415b529924f1cbdca6e33bd.
---
src/glx/glxext.c | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 39d5f08bdcf..5036fd137c1 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -763,11 +763,10 @@ glx_screen_cleanup(struct glx_screen *psc)
** If that works then fetch the per screen configs data.
*/
static Bool
-AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink)
+AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
{
struct glx_screen *psc;
GLint i, screens;
- unsigned screen_count = 0;
/*
** First allocate memory for the array of per screen configs.
@@ -804,21 +803,17 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink)
if (psc == NULL)
psc = applegl_create_screen(i, priv);
#else
- if (psc == NULL && !zink)
+ if (psc == NULL)
{
psc = indirect_create_screen(i, priv);
indirect = true;
}
#endif
priv->screens[i] = psc;
- if (psc)
- screen_count++;
if(indirect) /* Load extensions required only for indirect glx */
glxSendClientInfo(priv, i);
}
- if (zink && !screen_count)
- return GL_FALSE;
SyncHandle();
return GL_TRUE;
}
@@ -880,9 +875,9 @@ __glXInitialize(Display * dpy)
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
Bool glx_direct = !debug_get_bool_option("LIBGL_ALWAYS_INDIRECT", false);
Bool glx_accel = !debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
+ Bool zink;
const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE");
- Bool zink = env && !strcmp(env, "zink");
- Bool try_zink = False;
+ zink = env && !strcmp(env, "zink");
dpyPriv->drawHash = __glxHashCreate();
@@ -904,13 +899,10 @@ __glXInitialize(Display * dpy)
#endif /* HAVE_DRI3 */
if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
- if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
- try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) &&
- !getenv("GALLIUM_DRIVER");
}
#endif /* GLX_USE_DRM */
if (glx_direct)
- dpyPriv->driswDisplay = driswCreateDisplay(dpy, zink | try_zink);
+ dpyPriv->driswDisplay = driswCreateDisplay(dpy, zink);
#ifdef GLX_USE_WINDOWSGL
if (glx_direct && glx_accel)
@@ -925,18 +917,9 @@ __glXInitialize(Display * dpy)
}
#endif
- if (!AllocAndFetchScreenConfigs(dpy, dpyPriv, zink | try_zink)) {
- Bool fail = True;
- if (try_zink) {
- free(dpyPriv->screens);
- dpyPriv->driswDisplay->destroyDisplay(dpyPriv->driswDisplay);
- dpyPriv->driswDisplay = driswCreateDisplay(dpy, false);
- fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False);
- }
- if (fail) {
- free(dpyPriv);
- return NULL;
- }
+ if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
+ free(dpyPriv);
+ return NULL;
}
glxSendClientInfo(dpyPriv, -1);
--
2.43.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,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

@ -1,42 +0,0 @@
meson: C type error in strtod_l/strtof_l probe
Future compilers will fail compilation due to the C type error:
…/testfile.c: In function 'main':
…/testfile.c:12:30: error: passing argument 2 of 'strtod_l' from incompatible pointer type
12 | double d = strtod_l(s, end, loc);
| ^~~
| |
| char *
/usr/include/stdlib.h:416:43: note: expected 'char ** restrict' but argument is of type 'char *'
416 | char **__restrict __endptr, locale_t __loc)
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
…/testfile.c:13:29: error: passing argument 2 of 'strtof_l' from incompatible pointer type
13 | float f = strtof_l(s, end, loc);
| ^~~
| |
| char *
/usr/include/stdlib.h:420:42: note: expected 'char ** restrict' but argument is of type 'char *'
420 | char **__restrict __endptr, locale_t __loc)
| ~~~~~~~~~~~~~~~~~~^~~~~~~~
This means that the probe no longer tests is objective and always
fails.
Submitted upstream: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26927>
diff --git a/meson.build b/meson.build
index 35cc5f1cd5fd9079..1a5d2ba492be0b31 100644
--- a/meson.build
+++ b/meson.build
@@ -1425,8 +1425,8 @@ if cc.links('''
locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
const char *s = "1.0";
char *end;
- double d = strtod_l(s, end, loc);
- float f = strtof_l(s, end, loc);
+ double d = strtod_l(s, &end, loc);
+ float f = strtof_l(s, &end, loc);
freelocale(loc);
return 0;
}''',

View File

@ -5,7 +5,7 @@ diff -up mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h.dma mesa-22
// DriConf options specific to radeonsi
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
-DRI_CONF_MESA_GLTHREAD_DRIVER(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;
}

View File

@ -1,39 +0,0 @@
From a077c14f150f1c4f670dce381ac2eb548f1a4ac2 Mon Sep 17 00:00:00 2001
From: Alessandro Astone <ales.astone@gmail.com>
Date: Wed, 10 Jan 2024 17:24:30 +0100
Subject: [PATCH] zink: Fix resizable BAR detection logic
This was broken in two ways:
* When looking for the MAX biggest_ram it was actually comparing
a candidate against biggest_vis_ram
* mem_props.memoryTypes[] should be accessed with the memory type
index as found in heap_map
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10341
Cc: 23.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26979>
---
src/gallium/drivers/zink/zink_screen.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 5a6d17cb4fa3..6697d7ab938c 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -3258,10 +3258,10 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
{
uint64_t biggest_vis_vram = 0;
for (unsigned i = 0; i < screen->heap_count[ZINK_HEAP_DEVICE_LOCAL_VISIBLE]; i++)
- biggest_vis_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[i].heapIndex].size);
+ biggest_vis_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[screen->heap_map[ZINK_HEAP_DEVICE_LOCAL_VISIBLE][i]].heapIndex].size);
uint64_t biggest_vram = 0;
for (unsigned i = 0; i < screen->heap_count[ZINK_HEAP_DEVICE_LOCAL]; i++)
- biggest_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[i].heapIndex].size);
+ biggest_vram = MAX2(biggest_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[screen->heap_map[ZINK_HEAP_DEVICE_LOCAL][i]].heapIndex].size);
/* determine if vis vram is roughly equal to total vram */
if (biggest_vis_vram > biggest_vram * 0.9)
screen->resizable_bar = true;
--
GitLab

File diff suppressed because it is too large Load Diff