Skip to contentSkip to conversation

drm/amd: Turn off doorbell for vcn 4.0.5

PATCH In review Mario Limonciello 2 participants 2 messages May 10, 2025 – May 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: Turn off doorbell for vcn 4.0.5

From: Mario Limonciello <[email protected]>

On VCN 4.0.5 using a doorbell to notify VCN hardware for WPTR changes while dynamic power gating is enabled introduces a timing dependency that can sometimes cause WPTR to not be properly updated. This manifests as a job timeout which will trigger a VCN reset and cause the application that submitted the job to crash.

Writing directly to the WPTR register instead of using the doorbell changes the timing enough that the issue doesn't happen. Turn off doorbell use for now while the issue continues to be debugged.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +1 -1
index ba603b2246e2e..ea9513f65d7e4 100644
@@ -181,7 +181,7 @@ static int vcn_v4_0_5_sw_init(struct amdgpu_ip_block *ip_block)
 			return r;
 
 		ring = &adev->vcn.inst[i].ring_enc[0];
-		ring->use_doorbell = true;
+		ring->use_doorbell = false;
 		if (amdgpu_sriov_vf(adev))
 			ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
 						i * (adev->vcn.inst[i].num_enc_rings + 1) + 1;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 26 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

On VCN 4.0.5 using a doorbell to notify VCN hardware for WPTR changes while dynamic power gating is enabled introduces a timing dependency that can sometimes cause WPTR to not be properly updated. This manifests as a job timeout which will trigger a VCN reset and cause the application that submitted the job to crash.

Writing directly to the WPTR register instead of using the doorbell changes the timing enough that the issue doesn't happen. Turn off doorbell use for now while the issue continues to be debugged.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +0 -0
index ba603b2246e2e..ea9513f65d7e4 100644

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c static int vcn_v4_0_5_sw_init(struct amdgpu_ip_block *ip_block) · line 187

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +1 -1
@@ -181,7 +181,7 @@ static int vcn_v4_0_5_sw_init(struct amdgpu_ip_block *ip_block)
  			return r;
 
  		ring = &adev->vcn.inst[i].ring_enc[0];
-		ring->use_doorbell = true;
+		ring->use_doorbell = false;
  		if (amdgpu_sriov_vf(adev))
  			ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
  						i * (adev->vcn.inst[i].num_enc_rings + 1) + 1;

Although this is confirmed to help the issue David found the correct solution. I expect he'll submit that this week and it will supersede my patch.

https://gitlab.freedesktop.org/-/project/176/uploads/defeac39ec232976c7c82aab151bfe63/0001-drm-amdgpu-read-back-DB_CTRL-register-after-write-fo.patch