From ce16ae464daa70124ad254ac0e4b64b7c91f9a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Penttil=C3=A4?= Date: Fri, 31 Oct 2025 08:40:08 +0200 Subject: [PATCH] Update to 25.2.5 Bundle and build meson 1.7.0 required for Mesa Rust support. Resolves: https://issues.redhat.com/browse/RHEL-107474 --- .gitignore | 12 +- ...-stop-turning-load_push_constants-in.patch | 88 ------ ...Revert-kopper-Explicitly-choose-zink.patch | 46 ---- ...8-u16-const-loads-properly-on-big-en.patch | 16 -- 32886.patch | 88 ------ ...5e80c316c0af3fff310ca89e1175d81556c1.patch | 144 ---------- gnome-shell-glthread-disable.patch | 11 - mesa.spec | 257 +++++++++--------- sources | 8 +- wayland-display-hacks.patch | 17 ++ 10 files changed, 152 insertions(+), 535 deletions(-) delete mode 100644 0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch delete mode 100644 0001-Revert-kopper-Explicitly-choose-zink.patch delete mode 100644 0001-gallivm-handle-u8-u16-const-loads-properly-on-big-en.patch delete mode 100644 32886.patch delete mode 100644 e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch delete mode 100644 gnome-shell-glthread-disable.patch create mode 100644 wayland-display-hacks.patch diff --git a/.gitignore b/.gitignore index 87c9923..85bfa50 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,12 @@ x86_64/ results_mesa/ mesa-*/ +/meson-*.tar.gz /libclc-*.tar.xz /spirv-llvm-translator-*.tar.gz -/paste-1.0.15.tar.gz -/proc-macro2-1.0.97.tar.gz -/quote-1.0.40.tar.gz -/syn-2.0.104.tar.gz -/unicode-ident-1.0.18.tar.gz +/paste-*.tar.gz +/proc-macro2-*.tar.gz +/quote-*.tar.gz +/syn-*.tar.gz +/unicode-ident-*.tar.gz +/rustc-hash-*.tar.gz diff --git a/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch b/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch deleted file mode 100644 index 1c8a598..0000000 --- a/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 870b8717b25eceadac8dd653debe8346826227cb Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Mon, 9 Jun 2025 09:19:28 +1000 -Subject: [PATCH] Revert "hasvk/elk: stop turning load_push_constants into - load_uniform" - -This reverts commit b036d2ded2de32e81730ec8ce37c803bad112efa. - -This seems to break gtk4 and other stuff. - -Cc: mesa-stable -(taking ack from Lionel saying we should revert) - -Acked-by: Lionel Landwerlin -Part-of: ---- - src/intel/compiler/elk/elk_fs_nir.cpp | 4 ++-- - src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c | 6 +++--- - src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c | 3 +-- - 3 files changed, 6 insertions(+), 7 deletions(-) - -diff --git a/src/intel/compiler/elk/elk_fs_nir.cpp b/src/intel/compiler/elk/elk_fs_nir.cpp -index 459e2d966b7..6b78d6cf9f8 100644 ---- a/src/intel/compiler/elk/elk_fs_nir.cpp -+++ b/src/intel/compiler/elk/elk_fs_nir.cpp -@@ -4969,8 +4969,7 @@ fs_nir_emit_intrinsic(nir_to_elk_state &ntb, - break; - } - -- case nir_intrinsic_load_uniform: -- case nir_intrinsic_load_push_constant: { -+ case nir_intrinsic_load_uniform: { - /* Offsets are in bytes but they should always aligned to - * the type size - */ -@@ -7058,3 +7057,4 @@ nir_to_elk(elk_fs_visitor *s) - - ralloc_free(ntb.mem_ctx); - } -+ -diff --git a/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -index 2bedf9017ed..1c613a9ebe7 100644 ---- a/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -+++ b/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -@@ -463,9 +463,9 @@ build_buffer_addr_for_res_index(nir_builder *b, - nir_iadd(b, res.dyn_offset_base, res.array_index); - - nir_def *dyn_load = -- nir_load_uniform(b, 1, 32, nir_imul_imm(b, dyn_offset_idx, 4), -- .base = offsetof(struct anv_push_constants, dynamic_offsets), -- .range = MAX_DYNAMIC_BUFFERS * 4); -+ nir_load_push_constant(b, 1, 32, nir_imul_imm(b, dyn_offset_idx, 4), -+ .base = offsetof(struct anv_push_constants, dynamic_offsets), -+ .range = MAX_DYNAMIC_BUFFERS * 4); - - nir_def *dynamic_offset = - nir_bcsel(b, nir_ieq_imm(b, res.dyn_offset_base, 0xff), -diff --git a/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c b/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -index ed314af8b98..8a3f83f2c26 100644 ---- a/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -+++ b/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -@@ -55,7 +55,6 @@ anv_nir_compute_push_layout(nir_shader *nir, - has_const_ubo = true; - break; - -- case nir_intrinsic_load_uniform: - case nir_intrinsic_load_push_constant: { - unsigned base = nir_intrinsic_base(intrin); - unsigned range = nir_intrinsic_range(intrin); -@@ -132,7 +131,6 @@ anv_nir_compute_push_layout(nir_shader *nir, - - nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); - switch (intrin->intrinsic) { -- case nir_intrinsic_load_uniform: - case nir_intrinsic_load_push_constant: { - /* With bindless shaders we load uniforms with SEND - * messages. All the push constants are located after the -@@ -141,6 +139,7 @@ anv_nir_compute_push_layout(nir_shader *nir, - * elk_nir_lower_rt_intrinsics.c). - */ - unsigned base_offset = push_start; -+ intrin->intrinsic = nir_intrinsic_load_uniform; - nir_intrinsic_set_base(intrin, - nir_intrinsic_base(intrin) - - base_offset); --- -2.49.0 - diff --git a/0001-Revert-kopper-Explicitly-choose-zink.patch b/0001-Revert-kopper-Explicitly-choose-zink.patch deleted file mode 100644 index 954389e..0000000 --- a/0001-Revert-kopper-Explicitly-choose-zink.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 24f85c06c28736b73c14208a0ffa6657d2aee9cd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 21 Apr 2025 13:52:14 +0200 -Subject: [PATCH] Revert "kopper: Explicitly choose zink" - -On QEMU (virtio driver), without 3D acceleration enabled and without -mesa-vulkan-drivers installed, this commit prevents Mutter to start. - -This reverts commit c0bc957c5d8c7edd57626284b712dd6ea1e375fc. - -Related: https://bugzilla.redhat.com/show_bug.cgi?id=2360851 -Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13009 ---- - .pick_status.json | 2 +- - src/gallium/frontends/dri/kopper.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/.pick_status.json b/.pick_status.json -index 99df2fb30c2..cdf3965678c 100644 ---- a/.pick_status.json -+++ b/.pick_status.json -@@ -16204,7 +16204,7 @@ - "description": "kopper: Explicitly choose zink", - "nominated": false, - "nomination_type": 0, -- "resolution": 1, -+ "resolution": 4, - "main_sha": null, - "because_sha": null, - "notes": null -diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c -index a1d7dcb79b4..3bdb56022a9 100644 ---- a/src/gallium/frontends/dri/kopper.c -+++ b/src/gallium/frontends/dri/kopper.c -@@ -73,7 +73,7 @@ kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred) - bool success; - #ifdef HAVE_LIBDRM - if (screen->fd != -1) -- success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, true); -+ success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, false); - else - success = pipe_loader_vk_probe_dri(&screen->dev); - #else --- -2.49.0 - diff --git a/0001-gallivm-handle-u8-u16-const-loads-properly-on-big-en.patch b/0001-gallivm-handle-u8-u16-const-loads-properly-on-big-en.patch deleted file mode 100644 index bd942c6..0000000 --- a/0001-gallivm-handle-u8-u16-const-loads-properly-on-big-en.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up mesa-25.0.7/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c.dma mesa-25.0.7/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c ---- mesa-25.0.7/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c.dma 2025-05-29 01:20:23.000000000 +1000 -+++ mesa-25.0.7/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c 2025-09-26 12:32:52.240568901 +1000 -@@ -1321,8 +1321,10 @@ emit_load_const(struct lp_build_nir_cont - - for (unsigned i = 0; i < instr->def.num_components; i++) { - outval[i] = lp_build_const_int_vec(bld_base->base.gallivm, int_bld->type, -- bits == 32 ? instr->value[i].u32 -- : instr->value[i].u64); -+ bits == 8 ? instr->value[i].u8 : -+ bits == 16 ? instr->value[i].u16 : -+ bits == 32 ? instr->value[i].u32 : -+ instr->value[i].u64); - } - for (unsigned i = instr->def.num_components; i < NIR_MAX_VEC_COMPONENTS; i++) { - outval[i] = NULL; diff --git a/32886.patch b/32886.patch deleted file mode 100644 index 087e062..0000000 --- a/32886.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 023db569e8f7bf325fba86a1fa4ba984026a532c Mon Sep 17 00:00:00 2001 -From: Benjamin ROBIN -Date: Sun, 5 Jan 2025 17:03:52 +0100 -Subject: [PATCH 2/2] docs: Update MESA_SHADER_CACHE_DIR env variable behavior - -Update documentation to match implementation of -disk_cache_generate_cache_dir(). - -Signed-off-by: Benjamin ROBIN -Part-of: ---- - docs/envvars.rst | 21 ++++++++++++--------- - src/util/disk_cache_os.c | 13 +++++++++---- - 2 files changed, 21 insertions(+), 13 deletions(-) - -diff --git a/docs/envvars.rst b/docs/envvars.rst -index 7247158cc5073..e812b9280777a 100644 ---- a/docs/envvars.rst -+++ b/docs/envvars.rst -@@ -200,10 +200,11 @@ Core Mesa environment variables - .. envvar:: MESA_SHADER_CACHE_DIR - - if set, determines the directory to be used for the on-disk cache of -- compiled shader programs. If this variable is not set, then the cache -- will be stored in ``$XDG_CACHE_HOME/mesa_shader_cache_db`` (if that -- variable is set), or else within ``.cache/mesa_shader_cache_db`` within -- the user's home directory. -+ compiled shader programs. If set then the cache will be stored in -+ ``$MESA_SHADER_CACHE_DIR/mesa_shader_cache_db``. If this variable is not -+ set, then the cache will be stored in -+ ``$XDG_CACHE_HOME/mesa_shader_cache_db`` (if that variable is set), or else -+ within ``.cache/mesa_shader_cache_db`` within the user's home directory. - - .. envvar:: MESA_SHADER_CACHE_SHOW_STATS - -@@ -218,9 +219,10 @@ Core Mesa environment variables - cache DBs via :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS` or - :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST`. This - implementation does not support cache size limits via -- :envvar:`MESA_SHADER_CACHE_MAX_SIZE`. If -- :envvar:`MESA_SHADER_CACHE_DIR` is not set, the cache will be stored -- in ``$XDG_CACHE_HOME/mesa_shader_cache_sf`` (if that variable is set) -+ :envvar:`MESA_SHADER_CACHE_MAX_SIZE`. If :envvar:`MESA_SHADER_CACHE_DIR` -+ is set, the cache will be stored in -+ ``$MESA_SHADER_CACHE_DIR/mesa_shader_cache_sf``, or else within -+ ``$XDG_CACHE_HOME/mesa_shader_cache_sf`` (if that variable is set) - or else within ``.cache/mesa_shader_cache_sf`` within the user's home - directory. - -@@ -229,8 +231,9 @@ Core Mesa environment variables - if set to 1, enables the multi file on-disk shader cache implementation - instead of the default Mesa-DB cache implementation. - This implementation increases the overall disk usage. -- If :envvar:`MESA_SHADER_CACHE_DIR` is not set, the cache will be stored -- in ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that variable is set) -+ If :envvar:`MESA_SHADER_CACHE_DIR` is set, the cache will be stored in -+ ``$MESA_SHADER_CACHE_DIR/mesa_shader_cache``, or else within -+ ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that variable is set) - or else within ``.cache/mesa_shader_cache`` within the user's home - directory. - -diff --git a/src/util/disk_cache_os.c b/src/util/disk_cache_os.c -index 8d6ce428c1823..09051491d332f 100644 ---- a/src/util/disk_cache_os.c -+++ b/src/util/disk_cache_os.c -@@ -873,10 +873,15 @@ disk_cache_write_item_to_disk(struct disk_cache_put_job *dc_job, - - /* Determine path for cache based on the first defined name as follows: - * -- * $MESA_SHADER_CACHE_DIR -- * $XDG_CACHE_HOME/mesa_shader_cache -- * $HOME/.cache/mesa_shader_cache -- * /.cache/mesa_shader_cache -+ * $MESA_SHADER_CACHE_DIR/mesa_shader_cache* -+ * $XDG_CACHE_HOME/mesa_shader_cache* -+ * $HOME/.cache/mesa_shader_cache* -+ * /.cache/mesa_shader_cache* -+ * -+ * The directory 'mesa_shader_cache*' is named depending of cache type: -+ * - For DISK_CACHE_MULTI_FILE: mesa_shader_cache -+ * - For DISK_CACHE_SINGLE_FILE: mesa_shader_cache_sf -+ * - For DISK_CACHE_DATABASE: mesa_shader_cache_db - */ - char * - disk_cache_generate_cache_dir(void *mem_ctx, const char *gpu_name, --- -GitLab - diff --git a/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch b/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch deleted file mode 100644 index 5cf4073..0000000 --- a/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch +++ /dev/null @@ -1,144 +0,0 @@ -From e4eb5e80c316c0af3fff310ca89e1175d81556c1 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Thu, 27 Feb 2025 15:44:27 +0100 -Subject: [PATCH] clover: Don't include libclc headers - -Per https://github.com/llvm/llvm-project/issues/119967 these -headers are internal implementation details of libclc and were -never supposed to be installed. They are not available anymore -since LLVM 20. Instead opencl-c.h should be used. - -There already ise a code path for including opencl-c.h, so always -use it. - -This didn't work for me out of the box, because the build system -currently hardcodes the clang resource directory, which is incorrect -for Fedora at least. Fix this by using GetResourcePath + -CLANG_RESOURCE_DIR provided by clang instead. This is basically -the same as what is done in clc_helper.c - -I've still retained the old behavior as a fallback just in case -(e.g. if clang is linked statically?) - -Reviewed-by: Karol Herbst -Part-of: ---- - .../frontends/clover/llvm/invocation.cpp | 53 +++++++++++++------ - src/gallium/frontends/clover/meson.build | 5 +- - 2 files changed, 39 insertions(+), 19 deletions(-) - -diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp -index 3cbb05baecf67..ca030b404d791 100644 ---- a/src/gallium/frontends/clover/llvm/invocation.cpp -+++ b/src/gallium/frontends/clover/llvm/invocation.cpp -@@ -24,6 +24,8 @@ - // OTHER DEALINGS IN THE SOFTWARE. - // - -+#include -+ - #include - #include - #include -@@ -39,6 +41,8 @@ - #include - #include - #include -+#include -+#include - - #if LLVM_VERSION_MAJOR >= 20 - #include -@@ -323,6 +327,30 @@ namespace { - return c; - } - -+ std::string getResourceDirectory() { -+ Dl_info info; -+ if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) { -+ return FALLBACK_CLANG_RESOURCE_DIR; -+ } -+ -+ char *libclang_path = realpath(info.dli_fname, NULL); -+ if (libclang_path == nullptr) { -+ return FALLBACK_CLANG_RESOURCE_DIR; -+ } -+ -+ // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given -+ // binary or library. -+ std::string clang_resource_dir = -+#if LLVM_VERSION_MAJOR >= 20 -+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path)); -+#else -+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path), CLANG_RESOURCE_DIR); -+#endif -+ free(libclang_path); -+ -+ return clang_resource_dir; -+ } -+ - std::unique_ptr - compile(LLVMContext &ctx, clang::CompilerInstance &c, - const std::string &name, const std::string &source, -@@ -331,25 +359,18 @@ namespace { - c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly; - c.getHeaderSearchOpts().UseBuiltinIncludes = true; - c.getHeaderSearchOpts().UseStandardSystemIncludes = true; -- c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR; - -- if (use_libclc) { -- // Add libclc generic search path -- c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR, -- clang::frontend::Angled, -- false, false); -+ std::string clang_resource_dir = getResourceDirectory(); -+ c.getHeaderSearchOpts().ResourceDir = clang_resource_dir; - -- // Add libclc include -- c.getPreprocessorOpts().Includes.push_back("clc/clc.h"); -- } else { -- // Add opencl-c generic search path -- c.getHeaderSearchOpts().AddPath(CLANG_RESOURCE_DIR, -- clang::frontend::Angled, -- false, false); -+ // Add opencl-c generic search path -+ std::string clang_include_path = clang_resource_dir + "/include"; -+ c.getHeaderSearchOpts().AddPath(clang_include_path, -+ clang::frontend::Angled, -+ false, false); - -- // Add opencl include -- c.getPreprocessorOpts().Includes.push_back("opencl-c.h"); -- } -+ // Add opencl include -+ c.getPreprocessorOpts().Includes.push_back("opencl-c.h"); - - // Add definition for the OpenCL version - const auto dev_version = dev.device_version(); -diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build -index e569b86a1bea7..56a9894f0dbb1 100644 ---- a/src/gallium/frontends/clover/meson.build -+++ b/src/gallium/frontends/clover/meson.build -@@ -10,7 +10,6 @@ clover_opencl_cpp_args = [ - '-DCL_USE_DEPRECATED_OPENCL_2_0_APIS', - '-DCL_USE_DEPRECATED_OPENCL_2_1_APIS', - '-DCL_USE_DEPRECATED_OPENCL_2_2_APIS', -- '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')), - '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir')) - ] - clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux] -@@ -43,9 +42,9 @@ libclllvm = static_library( - cpp_args : [ - clover_cpp_args, - clover_opencl_cpp_args, -- '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( -+ '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths( - dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang', -- dep_llvm.version(), 'include', -+ dep_llvm.version() - )), - ], - gnu_symbol_visibility : 'hidden', --- -GitLab - diff --git a/gnome-shell-glthread-disable.patch b/gnome-shell-glthread-disable.patch deleted file mode 100644 index b2caeb8..0000000 --- a/gnome-shell-glthread-disable.patch +++ /dev/null @@ -1,11 +0,0 @@ -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. - - - -