Mesa (master): radv: allow launching waves out-of-order for compute

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Mon Oct 9 08:14:33 UTC 2017


Module: Mesa
Branch: master
Commit: aab1537568475fefcf2981c87a7b1689f655a4e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aab1537568475fefcf2981c87a7b1689f655a4e7

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Oct  6 16:03:15 2017 +0200

radv: allow launching waves out-of-order for compute

Ported from RadeonSI, and -pro seems to enable it as well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Acked-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_cmd_buffer.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 4b41b358e9..3f6945bfea 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3216,7 +3216,15 @@ radv_emit_dispatch_packets(struct radv_cmd_buffer *cmd_buffer,
 		}
 	} else {
 		unsigned blocks[3] = { info->blocks[0], info->blocks[1], info->blocks[2] };
-		unsigned dispatch_initiator = S_00B800_COMPUTE_SHADER_EN(1);
+		unsigned dispatch_initiator = S_00B800_COMPUTE_SHADER_EN(1) |
+					      S_00B800_FORCE_START_AT_000(1);
+
+		if (cmd_buffer->device->physical_device->rad_info.chip_class >= CIK) {
+			/* If the KMD allows it (there is a KMD hw register for
+			 * it), allow launching waves out-of-order.
+			 */
+			dispatch_initiator |= S_00B800_ORDER_MODE(1);
+		}
 
 		if (info->unaligned) {
 			unsigned *cs_block_size = compute_shader->info.cs.block_size;




More information about the mesa-commit mailing list