From 161a42614de029d87651c5c8747724031ef1302d Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Tue, 9 Jan 2024 14:46:15 -0800 Subject: [PATCH] chore: Update to Mesa 23.3.2 --- ...er-fix-release-build-unused-variable.patch | 28 ++++++++++ ...ove-gen5-final-pass-to-actually-be-f.patch | 52 ----------------- ...eemit-boolean-resolve-for-inverted-i.patch | 42 ++++++++++++++ .../mesa/disable-zink-egl-fallback.patch | 26 +++++++++ spec_files/mesa/mesa.spec | 8 ++- spec_files/mesa/valve.patch | 56 +++++++++---------- 6 files changed, 129 insertions(+), 83 deletions(-) create mode 100644 spec_files/mesa/0001-intel-compiler-fix-release-build-unused-variable.patch delete mode 100644 spec_files/mesa/0001-intel-compiler-move-gen5-final-pass-to-actually-be-f.patch create mode 100644 spec_files/mesa/0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch create mode 100644 spec_files/mesa/disable-zink-egl-fallback.patch diff --git a/spec_files/mesa/0001-intel-compiler-fix-release-build-unused-variable.patch b/spec_files/mesa/0001-intel-compiler-fix-release-build-unused-variable.patch new file mode 100644 index 00000000..7cce8273 --- /dev/null +++ b/spec_files/mesa/0001-intel-compiler-fix-release-build-unused-variable.patch @@ -0,0 +1,28 @@ +From b32d3c9251e18c77b4d58db61b43797ffb7b05cf Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 3 Jan 2024 16:31:23 +1000 +Subject: [PATCH] intel/compiler: fix release build unused variable. + +This is only used in an assert. + +Fixes: 158ac265dfd0 ("intel/fs: Make helpers for saving/restoring instruction order") +--- + src/intel/compiler/brw_fs.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp +index 696b5db8d9d..aa01a2241ce 100644 +--- a/src/intel/compiler/brw_fs.cpp ++++ b/src/intel/compiler/brw_fs.cpp +@@ -6834,7 +6834,7 @@ save_instruction_order(const struct cfg_t *cfg) + static void + restore_instruction_order(struct cfg_t *cfg, fs_inst **inst_arr) + { +- int num_insts = cfg->last_block()->end_ip + 1; ++ ASSERTED int num_insts = cfg->last_block()->end_ip + 1; + + int ip = 0; + foreach_block (block, cfg) { +-- +2.43.0 + diff --git a/spec_files/mesa/0001-intel-compiler-move-gen5-final-pass-to-actually-be-f.patch b/spec_files/mesa/0001-intel-compiler-move-gen5-final-pass-to-actually-be-f.patch deleted file mode 100644 index 5be89d74..00000000 --- a/spec_files/mesa/0001-intel-compiler-move-gen5-final-pass-to-actually-be-f.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e1b03c0d3dfb337c7f462ea7e146e727dbe35040 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Mon, 18 Dec 2023 16:47:56 +1000 -Subject: [PATCH] intel/compiler: move gen5 final pass to actually be final - pass - -This got broken by the register conversion, this pass needs to be -after all the others. - -Fixes: ce75c3c3fea9 ("intel: Switch to intrinsic-based registers") ---- - src/intel/compiler/brw_nir.c | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - -diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c -index 8da98b0fbfd..c36269fd015 100644 ---- a/src/intel/compiler/brw_nir.c -+++ b/src/intel/compiler/brw_nir.c -@@ -1753,14 +1753,6 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, - if (OPT(nir_opt_rematerialize_compares)) - OPT(nir_opt_dce); - -- /* This is the last pass we run before we start emitting stuff. It -- * determines when we need to insert boolean resolves on Gen <= 5. We -- * run it last because it stashes data in instr->pass_flags and we don't -- * want that to be squashed by other NIR passes. -- */ -- if (devinfo->ver <= 5) -- brw_nir_analyze_boolean_resolves(nir); -- - OPT(nir_opt_dce); - - /* The mesh stages require this pass to be called at the last minute, -@@ -1773,6 +1765,15 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, - brw_nir_adjust_payload(nir, compiler); - - nir_trivialize_registers(nir); -+ -+ /* This is the last pass we run before we start emitting stuff. It -+ * determines when we need to insert boolean resolves on Gen <= 5. We -+ * run it last because it stashes data in instr->pass_flags and we don't -+ * want that to be squashed by other NIR passes. -+ */ -+ if (devinfo->ver <= 5) -+ brw_nir_analyze_boolean_resolves(nir); -+ - nir_sweep(nir); - - if (unlikely(debug_enabled)) { --- -2.43.0 - diff --git a/spec_files/mesa/0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch b/spec_files/mesa/0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch new file mode 100644 index 00000000..dd7a9b54 --- /dev/null +++ b/spec_files/mesa/0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch @@ -0,0 +1,42 @@ +From 56a72e014fcda3c52cf119115cb71fce2fad86d8 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Thu, 21 Dec 2023 10:39:08 +1000 +Subject: [PATCH] intel/compiler: reemit boolean resolve for inverted if on + gen5 + +Gen5 adds some boolean conversion instructions after nir emits, +but that nir srcs don't line up with them, so reemit the boolean +conversion if we reemit the inot. + +Reviewed-by: Lionel Landwerlin +Fixes: 31b5f5a51f3a ("nir/opt_if: Simplify if's with general conditions") +Part-of: +--- + src/intel/compiler/brw_fs_nir.cpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp +index 33f2a4046b2..ccdd0fe7db8 100644 +--- a/src/intel/compiler/brw_fs_nir.cpp ++++ b/src/intel/compiler/brw_fs_nir.cpp +@@ -422,6 +422,17 @@ fs_visitor::nir_emit_if(nir_if *if_stmt) + invert = true; + cond_reg = get_nir_src(cond->src[0].src); + cond_reg = offset(cond_reg, bld, cond->src[0].swizzle[0]); ++ ++ if (devinfo->ver <= 5 && ++ (cond->instr.pass_flags & BRW_NIR_BOOLEAN_MASK) == BRW_NIR_BOOLEAN_NEEDS_RESOLVE) { ++ /* redo boolean resolve on gen5 */ ++ fs_reg masked = bld.vgrf(BRW_REGISTER_TYPE_D); ++ bld.AND(masked, cond_reg, brw_imm_d(1)); ++ masked.negate = true; ++ fs_reg tmp = bld.vgrf(cond_reg.type); ++ bld.MOV(retype(tmp, BRW_REGISTER_TYPE_D), masked); ++ cond_reg = tmp; ++ } + } else { + invert = false; + cond_reg = get_nir_src(if_stmt->condition); +-- +2.43.0 + diff --git a/spec_files/mesa/disable-zink-egl-fallback.patch b/spec_files/mesa/disable-zink-egl-fallback.patch new file mode 100644 index 00000000..c036acea --- /dev/null +++ b/spec_files/mesa/disable-zink-egl-fallback.patch @@ -0,0 +1,26 @@ +diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c +index d50be23e871..e3697622635 100644 +--- a/src/egl/main/eglapi.c ++++ b/src/egl/main/eglapi.c +@@ -695,17 +695,21 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) + if (disp->Options.ForceSoftware) + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); + else { ++#if 0 + bool success = false; + if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) { + disp->Options.Zink = EGL_TRUE; + success = _eglDriver.Initialize(disp); + } + if (!success) { ++#endif + disp->Options.Zink = EGL_FALSE; + disp->Options.ForceSoftware = EGL_TRUE; + if (!_eglDriver.Initialize(disp)) + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); ++#if 0 + } ++#endif + } + } + diff --git a/spec_files/mesa/mesa.spec b/spec_files/mesa/mesa.spec index 5fbe2354..3eeb6154 100644 --- a/spec_files/mesa/mesa.spec +++ b/spec_files/mesa/mesa.spec @@ -61,9 +61,9 @@ Name: mesa Summary: Mesa graphics libraries -%global ver 23.3.1 +%global ver 23.3.2 Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} -Release: 102.bazzite.{{{ git_dir_version }}} +Release: 100.bazzite.{{{ git_dir_version }}} License: MIT AND BSD-3-Clause AND SGI-B-2.0 URL: http://www.mesa3d.org @@ -74,7 +74,9 @@ Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz Source1: Mesa-MLAA-License-Clarification-Email.txt Patch10: gnome-shell-glthread-disable.patch -Patch11: 0001-intel-compiler-move-gen5-final-pass-to-actually-be-f.patch +Patch11: 0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch +Patch12: 0001-intel-compiler-fix-release-build-unused-variable.patch +Patch13: disable-zink-egl-fallback.patch # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26105/ Patch30: 26105.patch diff --git a/spec_files/mesa/valve.patch b/spec_files/mesa/valve.patch index f3843578..627f45c2 100644 --- a/spec_files/mesa/valve.patch +++ b/spec_files/mesa/valve.patch @@ -1,4 +1,4 @@ -From d8906ba219ae663c5792182a61ee1b5d2d59f4f6 Mon Sep 17 00:00:00 2001 +From 39b7df3a64e9cfe9c649cd7cda896cef57ae2270 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 20 Sep 2023 10:40:33 -0500 Subject: [PATCH 1/7] vulkan/wsi/wayland: refactor wayland dispatch code @@ -12,7 +12,7 @@ Signed-off-by: Derek Foreman 1 file changed, 208 insertions(+), 191 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c -index 94b9217cbdf..9d410cf8fe1 100644 +index 22e26bacbc5..d8ae6e36626 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -96,6 +96,11 @@ struct wsi_wl_display { @@ -539,9 +539,9 @@ index 94b9217cbdf..9d410cf8fe1 100644 pthread_mutex_destroy(&chain->present_ids.lock); } -@@ -2372,18 +2391,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, - chain->num_drm_modifiers = num_drm_modifiers; - chain->drm_modifiers = drm_modifiers; +@@ -2383,18 +2402,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + chain->drm_modifiers = drm_modifiers_copy; + } + chain->queue = wl_display_create_queue(chain->wsi_wl_surface->display->wl_display); + @@ -565,7 +565,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 2.42.0 -From 5cf771328cecd21fcd0a7bd1c83fce87ddaec616 Mon Sep 17 00:00:00 2001 +From ad381d34e00a89f1961cf345668b939830ed1d39 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 10 Nov 2023 07:25:35 -0600 Subject: [PATCH 2/7] vulkan/wsi/wayland: Use commit_timing/commit_queue @@ -612,7 +612,7 @@ index 9d0db011767..83ad71f06fa 100644 files_vulkan_wsi += wp_files['presentation-time'] files_vulkan_wsi += wp_files['tearing-control-v1'] diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c -index 9d410cf8fe1..86de6ca190c 100644 +index d8ae6e36626..dd78d98dfce 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -41,6 +41,8 @@ @@ -862,10 +862,10 @@ index 9d410cf8fe1..86de6ca190c 100644 + if (chain->commit_timer) + wp_commit_timer_v1_destroy(chain->commit_timer); + - wsi_swapchain_finish(&chain->base); - } + vk_free(pAllocator, (void *)chain->drm_modifiers); -@@ -2288,6 +2384,15 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + wsi_swapchain_finish(&chain->base); +@@ -2290,6 +2386,15 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, wp_tearing_control_v1_destroy(old_chain->tearing_control); old_chain->tearing_control = NULL; } @@ -881,7 +881,7 @@ index 9d410cf8fe1..86de6ca190c 100644 } /* Take ownership of the wsi_wl_surface */ -@@ -2403,7 +2508,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, +@@ -2414,7 +2519,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->queue); } @@ -903,7 +903,7 @@ index 9d410cf8fe1..86de6ca190c 100644 2.42.0 -From 05f047f5ddfcb09fb6432e96d5f0dd068b57d994 Mon Sep 17 00:00:00 2001 +From dfa0495e9fbe27216cfbcfd3564eeeb1c00a4e6e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 25 Nov 2023 16:25:58 +0100 Subject: [PATCH 3/7] hack: rip out commit-timing-v1 @@ -941,7 +941,7 @@ index 83ad71f06fa..dba95387975 100644 files_vulkan_wsi += wp_files['presentation-time'] files_vulkan_wsi += wp_files['tearing-control-v1'] diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c -index 86de6ca190c..7af1409b130 100644 +index dd78d98dfce..1efe9e449e8 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -42,7 +42,6 @@ @@ -1012,10 +1012,10 @@ index 86de6ca190c..7af1409b130 100644 - if (chain->commit_timer) - wp_commit_timer_v1_destroy(chain->commit_timer); - - wsi_swapchain_finish(&chain->base); - } + vk_free(pAllocator, (void *)chain->drm_modifiers); -@@ -2389,10 +2376,6 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + wsi_swapchain_finish(&chain->base); +@@ -2391,10 +2378,6 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, old_chain->commit_queue = NULL; old_chain->can_timestamp = false; } @@ -1026,7 +1026,7 @@ index 86de6ca190c..7af1409b130 100644 } /* Take ownership of the wsi_wl_surface */ -@@ -2510,12 +2493,9 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, +@@ -2521,12 +2504,9 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->legacy_fifo_ready = true; struct wsi_wl_display *dpy = chain->wsi_wl_surface->display; @@ -1044,7 +1044,7 @@ index 86de6ca190c..7af1409b130 100644 2.42.0 -From 8efe5c9434578a27cc2ea66bf507685102fafe43 Mon Sep 17 00:00:00 2001 +From fbb52f6f45b02583a0b496e4cc34af34251cb1bd Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 29 Nov 2023 11:06:51 +0000 Subject: [PATCH 4/7] wsi: Use vendored gamescope-commit-queue-v1 protocol @@ -1295,7 +1295,7 @@ index dba95387975..fb0fab69ac6 100644 files_vulkan_wsi += wp_files['linux-dmabuf-unstable-v1'] files_vulkan_wsi += wp_files['presentation-time'] diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c -index 7af1409b130..d21cae54f9b 100644 +index 1efe9e449e8..68d9088f936 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -41,7 +41,7 @@ @@ -1364,9 +1364,9 @@ index 7af1409b130..d21cae54f9b 100644 - wp_commit_queue_v1_destroy(chain->commit_queue); + gamescope_commit_queue_v1_destroy(chain->commit_queue); - wsi_swapchain_finish(&chain->base); - } -@@ -2372,7 +2372,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + vk_free(pAllocator, (void *)chain->drm_modifiers); + +@@ -2374,7 +2374,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, old_chain->tearing_control = NULL; } if (old_chain->commit_queue) { @@ -1375,7 +1375,7 @@ index 7af1409b130..d21cae54f9b 100644 old_chain->commit_queue = NULL; old_chain->can_timestamp = false; } -@@ -2494,7 +2494,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, +@@ -2505,7 +2505,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->legacy_fifo_ready = true; struct wsi_wl_display *dpy = chain->wsi_wl_surface->display; if (dpy->commit_queue_manager) { @@ -1388,7 +1388,7 @@ index 7af1409b130..d21cae54f9b 100644 2.42.0 -From 4d4979994876abdabe4c2f3692451a38233dbf44 Mon Sep 17 00:00:00 2001 +From f0be8700af09a5a1c94d84c1b3b4ee3096de0b69 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Fri, 14 Jan 2022 15:58:45 +0100 Subject: [PATCH 5/7] STEAMOS: radv: min image count override for FH5 @@ -1400,10 +1400,10 @@ gamescope the game could get stuck in low power states. 1 file changed, 4 insertions(+) diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf -index b13d92f84ce..0f8234b4993 100644 +index 0dcec733e52..f0d535df2f8 100644 --- a/src/util/00-radv-defaults.conf +++ b/src/util/00-radv-defaults.conf -@@ -180,5 +180,9 @@ Application bugs worked around in this file: +@@ -188,5 +188,9 @@ Application bugs worked around in this file: @@ -1417,7 +1417,7 @@ index b13d92f84ce..0f8234b4993 100644 2.42.0 -From 85c5c7b71a324ce60c427dee208cc4019013fadd Mon Sep 17 00:00:00 2001 +From 2ab76c1153f55d82c3f49a25f8f8a1f1e1e74075 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Mon, 21 Feb 2022 18:43:54 +0100 Subject: [PATCH 6/7] STEAMOS: Dynamic swapchain override for gamescope limiter @@ -1618,7 +1618,7 @@ index cba1d1c5e7c..6d66387d5be 100644 2.42.0 -From 61a785c7cf06cd8c585fcac890c6b1bb9eccc374 Mon Sep 17 00:00:00 2001 +From f00348f08f42a1ce3be4e71f9fba186fb629c723 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Fri, 1 Dec 2023 15:18:44 +0100 Subject: [PATCH 7/7] radv: Enable compute dispatch tunneling