[PATCH 0/2] drm/amdgpu: count both wave limit writes in gfx8/gfx9 compute frames
From: Eren Özen via B4 Relay
Date: Wed Dec 02 2026 - 21:06:35 EST
amdgpu_ib_schedule() emits the wave limit twice on high-priority compute
rings (set and restore, 20 dwords each), but the gfx8 and gfx9 compute
emit_frame_size count it once. This is the follow-up I offered under
the SPM VMID patch.
Patch 1 fixes gfx8, where the frame size has no spare room for the
missing 20 dwords. Patch 2 does the same for gfx9, where a generous TLB
flush reserve hides the shortfall today. Patch 2 has no Fixes: tag
because it needs the compute max_dw of 2048 from commit f0e06b8eb4bb
("drm/amdgpu/gfx9: make room for the SPM VMID write in the compute
rings") in amd-staging-drm-next (the patch text names it by title,
since the hash will change); on older trees it would trigger the max_dw
WARN. Patch 1 has Cc: stable # 6.5+ because older kernels lack the
192-IB limit from c30ddcece3a0, and the larger frame would lower the
largest compute job they accept.
gfx9.4.3 has the same single count, but I left it alone: counting both
calls there raises its compute worst case to 165 + 125 * 7 = 1040
dwords, 1280 after alignment, which is more than its max_dw of 1024, so
it would need a larger max_dw and, after rounding up to a power of two,
twice the ring memory. Its TLB flush reserve already covers the missing
20 dwords. I can send that change as well if you want the count to be
exact there too.
This also corrects my note under the SPM VMID patch: I wrote there that
on gfx9.4.3 two high-priority submissions in flight could overwrite each
other. That was wrong, because the TLB flush reserve covers the extra
wave limit dwords, so a submission never needs more than its
reservation. For the same reason the "writing more dwords" message I
mentioned there can only appear on gfx8.
I used an AI coding assistant to help analyse, test and draft these
patches.
---
Eren Özen (2):
drm/amdgpu/gfx8: count both wave limit writes in the compute frame size
drm/amdgpu/gfx9: count both wave limit writes in the compute frame size
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: f0e06b8eb4bb207e5742f9e1566621f0962878e0
change-id: 20261203-gfx9-wave-limit-f5f32d51b1f9
Best regards,
--
Eren Özen <erenozen@xxxxxxxxxxxxxx>