From b7559b9193f34fb6e2641dabfd2f1d3c10959418 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 16 Dec 2022 19:42:27 +0000 Subject: [PATCH] extra/mesa to 22.3.1-1 --- ...INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch | 24 ++++-- ...mask-the-bottom-bits-of-the-sampler-.patch | 83 ------------------- extra/mesa/PKGBUILD | 15 ++-- 3 files changed, 25 insertions(+), 97 deletions(-) delete mode 100644 extra/mesa/0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch diff --git a/extra/mesa/0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch b/extra/mesa/0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch index 11efcb8c0..aa8f31673 100644 --- a/extra/mesa/0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch +++ b/extra/mesa/0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch @@ -4,8 +4,11 @@ Date: Sun, 12 Jun 2022 23:59:05 +0300 Subject: [PATCH] anv: force MEDIA_INTERFACE_DESCRIPTOR_LOAD reemit after 3D->GPGPU switch -Seems to fix a hang in Age of Empire 4 where the HW is hung on a -PIPE_CONTROL after a GPGPU_WALKER but no +Seems to fix a hang in the following titles : + - Age of Empire 4 + - Monster Hunter Rise + +where the HW is hung on a PIPE_CONTROL after a GPGPU_WALKER but no MEDIA_INTERFACE_DESCRIPTOR_LOAD was emitted since the switch from 3D to GPGPU. @@ -19,18 +22,27 @@ This would happen in the following case : Signed-off-by: Lionel Landwerlin --- - src/intel/vulkan/genX_cmd_buffer.c | 5 +++++ - 1 file changed, 5 insertions(+) + src/intel/vulkan/genX_cmd_buffer.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c -index 240630d84124..77822ec89404 100644 +index d56f9037fde1..e03dc16c1fc5 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c -@@ -5917,6 +5917,11 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer, +@@ -6001,6 +6001,20 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer, } #endif +#if GFX_VERx10 == 120 ++ /* Undocumented workaround to force the re-emission of ++ * MEDIA_INTERFACE_DESCRIPTOR_LOAD when switching from 3D to Compute ++ * pipeline without rebinding a pipeline : ++ * vkCmdBindPipeline(COMPUTE, cs_pipeline); ++ * vkCmdDispatch(...); ++ * vkCmdBindPipeline(GRAPHICS, gfx_pipeline); ++ * vkCmdDraw(...); ++ * vkCmdDispatch(...); ++ */ + if (pipeline == _3D) + cmd_buffer->state.compute.pipeline_dirty = true; +#endif diff --git a/extra/mesa/0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch b/extra/mesa/0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch deleted file mode 100644 index 4e30757c0..000000000 --- a/extra/mesa/0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Lionel Landwerlin -Date: Sat, 25 Jun 2022 23:38:45 +0300 -Subject: [PATCH] intel/fs: always mask the bottom bits of the sampler extended - descriptor - -Fixes a hang in Age Of Empire 4. The HW is hang with the sampler input -unit busy. Replaying on simulation showed the extended message length -in the extended descriptor is invalid. Since the Anv ensures the input -is correct in anv_surface_state_to_handle(), the likely reason for -this issue is the use of VK_VALVE_mutable_descriptor_type and the -application leaving a previous value for a different descriptor type. - -Signed-off-by: Lionel Landwerlin ---- - src/intel/compiler/brw_fs.cpp | 2 +- - .../compiler/brw_lower_logical_sends.cpp | 20 +++++++++++++++---- - 2 files changed, 17 insertions(+), 5 deletions(-) - -diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp -index 0f282dcd345f..165d8b33b677 100644 ---- a/src/intel/compiler/brw_fs.cpp -+++ b/src/intel/compiler/brw_fs.cpp -@@ -4421,7 +4421,7 @@ brw_fb_write_msg_control(const fs_inst *inst, - return mctl; - } - -- /** -+/** - * Predicate the specified instruction on the sample mask. - */ - void -diff --git a/src/intel/compiler/brw_lower_logical_sends.cpp b/src/intel/compiler/brw_lower_logical_sends.cpp -index 255ce7594811..e99c7b8ab844 100644 ---- a/src/intel/compiler/brw_lower_logical_sends.cpp -+++ b/src/intel/compiler/brw_lower_logical_sends.cpp -@@ -1112,30 +1112,42 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, - inst->src[1] = brw_imm_ud(0); - } else if (surface_handle.file != BAD_FILE) { - /* Bindless surface */ -+ const fs_builder ubld = bld.group(1, 0).exec_all(); - assert(devinfo->ver >= 9); - inst->desc = brw_sampler_desc(devinfo, - GFX9_BTI_BINDLESS, - sampler.file == IMM ? sampler.ud % 16 : 0, - msg_type, - simd_mode, - 0 /* return_format unused on gfx7+ */); - - /* For bindless samplers, the entire address is included in the message - * header so we can leave the portion in the message descriptor 0. - */ - if (sampler_handle.file != BAD_FILE || sampler.file == IMM) { - inst->src[0] = brw_imm_ud(0); - } else { -- const fs_builder ubld = bld.group(1, 0).exec_all(); - fs_reg desc = ubld.vgrf(BRW_REGISTER_TYPE_UD); - ubld.SHL(desc, sampler, brw_imm_ud(8)); - inst->src[0] = desc; - } - -- /* We assume that the driver provided the handle in the top 20 bits so -- * we can use the surface handle directly as the extended descriptor. -+ /* We previously assumed that the driver provided the handle in the top -+ * 20 bits (leaving the bottom 12 bits at 0). But with extensions like -+ * VK_VALVE_mutable_descriptor_type, the application is more in control -+ * of the content of VkDescriptors which is where we store -+ * surface/sampler offsets. We experience GPU hangs because the -+ * application left an invalid value in the descriptor (probably used -+ * for another descriptor type than sampler) and the lower 12bits of the -+ * surface handle overlapping with the extended descriptor length make -+ * the HW hang. The following AND() clears those bits and fixes a hang -+ * in Age Of Empire 4. - */ -- inst->src[1] = retype(surface_handle, BRW_REGISTER_TYPE_UD); -+ fs_reg ex_desc = ubld.vgrf(BRW_REGISTER_TYPE_UD); -+ ubld.AND(ex_desc, -+ retype(surface_handle, BRW_REGISTER_TYPE_UD), -+ brw_imm_ud(INTEL_MASK(31, 12))); -+ inst->src[1] = component(ex_desc, 0); - } else { - /* Immediate portion of the descriptor */ - inst->desc = brw_sampler_desc(devinfo, diff --git a/extra/mesa/PKGBUILD b/extra/mesa/PKGBUILD index 8e00894cd..58b42ba20 100644 --- a/extra/mesa/PKGBUILD +++ b/extra/mesa/PKGBUILD @@ -14,24 +14,23 @@ highmem=1 pkgbase=mesa pkgname=('vulkan-mesa-layers' 'opencl-mesa' 'vulkan-radeon' 'vulkan-swrast' 'vulkan-broadcom' 'vulkan-panfrost' 'libva-mesa-driver' 'mesa-vdpau' 'mesa') pkgdesc="An open-source implementation of the OpenGL specification" -pkgver=22.2.3 +pkgver=22.3.1 pkgrel=1 arch=('x86_64') makedepends=('python-mako' 'libxml2' 'libx11' 'xorgproto' 'libdrm' 'libxshmfence' 'libxxf86vm' 'libxdamage' 'libvdpau' 'libva' 'wayland' 'wayland-protocols' 'zstd' 'elfutils' 'llvm' 'libomxil-bellagio' 'libclc' 'clang' 'libglvnd' 'libunwind' 'lm_sensors' 'libxrandr' 'systemd' 'valgrind' 'glslang' 'vulkan-icd-loader' 'directx-headers' 'cmake' 'meson') +makedepends+=('rust' 'rust-bindgen' 'spirv-tools' 'spirv-llvm-translator') # rusticl dependencies url="https://www.mesa3d.org/" license=('custom') options=('debug' '!lto') source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig} 0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch - 0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch LICENSE) -sha512sums=('08e9ce43392c46f9c0d122d70e118511eea81422d06f93ab6d330689b46feed3ac1c3bdcdcfd4a27cd5b9eaf26aab518d152a2c753f07b8ed19575d4ed892ad6' +sha512sums=('8a7aee67f6351de293d23425229eb7c42d6918fe9ffb46c6e5df9609f79633c98ab78e892507fe48055c51fa88bf103d7b7baa58e826b1758f66067048baed5b' 'SKIP' - '9bf47019a7c1da6724393cf571c6e1ce6b56ca24fe32045bc056d2e1bb2584f6a81e886dd8b2f1b1aabb953367dd068f9833f520fa41a9b2bbce20fdc15d07b4' - '3df104f4abbecb12fcf9631cabdc7fe883b6c529abebaf36a0d47933ebd0c57235f11767060604dec71acefdf55f2f025eb997b1dd1cf0b92c02af0a604cae98' + 'ccdc1e367262338073b078f80795143026d08fa3fb720afda968907e1b4fa3b12e44edb441d3e17f6836f631319d1f1c3112699bea67014c3cf911fb9a816a3b' 'f9f0d0ccf166fe6cb684478b6f1e1ab1f2850431c06aa041738563eb1808a004e52cdec823c103c9e180f03ffc083e95974d291353f0220fe52ae6d4897fecc7') validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov '946D09B5E4C9845E63075FF1D961C596A7203456' # Andres Gomez @@ -47,7 +46,6 @@ prepare() { # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17247 # https://github.com/HansKristian-Work/vkd3d-proton/issues/1200 patch -Np1 -i ../0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch - patch -Np1 -i ../0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch } build() { @@ -71,12 +69,13 @@ build() { -D egl=enabled \ -D gallium-extra-hud=true \ -D gallium-nine=true \ + -D gallium-rusticl=true \ + -D rust_std=2021 \ -D gallium-omx=bellagio \ -D gallium-opencl=icd \ -D gallium-va=enabled \ -D gallium-vdpau=enabled \ -D gallium-xa=disabled \ - -D gallium-xvmc=disabled \ -D gbm=enabled \ -D gles1=disabled \ -D gles2=enabled \ @@ -127,7 +126,7 @@ package_vulkan-mesa-layers() { } package_opencl-mesa() { - pkgdesc="OpenCL support for AMD/ATI Radeon mesa drivers" + pkgdesc="OpenCL support with clover and rusticl for mesa drivers" depends=('libdrm' 'libclc' 'clang' 'expat') optdepends=('opencl-headers: headers necessary for OpenCL development') provides=('opencl-driver')