From: Jesse Zhang <Jesse.Zhang@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Christian Koenig <christian.koenig@amd.com>,
Jesse Zhang <Jesse.Zhang@amd.com>
Subject: [PATCH i-g-t] lib/amdgpu: enable compute scratch two-hop test on gfx12
Date: Tue, 14 Jul 2026 10:24:28 +0800 [thread overview]
Message-ID: <20260714022459.948948-1-Jesse.Zhang@amd.com> (raw)
The kfdtest-style FlatScratchAccess two-hop scratch dispatch was gated to
gfx11 only, so amdgpu-scratch-test-compute-with-IP-COMPUTE-UQM ran empty
(vacuous SUCCESS) on gfx12. The shader (ScratchCopyDwordIsa) and the PM4
emitter already program the gfx12 scratch path (COMPUTE_DISPATCH_SCRATCH_BASE
HW-loads the read-only SCRATCH_BASE; shader uses s_setreg HW_REG_SCRATCH_BASE
and FLAT_*_NSS scope:SCOPE_SYS), and the kernel now exports dev_info.scratch_base
for gfx12. Un-gate version 12 and reuse the same emitter.
Verified on GFX12: two-hop round-trip returns dst==0x01010101,
using the kernel-reported aperture 0x0002000000000000, no faults/resets.
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
---
lib/amdgpu/compute_utils/amd_dispatch.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/amdgpu/compute_utils/amd_dispatch.c b/lib/amdgpu/compute_utils/amd_dispatch.c
index 926690f13..6f0d031a1 100644
--- a/lib/amdgpu/compute_utils/amd_dispatch.c
+++ b/lib/amdgpu/compute_utils/amd_dispatch.c
@@ -458,7 +458,7 @@ amdgpu_memcpy_dispatch_test(amdgpu_device_handle device_handle,
*/
#ifdef AMDGPU_LLVM_ENABLED
static void
-amdgpu_emit_scratch_dispatch_gfx11(struct amdgpu_cmd_base *base_cmd,
+amdgpu_emit_scratch_dispatch(struct amdgpu_cmd_base *base_cmd,
uint64_t mc_shader, uint64_t mc_scratch,
uint64_t arg_src, uint64_t arg_dst, uint32_t num_waves)
{
@@ -592,8 +592,8 @@ amdgpu_scratch_dispatch_test(amdgpu_device_handle device_handle,
uint8_t isa[4096];
size_t isa_size = 0;
- if (version != 11) {
- igt_info("SKIP scratch two-hop: gfx11 only, got %u\n", version);
+ if (version != 11 && version != 12) {
+ igt_info("SKIP scratch two-hop: gfx11/gfx12 only, got %u\n", version);
return 0;
}
@@ -676,7 +676,8 @@ amdgpu_scratch_dispatch_test(amdgpu_device_handle device_handle,
/* Generation-specific scratch dispatch packets */
switch (version) {
case 11:
- amdgpu_emit_scratch_dispatch_gfx11(cmd, mc_shader,
+ case 12:
+ amdgpu_emit_scratch_dispatch(cmd, mc_shader,
mc_scratch, arg_src, arg_dst, num_waves);
break;
default:
--
2.49.0
next reply other threads:[~2026-07-14 2:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 2:24 Jesse Zhang [this message]
2026-07-14 2:41 ` ✗ Fi.CI.BUILD: failure for lib/amdgpu: enable compute scratch two-hop test on gfx12 Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260714022459.948948-1-Jesse.Zhang@amd.com \
--to=jesse.zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=vitaly.prosyak@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox