Skip to contentSkip to conversation

drm/amd/pm: Add mem_busy_percent for GCv9.4.3 apu

PATCH In review Asad Kamal 2 participants 2 messages Dec 22, 2023 – Jan 2, 2024

Subsystems (3)
lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Add mem_busy_percent for GCv9.4.3 apu

Expose sysfs entry mem_busy_percent for GC version 9.4.3 APU system

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +3 -1
index 2cd995b0ceba..f3cb490fe79b 100644
@@ -2168,7 +2168,9 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		if (amdgpu_dpm_is_overdrive_supported(adev))
 			*states = ATTR_STATE_SUPPORTED;
 	} else if (DEVICE_ATTR_IS(mem_busy_percent)) {
-		if (adev->flags & AMD_IS_APU || gc_ver == IP_VERSION(9, 0, 1))
+		if ((adev->flags & AMD_IS_APU &&
+		     gc_ver != IP_VERSION(9, 4, 3)) ||
+		    gc_ver == IP_VERSION(9, 0, 1))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pcie_bw)) {
 		/* PCIe Perf counters won't work on APU nodes */
Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Asad Kamal

Expose sysfs entry mem_busy_percent for GC version 9.4.3 APU system

Thanks,
Lijo

Quoted 19 lines
---
  drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +3 -1
index 2cd995b0ceba..f3cb490fe79b 100644
@@ -2168,7 +2168,9 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
  		if (amdgpu_dpm_is_overdrive_supported(adev))
  			*states = ATTR_STATE_SUPPORTED;
  	} else if (DEVICE_ATTR_IS(mem_busy_percent)) {
-		if (adev->flags & AMD_IS_APU || gc_ver == IP_VERSION(9, 0, 1))
+		if ((adev->flags & AMD_IS_APU &&
+		     gc_ver != IP_VERSION(9, 4, 3)) ||
+		    gc_ver == IP_VERSION(9, 0, 1))
  			*states = ATTR_STATE_UNSUPPORTED;
  	} else if (DEVICE_ATTR_IS(pcie_bw)) {
  		/* PCIe Perf counters won't work on APU nodes */