Skip to contentSkip to conversation

drm/amdgpu/vcn: set VCN5 power gating state to GATE on suspend

PATCH In review David (Ming Qiang) Wu 2 participants 2 messages May 9, 2024 – May 10, 2024

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

PATCH 1/1 drm/amdgpu/vcn: set VCN5 power gating state to GATE on suspend

On suspend, we need to set power gating state to GATE when VCN5 is busy, otherwise we will get following error on resume:

[drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring vcn_unified_0 test failed (-110) [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <vcn_v5_0_0> failed -110
amdgpu: amdgpu_device_ip_resume failed (-110).
PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -110
PM: failed to resume async: error -110

---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +7 -0
index 9b87d6a49b39..36d4ca645c56 100644
@@ -229,6 +229,13 @@ static int vcn_v5_0_0_hw_fini(void *handle)
 	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
 		if (adev->vcn.harvest_config & (1 << i))
 			continue;
+		if (!amdgpu_sriov_vf(adev)) {
+			if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) ||
+				(adev->vcn.cur_state != AMD_PG_STATE_GATE &&
+				RREG32_SOC15(VCN, i, regUVD_STATUS))) {
+				vcn_v5_0_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
+			}
+		}
 	}
 
 	return 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 50 lines

-----Original Message-----
From: Wu, David <[email protected]>
Sent: Thursday, May 9, 2024 3:59 PM
To: [email protected]; Koenig, Christian <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Liu, Leo <[email protected]>; Jiang, Sonny <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn: set VCN5 power gating state to GATE on suspend

On suspend, we need to set power gating state to GATE when VCN5 is busy, otherwise we will get following error on resume:

[drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring vcn_unified_0 test failed (-110)
[drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block <vcn_v5_0_0> failed -110
amdgpu: amdgpu_device_ip_resume failed (-110).
PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -110
PM: failed to resume async: error -110

---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2 -0
index 9b87d6a49b39..36d4ca645c56 100644
@@ -229,6 +229,13 @@ static int vcn_v5_0_0_hw_fini(void *handle)
      for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
              if (adev->vcn.harvest_config & (1 << i))
                      continue;
+             if (!amdgpu_sriov_vf(adev)) {
+                     if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)
||
+                             (adev->vcn.cur_state !=

AMD_PG_STATE_GATE &&

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2 -0
+                             RREG32_SOC15(VCN, i, regUVD_STATUS))) {
+                             vcn_v5_0_0_set_powergating_state(adev,

AMD_PG_STATE_GATE);

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +2 -1
+                     }
+             }
      }
 
      return 0;
--

2.34.1