summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2026-05-15 09:56:07 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-06-17 15:51:33 -0400
commit930a915de89ce6b3ae4d1b902304df3b0fb507cc (patch)
tree2d3f1f25444cd9fbf243457bd4dd6b8f6711311d /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
parent52d4ab1ca790a668cc8f2c27017138b1c467168c (diff)
downloadlinux-next-930a915de89ce6b3ae4d1b902304df3b0fb507cc.tar.gz
linux-next-930a915de89ce6b3ae4d1b902304df3b0fb507cc.zip
drm/amdgpu: don't reemit if there is nothing to reemit
Return early in amdgpu_ring_set_fence_errors_and_reemit() if ring_backup_entries_to_copy is 0. That means that either the ring is idle and there is nothing to reemit, or there some reason why we should reemit, so return early and signal the fences (if applicable). Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index ea69b1bac7c6..6a43c8494fa8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -727,6 +727,15 @@ void amdgpu_ring_set_fence_errors_and_reemit(struct amdgpu_ring *ring,
last_seq = amdgpu_fence_read(ring) & ring->fence_drv.num_fences_mask;
seq = ring->fence_drv.sync_seq & ring->fence_drv.num_fences_mask;
+ /* If there is nothing to reemit, return early and set an error on the fence
+ * if applicable. If all of the fences are siganlled, this will be a nop.
+ * if there are still fences and ring_backup_entries_to_copy is 0, then
+ * we are skipping it on purpose.
+ */
+ if (!ring->ring_backup_entries_to_copy) {
+ amdgpu_fence_driver_force_completion(ring, &guilty_fence->base);
+ return;
+ }
ring->reemit = true;
amdgpu_ring_alloc(ring, ring->ring_backup_entries_to_copy);
spin_lock_irqsave(&ring->fence_drv.lock, flags);