From 8812f3f6a1a0987f03dec063f7eaf33c38efe77c Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 29 Mar 2024 16:02:05 +0300 Subject: [PATCH] import mesa-23.1.4-2.el8 --- .gitignore | 3 + .mesa.metadata | 3 + ...ver-llvm-move-to-modern-pass-manager.patch | 127 ++ ...clude-old-Transform-includes-when-ne.patch | 41 + SOURCES/Makefile | 23 + .../Mesa-MLAA-License-Clarification-Email.txt | 117 ++ SOURCES/fix-py-ver.patch | 12 + SOURCES/gnome-shell-glthread-disable.patch | 11 + SOURCES/lavapipe-disable-env-var.patch | 13 + SOURCES/radeonsi-turn-off-glthread.patch | 11 + SOURCES/vl_decoder.c | 20 + SOURCES/vl_mpeg12_decoder.c | 7 + SPECS/mesa.spec | 1423 +++++++++++++++++ 13 files changed, 1811 insertions(+) create mode 100644 .gitignore create mode 100644 .mesa.metadata create mode 100644 SOURCES/0001-clover-llvm-move-to-modern-pass-manager.patch create mode 100644 SOURCES/0001-llvmpipe-only-include-old-Transform-includes-when-ne.patch create mode 100644 SOURCES/Makefile create mode 100644 SOURCES/Mesa-MLAA-License-Clarification-Email.txt create mode 100644 SOURCES/fix-py-ver.patch create mode 100644 SOURCES/gnome-shell-glthread-disable.patch create mode 100644 SOURCES/lavapipe-disable-env-var.patch create mode 100644 SOURCES/radeonsi-turn-off-glthread.patch create mode 100644 SOURCES/vl_decoder.c create mode 100644 SOURCES/vl_mpeg12_decoder.c create mode 100644 SPECS/mesa.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5fcc55c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +SOURCES/dataclasses-0.8.tar.gz +SOURCES/mesa-23.1.4.tar.xz +SOURCES/meson-0.61.4.tar.gz diff --git a/.mesa.metadata b/.mesa.metadata new file mode 100644 index 0000000..7f273d1 --- /dev/null +++ b/.mesa.metadata @@ -0,0 +1,3 @@ +ef25d3e9e2523805baa314a4adcb915ae901740e SOURCES/dataclasses-0.8.tar.gz +8a48c0e1fbda2c9563ddcf95b05012ab00a8a692 SOURCES/mesa-23.1.4.tar.xz +b0ab169abd8ec87ce773a02b2c7d6a8664b8db00 SOURCES/meson-0.61.4.tar.gz diff --git a/SOURCES/0001-clover-llvm-move-to-modern-pass-manager.patch b/SOURCES/0001-clover-llvm-move-to-modern-pass-manager.patch new file mode 100644 index 0000000..cb6971e --- /dev/null +++ b/SOURCES/0001-clover-llvm-move-to-modern-pass-manager.patch @@ -0,0 +1,127 @@ +From 2d4fe5f229791fde52846b3f583c12508b5109d6 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +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 +Part-of: +--- + .../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 + #include + #include ++#include + #include +-#include ++#include + #include + #ifdef HAVE_CLOVER_SPIRV + #include + #endif + ++#include ++#include ++#include + #include + #include + #include +@@ -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 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"; ++ level = LLVMCodeGenLevelNone; ++ break; ++ case 1: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelLess; ++ break; ++ case 2: ++ opt_str = "default"; ++ level = LLVMCodeGenLevelDefault; ++ break; ++ case 3: ++ opt_str = "default"; ++ 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 +@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector &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 + diff --git a/SOURCES/0001-llvmpipe-only-include-old-Transform-includes-when-ne.patch b/SOURCES/0001-llvmpipe-only-include-old-Transform-includes-when-ne.patch new file mode 100644 index 0000000..064d5eb --- /dev/null +++ b/SOURCES/0001-llvmpipe-only-include-old-Transform-includes-when-ne.patch @@ -0,0 +1,41 @@ +From 9ba416cdc67073cdda9a73fe9d37304b82bdd526 Mon Sep 17 00:00:00 2001 +From: Pierre-Eric Pelloux-Prayer +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 +Part-of: +--- + 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 + #include +-#include +-#if LLVM_VERSION_MAJOR >= 7 +-#include +-#endif + #include + #if GALLIVM_USE_NEW_PASS == 1 + #include + #elif GALLIVM_HAVE_CORO == 1 ++#include ++#if LLVM_VERSION_MAJOR >= 7 ++#include ++#endif + #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64) + #include + #endif +-- +2.42.0 + diff --git a/SOURCES/Makefile b/SOURCES/Makefile new file mode 100644 index 0000000..bbe6f0a --- /dev/null +++ b/SOURCES/Makefile @@ -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} diff --git a/SOURCES/Mesa-MLAA-License-Clarification-Email.txt b/SOURCES/Mesa-MLAA-License-Clarification-Email.txt new file mode 100644 index 0000000..30bdf2e --- /dev/null +++ b/SOURCES/Mesa-MLAA-License-Clarification-Email.txt @@ -0,0 +1,117 @@ + +Subject: RE: Question about Mesa MLAA license +From: Jorge Jimenez +Date: 01/08/2013 12:50 PM +To: Tom Callaway +CC: "jorge@iryoku.com" + +Yes to both questions. + +Thanks, +Jorge + +From: Tom Callaway +Sent: January 8, 2013 6:49 PM +To: Jorge Jimenez +CC: jorge@iryoku.com +Subject: Re: Question about Mesa MLAA license + +On 01/08/2013 12:39 PM, Jorge Jimenez wrote: +> Hi Tom, +> +> What we meant with that is that we made an exception for clause 2. +> Instead of clause 2, in the case of the Mesa project, you have to name +> the technique Jimenez's MLAA in the config options of Mesa. We did that +> just to allow them to solve license issues. This exception should be for +> the Mesa project, and any project using Mesa, like Fedora. +> +> We want to widespread usage of our MLAA, so we want to avoid any kind of +> license complications. Hope current one is good for Fedora, if not +> please tell, and we'll see what we can do! + +Okay, a few more questions: + +* If Fedora decides to simply reproduce the quoted statement: +"Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia, +Jose I. Echevarria, Fernando Navarro and Diego Gutierrez." + +Specifically, if this is done as part of documentation included with +Mesa, is that sufficient to meet clause 2 even if the Mesa config option +is not set as described in your exception? + +* Currently, the Mesa config option for MLAA says: "Morphological +anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default +quality". Is this in compliance with your exception? + +Thanks again, + +~tom + +== +Fedora Project + +Subject: RE: Question about Mesa MLAA license +From: Jorge Jimenez +Date: 01/08/2013 12:39 PM +To: "jorge@iryoku.com" , Tom Callaway + +Hi Tom, + +What we meant with that is that we made an exception for clause 2. +Instead of clause 2, in the case of the Mesa project, you have to name +the technique Jimenez's MLAA in the config options of Mesa. We did that +just to allow them to solve license issues. This exception should be for +the Mesa project, and any project using Mesa, like Fedora. + +We want to widespread usage of our MLAA, so we want to avoid any kind of +license complications. Hope current one is good for Fedora, if not +please tell, and we'll see what we can do! + +Cheers, +Jorge + +From: Tom Callaway +Sent: January 8, 2013 6:30 PM +To: jorge@iryoku.com +Subject: Question about Mesa MLAA license + +Jorge, + +Thanks for all of your fantastic graphics work! I have been auditing +Fedora (a popular distribution of Linux) for license compliance and I +came across your MLAA code in Mesa. + +The license says: + + * 2. Redistributions in binary form must reproduce the following +statement: + * + * "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia, + * Jose I. Echevarria, Fernando Navarro and Diego Gutierrez." + * + * Only for use in the Mesa project, this point 2 is filled by naming the + * technique Jimenez's MLAA in the Mesa config options. + +That wording is unclear. When you say "Only for use in the Mesa +project...", it seems like you could either be saying: + +- This code may only be used as part of Mesa. + +OR + +- In Mesa, you can comply with clause 2 by simply selecting "Jimenez's +MLAA" in the Mesa config options. + +***** + +If the first item is true, then we may have to remove the MLAA code from +Fedora's copy of Mesa. However, looking at the license on your SMAA +code, I do not believe it to be the case. Please let me know either way! + +Thanks in advance, + +Tom Callaway +Fedora Legal + +== +Fedora Project diff --git a/SOURCES/fix-py-ver.patch b/SOURCES/fix-py-ver.patch new file mode 100644 index 0000000..053ab54 --- /dev/null +++ b/SOURCES/fix-py-ver.patch @@ -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', + ''' diff --git a/SOURCES/gnome-shell-glthread-disable.patch b/SOURCES/gnome-shell-glthread-disable.patch new file mode 100644 index 0000000..b2caeb8 --- /dev/null +++ b/SOURCES/gnome-shell-glthread-disable.patch @@ -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. + + + +