]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu/vpe: Force collaborate sync after TRAP
authorAlan Liu <haoping.liu@amd.com>
Fri, 1 May 2026 04:35:48 +0000 (12:35 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 May 2026 22:09:45 +0000 (18:09 -0400)
VPE1 could possibly hang and fail to power off at the end of commands in
collaboration mode. This workaround adds a COLLAB_SYNC after TRAP to
force instances synchronized to avoid VPE1 fail to power off.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alan liu <haoping.liu@amd.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5171
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c

index 0a34a27d1106f51ae472c34e5f4ee335250e8012..60142049147744cf8b5b738d800ad38090ef0a50 100644 (file)
@@ -566,6 +566,11 @@ static void vpe_ring_emit_fence(struct amdgpu_ring *ring, uint64_t addr,
                amdgpu_ring_write(ring, 0);
        }
 
+       /* WA: Force sync after TRAP to avoid VPE1 fail to power off */
+       if (ring->adev->vpe.collaborate_mode) {
+               amdgpu_ring_write(ring, VPE_CMD_HEADER(VPE_CMD_OPCODE_COLLAB_SYNC, 0));
+               amdgpu_ring_write(ring, 0xabcd);
+       }
 }
 
 static void vpe_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
@@ -972,7 +977,7 @@ static const struct amdgpu_ring_funcs vpe_ring_funcs = {
        .emit_frame_size =
                5 + /* vpe_ring_init_cond_exec */
                6 + /* vpe_ring_emit_pipeline_sync */
-               10 + 10 + 10 + /* vpe_ring_emit_fence */
+               12 + 12 + 12 + /* vpe_ring_emit_fence */
                /* vpe_ring_emit_vm_flush */
                SOC15_FLUSH_GPU_TLB_NUM_WREG * 3 +
                SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 6,