Skip to content

Commit

Permalink
include dispatch and update
Browse files Browse the repository at this point in the history
  • Loading branch information
BoukeHaarsma23 committed Dec 13, 2023
1 parent 958dff4 commit 4081efd
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ jobs:
run: |
pacman -S --noconfirm $(sed -n -e 's/^[[:space:]]*\(make\)\?depends\(_x86_64\)\? = \([[:alnum:][:punct:]]*\)[[:space:]]*$/\3/p' /home/build/lib32-mesa/.SRCINFO)
pacman --noconfirm -U --overwrite '*' /tmp/mesa-chimeraos/*.pkg.tar.zst --ask=4
- name: Downgrade meson
run: |
pacman -S --noconfirm wget
wget https://archive.archlinux.org/packages/m/meson/meson-1.2.3-1-any.pkg.tar.zst
pacman -U --noconfirm meson-1.2.3-1-any.pkg.tar.zst
- name: Build lib32-mesa-chimeraos package
id: build-lib32-mesa-package
shell: bash
Expand Down
51 changes: 51 additions & 0 deletions common/0001-enable-dispatch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From d6d68ceda19a1fedfc0fc6d0532069708e3a7f46 Mon Sep 17 00:00:00 2001
From: Friedrich Vock <[email protected]>
Date: Fri, 1 Dec 2023 15:18:44 +0100
Subject: [PATCH] radv: Enable compute dispatch tunneling

Compute tunneling can considerably lower the latency of high-priority
compute work. Enabling it is beneficial in cases where high-priority
work is dispatched while the GPU is already busy with other work (e.g.
rendering on GFX). This is the case in VR compositors that dispatch
latency-sensitive compositing work to ACE while GFX is busy rendering
the next frame.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26462>
---
src/amd/vulkan/radv_device.c | 7 +++++++
src/amd/vulkan/si_cmd_buffer.c | 2 ++
2 files changed, 9 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index ec9d485fcf828..5bda530d369fc 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -988,6 +988,13 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
*/
device->dispatch_initiator |= S_00B800_ORDER_MODE(1);
}
+ if (device->physical_device->rad_info.gfx_level >= GFX10) {
+ /* Enable asynchronous compute tunneling. The KMD restricts this feature
+ * to high-priority compute queues, so setting the bit on any other queue
+ * is a no-op. PAL always sets this bit as well.
+ */
+ device->dispatch_initiator |= S_00B800_TUNNEL_ENABLE(1);
+ }

/* Disable partial preemption for task shaders.
* The kernel may not support preemption, but PAL always sets this bit,
diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index 73f469c5bf6a9..caea3e1a10da1 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -113,6 +113,8 @@ si_emit_compute(struct radv_device *device, struct radeon_cmdbuf *cs)
radeon_emit(cs, 0); /* R_00B894_COMPUTE_USER_ACCUM_1 */
radeon_emit(cs, 0); /* R_00B898_COMPUTE_USER_ACCUM_2 */
radeon_emit(cs, 0); /* R_00B89C_COMPUTE_USER_ACCUM_3 */
+
+ radeon_set_sh_reg(cs, R_00B9F4_COMPUTE_DISPATCH_TUNNEL, 0);
}

