Skip to contentSkip to conversation

drm/amd/pm: early return if disabling DPMS for GFX IP v11.5.2

PATCH In review Tim Huang 2 participants 2 messages Jul 15, 2024

Subsystems (3)
lore
Share & tools
lore

Tim Huang

author
#0 lore raw

PATCH 1/1 drm/amd/pm: early return if disabling DPMS for GFX IP v11.5.2

This was intended to add support for GFX IP v11.5.2, but it needs to be applied to all GFX11 and subsequent APUs. Therefore the code should be revised to accommodate this.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +4 -12
index d79bdb1e8cdf..06684e29db23 100644
@@ -1922,20 +1922,12 @@ static int smu_disable_dpms(struct smu_context *smu)
 	}
 
 	/*
-	 * For SMU 13.0.4/11 and 14.0.0, PMFW will handle the features disablement properly
+	 * For GFX11 and subsequent APUs, PMFW will handle the features disablement properly
 	 * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
 	 */
-	if (amdgpu_in_reset(adev) || adev->in_s0ix) {
-		switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
-		case IP_VERSION(13, 0, 4):
-		case IP_VERSION(13, 0, 11):
-		case IP_VERSION(14, 0, 0):
-		case IP_VERSION(14, 0, 1):
-			return 0;
-		default:
-			break;
-		}
-	}
+	if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) >= 11 &&
+	    smu->is_apu && (amdgpu_in_reset(adev) || adev->in_s0ix))
+		return 0;
 
 	/*
 	 * For gpu reset, runpm and hibernation through BACO,
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tim Huang

This was intended to add support for GFX IP v11.5.2, but it needs to be applied to all GFX11 and subsequent APUs. Therefore the code should be revised to accommodate this.

Quoted 36 lines
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +4 -13
index d79bdb1e8cdf..06684e29db23 100644
@@ -1922,20 +1922,12 @@ static int smu_disable_dpms(struct smu_context *smu)
        }
 
        /*
-        * For SMU 13.0.4/11 and 14.0.0, PMFW will handle the features disablement properly
+        * For GFX11 and subsequent APUs, PMFW will handle the features disablement properly
         * for gpu reset and S0i3 cases. Driver involvement is unnecessary.
         */
-       if (amdgpu_in_reset(adev) || adev->in_s0ix) {
-               switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
-               case IP_VERSION(13, 0, 4):
-               case IP_VERSION(13, 0, 11):
-               case IP_VERSION(14, 0, 0):
-               case IP_VERSION(14, 0, 1):
-                       return 0;
-               default:
-                       break;
-               }
-       }
+       if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) >= 11 &&
+           smu->is_apu && (amdgpu_in_reset(adev) || adev->in_s0ix))
+               return 0;
 
        /*
         * For gpu reset, runpm and hibernation through BACO,
--

2.43.0