[PATCH 23/27] drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset
Alex Deucher
alexander.deucher at amd.com
Fri Jun 13 21:47:44 UTC 2025
Re-emit the unprocessed state after resetting the queue.
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
index beca4d1e941b3..abdf0f9a5cd20 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
@@ -843,13 +843,21 @@ static int jpeg_v5_0_1_ring_reset(struct amdgpu_ring *ring,
if (amdgpu_sriov_vf(ring->adev))
return -EOPNOTSUPP;
+ amdgpu_ring_backup_unprocessed_commands(ring, guilty_fence);
jpeg_v5_0_1_core_stall_reset(ring);
jpeg_v5_0_1_init_jrbc(ring);
- r = amdgpu_ring_test_helper(ring);
+ r = amdgpu_ring_test_ring(ring);
if (r)
return r;
- amdgpu_fence_driver_force_completion(ring);
+
+ /* signal the fence of the bad job */
+ amdgpu_fence_driver_guilty_force_completion(guilty_fence);
atomic_inc(&ring->adev->gpu_reset_counter);
+ r = amdgpu_ring_reemit_unprocessed_commands(ring);
+ if (r)
+ /* if we fail to reemit, force complete all fences */
+ amdgpu_fence_driver_force_completion(ring);
+
return 0;
}
--
2.49.0
More information about the amd-gfx
mailing list