/* This register has been moved to R_00CD20_COMPUTE_MAX_WAVE_ID
--
GitLab
1 change: 1 addition & 0 deletions lib32-mesa/0001-enable-dispatch.patch
11 changes: 4 additions & 7 deletions lib32-mesa/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pkgname=(
'lib32-mesa'
)
_mesaver=23.3.0
pkgver=${_mesaver//-/.}.chos1
pkgver=${_mesaver//-/.}.chos2
pkgrel=1
pkgdesc="An open-source implementation of the OpenGL specification (32-bit)"
url="https://www.mesa3d.org/"
Expand Down Expand Up @@ -65,6 +65,7 @@ makedepends=(
source=(
https://mesa.freedesktop.org/archive/mesa-${_mesaver}.tar.xz{,.sig}
LICENSE
0001-enable-dispatch.patch
0001-STEAMOS-Dynamic-swapchain-override-for-gamescope-lim.patch
0001-vulkan-wsi-wayland-refactor-wayland-dispatch-code.patch
0002-vulkan-wsi-wayland-Use-commit_timing-commit_queue-pr.patch
Expand All @@ -75,6 +76,7 @@ source=(
sha256sums=('50f729dd60ed6335b989095baad81ef5edf7cfdd4b4b48b9b955917cb07d69c5'
'SKIP'
'7052ba73bb07ea78873a2431ee4e828f4e72bda7d176d07f770fa48373dec537'
'9baf7950185b6cc6de22b77dcc562145460e859a4a700510e1c38496a6c4342f'
'6a7ade8c331e2e98c3945aa71df0e928e60e4180750844b601e6332b3278cb12'
'f134e115ac10aa51970d247b6363d21b9302aec5c80c4189c79292f040e0bc72'
'2666c2b41afaf72e317d14ea2bfb3cc256ab253ae357b38d07ad2113de1a0ff5'
Expand All @@ -83,6 +85,7 @@ sha256sums=('50f729dd60ed6335b989095baad81ef5edf7cfdd4b4b48b9b955917cb07d69c5'
b2sums=('1b87d15cbe1b4c761653b7042c46eac3036f08dfcf3a0a81aa7bf6c1c0c402b05f37ce8da9d88df72e1745d66a648c2b8c161b04bf558107f548f6d8167cc798'
'SKIP'
'1ecf007b82260710a7bf5048f47dd5d600c168824c02c595af654632326536a6527fbe0738670ee7b921dd85a70425108e0f471ba85a8e1ca47d294ad74b4adb'
'03a52b1b01682e3cafd5b53b1673d1c5579fabcb3988316b18a2e9c2952b60d8db5f30aac25b94f95fdace39f49981e8022fe92d30512deab2208ebbde47e837'
'26b748638849549727bd36d7eeffd44348de7da296cfc67c5f9fabfeb3a4682dc7a1cad96379176b3820951c640e9f7d0f2c55cad6374c599c1a747423c84051'
'b85a41fbf8504bce6207ab007603fac88353e986b8bdbbe72ba81a1e76b8714b39862a0335a6943cecdcfd3ef2e8974b1038c2c5a5c9265fc7c6a0970e151a04'
'8441d2a028cff6a6c5ccca3515ea2ae8a14b3cc0bf6c2acfc8b7e8a57645a3b0b4bbfa3a5195048e65cd970c803e9b12fbc2d7effb619044fa51643a681082d1'
Expand Down Expand Up @@ -158,12 +161,6 @@ build() {
arch-meson mesa-$_mesaver build "${meson_options[@]}"
meson configure build # Print config

# Evil: Hack build to make proc-macro crate native
sed -e '/^rule rust_COMPILER$/irule rust_HACK\n command = rustc -C linker=gcc $ARGS $in\n deps = gcc\n depfile = $targetdep\n description = Compiling native Rust source $in\n' \
-e '/^build src\/gallium\/frontends\/rusticl\/librusticl_proc_macros\.so:/s/rust_COMPILER/rust_HACK/' \
-e '/^ LINK_ARGS =/s/ src\/gallium\/frontends\/rusticl\/librusticl_proc_macros\.so//' \
-i build/build.ninja

meson compile -C build

# fake installation to be seperated into packages
Expand Down
1 change: 1 addition & 0 deletions mesa/0001-enable-dispatch.patch
5 changes: 4 additions & 1 deletion mesa/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pkgname=(
'mesa'
)
_mesaver=23.3.0
pkgver=${_mesaver//-/.}.chos1
pkgver=${_mesaver//-/.}.chos2
pkgrel=1
pkgdesc="An open-source implementation of the OpenGL specification"
url="https://www.mesa3d.org/"
Expand Down Expand Up @@ -74,6 +74,7 @@ makedepends=(
source=(
https://mesa.freedesktop.org/archive/mesa-${_mesaver}.tar.xz{,.sig}
LICENSE
0001-enable-dispatch.patch
0001-STEAMOS-Dynamic-swapchain-override-for-gamescope-lim.patch
0001-vulkan-wsi-wayland-refactor-wayland-dispatch-code.patch
0002-vulkan-wsi-wayland-Use-commit_timing-commit_queue-pr.patch
Expand All @@ -83,6 +84,7 @@ source=(
sha256sums=('50f729dd60ed6335b989095baad81ef5edf7cfdd4b4b48b9b955917cb07d69c5'
'SKIP'
'7052ba73bb07ea78873a2431ee4e828f4e72bda7d176d07f770fa48373dec537'
'9baf7950185b6cc6de22b77dcc562145460e859a4a700510e1c38496a6c4342f'
'6a7ade8c331e2e98c3945aa71df0e928e60e4180750844b601e6332b3278cb12'
'f134e115ac10aa51970d247b6363d21b9302aec5c80c4189c79292f040e0bc72'
'2666c2b41afaf72e317d14ea2bfb3cc256ab253ae357b38d07ad2113de1a0ff5'
Expand All @@ -91,6 +93,7 @@ sha256sums=('50f729dd60ed6335b989095baad81ef5edf7cfdd4b4b48b9b955917cb07d69c5'
b2sums=('1b87d15cbe1b4c761653b7042c46eac3036f08dfcf3a0a81aa7bf6c1c0c402b05f37ce8da9d88df72e1745d66a648c2b8c161b04bf558107f548f6d8167cc798'
'SKIP'
'1ecf007b82260710a7bf5048f47dd5d600c168824c02c595af654632326536a6527fbe0738670ee7b921dd85a70425108e0f471ba85a8e1ca47d294ad74b4adb'
'03a52b1b01682e3cafd5b53b1673d1c5579fabcb3988316b18a2e9c2952b60d8db5f30aac25b94f95fdace39f49981e8022fe92d30512deab2208ebbde47e837'
'26b748638849549727bd36d7eeffd44348de7da296cfc67c5f9fabfeb3a4682dc7a1cad96379176b3820951c640e9f7d0f2c55cad6374c599c1a747423c84051'
'b85a41fbf8504bce6207ab007603fac88353e986b8bdbbe72ba81a1e76b8714b39862a0335a6943cecdcfd3ef2e8974b1038c2c5a5c9265fc7c6a0970e151a04'
'8441d2a028cff6a6c5ccca3515ea2ae8a14b3cc0bf6c2acfc8b7e8a57645a3b0b4bbfa3a5195048e65cd970c803e9b12fbc2d7effb619044fa51643a681082d1'
Expand Down

0 comments on commit 4081efd

Please sign in to comment.