From db0070208a816293fedbcb840d0103e69ebf1352 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 2 Jun 2026 03:41:44 +0000 Subject: [PATCH] drm/amdgpu/vpe: Force collaborate sync after TRAP From Alan Liu 3ed448c1dc78ddbf2e1f29dc00788c028ccdbb82 in linux-6.18.y/6.18.34 b6074630a461b1322a814988779005cbc43612ea in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_vpe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vpe.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vpe.c index 6b4fb21e995..b33bfe8bf64 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vpe.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vpe.c @@ -562,6 +562,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) @@ -970,7 +975,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,