From 9216ebaeeb8f91ba1b749ea73e2e131fe5e2c04b Mon Sep 17 00:00:00 2001 From: Raven Date: Thu, 24 Oct 2024 17:57:18 +0600 Subject: [PATCH] mesa: 23.3.6 --- ...utomatic-zink-fallback-loading-betwe.patch | 40 ------- ...-18_-do-not-use-llvm-createLoopSinkP.patch | 41 ------- extras/mesa/0001-fix-build-with-LLVM-19.patch | 71 ++++++++++++ ...utomatic-zink-fallback-loading-betwe.patch | 103 ------------------ extras/mesa/mesa.spec | 17 +-- ...nk-fix-resizable-bar-detection-logic.patch | 39 ------- 6 files changed, 81 insertions(+), 230 deletions(-) delete mode 100644 extras/mesa/0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch delete mode 100644 extras/mesa/0001-fix-ac-llvm-LLVM-18_-do-not-use-llvm-createLoopSinkP.patch create mode 100644 extras/mesa/0001-fix-build-with-LLVM-19.patch delete mode 100644 extras/mesa/0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch delete mode 100644 extras/mesa/zink-fix-resizable-bar-detection-logic.patch diff --git a/extras/mesa/0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch b/extras/mesa/0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch deleted file mode 100644 index e6217ad..0000000 --- a/extras/mesa/0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b673271710047acb1976002e4b84d06b7cefd3d7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -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 - diff --git a/extras/mesa/0001-fix-ac-llvm-LLVM-18_-do-not-use-llvm-createLoopSinkP.patch b/extras/mesa/0001-fix-ac-llvm-LLVM-18_-do-not-use-llvm-createLoopSinkP.patch deleted file mode 100644 index d9effe9..0000000 --- a/extras/mesa/0001-fix-ac-llvm-LLVM-18_-do-not-use-llvm-createLoopSinkP.patch +++ /dev/null @@ -1,41 +0,0 @@ -From d3ab117c837e537fe0b7077bb9e4c3f018153945 Mon Sep 17 00:00:00 2001 -Message-ID: -From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= -Date: Wed, 22 Nov 2023 20:21:11 +0100 -Subject: [PATCH] fix: ac/llvm: LLVM 18_ do not use llvm::createLoopSinkPass(), - removed upstream -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There is no alternative named in upstream commit -, -that removes the legacy pass, therefore this commit should be considered -a workaround. - -Workaround-for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10192 -Reference: https://github.com/llvm/llvm-project/pull/72811 -Reference: https://github.com/llvm/llvm-project/commit/b9975cec0ea0a2f10d65b7bd1197d9e1706cbd3d -Signed-off-by: Kai Wasserbäch ---- - src/amd/llvm/ac_llvm_helper.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp -index 40a4399e705..b995152ee36 100644 ---- a/src/amd/llvm/ac_llvm_helper.cpp -+++ b/src/amd/llvm/ac_llvm_helper.cpp -@@ -307,8 +307,9 @@ LLVMPassManagerRef ac_create_passmgr(LLVMTargetLibraryInfoRef target_library_inf - unwrap(passmgr)->add(createSROAPass()); - #endif - /* TODO: restore IPSCCP */ -- if (LLVM_VERSION_MAJOR >= 16) -+ #if LLVM_VERSION_MAJOR >= 16 && LLVM_VERSION_MAJOR < 18 - unwrap(passmgr)->add(createLoopSinkPass()); -+ #endif - /* TODO: restore IPSCCP */ - unwrap(passmgr)->add(createLICMPass()); - unwrap(passmgr)->add(createCFGSimplificationPass()); --- -2.42.0 - diff --git a/extras/mesa/0001-fix-build-with-LLVM-19.patch b/extras/mesa/0001-fix-build-with-LLVM-19.patch new file mode 100644 index 0000000..18e9770 --- /dev/null +++ b/extras/mesa/0001-fix-build-with-LLVM-19.patch @@ -0,0 +1,71 @@ +diff -Naur a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp +--- a/src/compiler/clc/clc_helpers.cpp 2024-10-14 15:16:10.908581118 +0600 ++++ b/src/compiler/clc/clc_helpers.cpp 2024-10-14 15:17:22.924120115 +0600 +@@ -85,13 +85,21 @@ + using ::clang::driver::Driver; + + static void ++#if LLVM_VERSION_MAJOR >= 19 ++llvm_log_handler(const ::llvm::DiagnosticInfo *di, void *data) { ++#else + llvm_log_handler(const ::llvm::DiagnosticInfo &di, void *data) { ++#endif + const clc_logger *logger = static_cast(data); + + std::string log; + raw_string_ostream os { log }; + ::llvm::DiagnosticPrinterRawOStream printer { os }; ++#if LLVM_VERSION_MAJOR >= 19 ++ di->print(printer); ++#else + di.print(printer); ++#endif + + clc_error(logger, "%s", log.c_str()); + } +diff -Naur a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp +--- a/src/gallium/frontends/clover/llvm/invocation.cpp 2024-10-14 15:20:16.317010149 +0600 ++++ b/src/gallium/frontends/clover/llvm/invocation.cpp 2024-10-14 15:21:13.420644604 +0600 +@@ -128,11 +128,20 @@ + } + + void ++#if LLVM_VERSION_MAJOR >= 19 ++ diagnostic_handler(const ::llvm::DiagnosticInfo *di, void *data) { ++ if (di->getSeverity() == ::llvm::DS_Error) { ++#else + diagnostic_handler(const ::llvm::DiagnosticInfo &di, void *data) { + if (di.getSeverity() == ::llvm::DS_Error) { ++#endif + raw_string_ostream os { *reinterpret_cast(data) }; + ::llvm::DiagnosticPrinterRawOStream printer { os }; ++#if LLVM_VERSION_MAJOR >= 19 ++ di->print(printer); ++#else + di.print(printer); ++#endif + throw build_error(); + } + } +diff -Naur a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp +--- a/src/amd/llvm/ac_llvm_helper.cpp ++++ b/src/amd/llvm/ac_llvm_helper.cpp +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -307,8 +307,9 @@ + unwrap(passmgr)->add(createSROAPass()); + #endif + /* TODO: restore IPSCCP */ +- if (LLVM_VERSION_MAJOR >= 16) ++ #if LLVM_VERSION_MAJOR >= 16 && LLVM_VERSION_MAJOR < 18 + unwrap(passmgr)->add(createLoopSinkPass()); ++ #endif + /* TODO: restore IPSCCP */ + unwrap(passmgr)->add(createLICMPass()); + unwrap(passmgr)->add(createCFGSimplificationPass()); diff --git a/extras/mesa/0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch b/extras/mesa/0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch deleted file mode 100644 index dc8452d..0000000 --- a/extras/mesa/0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 9b9d225931b69532aa1b43abdaf29c826bc47b26 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -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 - diff --git a/extras/mesa/mesa.spec b/extras/mesa/mesa.spec index 5c511a4..e4ef17b 100644 --- a/extras/mesa/mesa.spec +++ b/extras/mesa/mesa.spec @@ -3,7 +3,7 @@ %global with_vulkan_hw 1 %global with_vdpau 1 %global with_vaapi 1 -%if !0%{?rhel} +%if 0%{?rhel} %global with_nine 1 %global with_omx 1 %global with_opencl 1 @@ -52,7 +52,7 @@ Name: mesa Summary: Mesa graphics libraries -%global ver 23.3.3 +%global ver 23.3.6 Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} Release: 1%{?dist} License: MIT @@ -65,17 +65,17 @@ Source0: https://mesa.freedesktop.org/archive/%{name}-%{ver}.tar.xz Source1: Mesa-MLAA-License-Clarification-Email.txt Patch10: gnome-shell-glthread-disable.patch -Patch12: radeonsi-turn-off-glthread.patch -Patch13: zink-fix-resizable-bar-detection-logic.patch +#Patch12: radeonsi-turn-off-glthread.patch +#Patch13: zink-fix-resizable-bar-detection-logic.patch Patch14: mesa-meson-c99.patch # Temporary disabling Zink as a fallback between HW and SW drivers due to # multiple regression caused by this change during the 23.3.X development cycle. # Remove these 2 patches if updating to 24.X.X: -Patch15: 0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch -Patch16: 0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch +#Patch15: 0001-Revert-egl-add-automatic-zink-fallback-loading-betwe.patch +#Patch16: 0002-Revert-glx-add-automatic-zink-fallback-loading-betwe.patch Patch20: mesa-use-python3.11.patch -Patch21: 0001-fix-ac-llvm-LLVM-18_-do-not-use-llvm-createLoopSinkP.patch +Patch21: 0001-fix-build-with-LLVM-19.patch BuildRequires: meson >= 0.45 BuildRequires: gcc @@ -618,6 +618,9 @@ popd %endif %changelog +* Mon Oct 14 2024 Raven - 23.3.6-1 +- Update to mesa 23.3.6 + * Wed Jan 17 2024 José Expósito - 23.3.3-1 - Update to mesa 23.3.3 diff --git a/extras/mesa/zink-fix-resizable-bar-detection-logic.patch b/extras/mesa/zink-fix-resizable-bar-detection-logic.patch deleted file mode 100644 index 4a5e916..0000000 --- a/extras/mesa/zink-fix-resizable-bar-detection-logic.patch +++ /dev/null @@ -1,39 +0,0 @@ -From a077c14f150f1c4f670dce381ac2eb548f1a4ac2 Mon Sep 17 00:00:00 2001 -From: Alessandro Astone -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 -Part-of: ---- - 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 -