Skip to contentSkip to conversation

drm/amd/powerplay: revise the outputs layout of amdgpu_pm_info debugfs

PATCH In review Evan Quan 2 participants 3 messages Jul 14, 2020 – Jul 24, 2020

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: revise the outputs layout of amdgpu_pm_info debugfs

The current outputs of amdgpu_pm_info debugfs come with clock gating status and followed by current clock/power information. However the clock gating status retrieving may pull GFX out of CG status. That will make the succeeding clock/power information retrieving inaccurate.

To overcome this and be with minimum impact, the outputs are updated to show current clock/power information first.

Change-Id Iff762d47ef0cc9ed309e805b1709ec8cb293d21f
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +8 -5
index 20f39aa04fb9..2d379c00c138 100644
@@ -3879,11 +3879,6 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 		return r;
 	}
 
-	amdgpu_device_ip_get_clockgating_state(adev, &flags);
-	seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
-	amdgpu_parse_cg_state(m, flags);
-	seq_printf(m, "\n");
-
 	if (!adev->pm.dpm_enabled) {
 		seq_printf(m, "dpm not enabled\n");
 		pm_runtime_mark_last_busy(dev->dev);
@@ -3903,7 +3898,15 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 	} else {
 		r = amdgpu_debugfs_pm_info_pp(m, adev);
 	}
+	if (r)
+		goto out;
+
+	amdgpu_device_ip_get_clockgating_state(adev, &flags);
+	seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
+	amdgpu_parse_cg_state(m, flags);
+	seq_printf(m, "\n");
 
+out:
 	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
Signature · 6 lines
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

Ping..

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, July 14, 2020 3:27 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: revise the outputs layout of amdgpu_pm_info debugfs

The current outputs of amdgpu_pm_info debugfs come with clock gating status and followed by current clock/power information. However the clock gating status retrieving may pull GFX out of CG status. That will make the succeeding clock/power information retrieving inaccurate.

To overcome this and be with minimum impact, the outputs are updated to show current clock/power information first.

Change-Id Iff762d47ef0cc9ed309e805b1709ec8cb293d21f
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +8 -5
index 20f39aa04fb9..2d379c00c138 100644
@@ -3879,11 +3879,6 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 return r;
 }
 
-amdgpu_device_ip_get_clockgating_state(adev, &flags);
-seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
-amdgpu_parse_cg_state(m, flags);
-seq_printf(m, "\n");
-
 if (!adev->pm.dpm_enabled) {
 seq_printf(m, "dpm not enabled\n");
 pm_runtime_mark_last_busy(dev->dev);
@@ -3903,7 +3898,15 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 } else {
 r = amdgpu_debugfs_pm_info_pp(m, adev);
 }
+if (r)
+goto out;
+
+amdgpu_device_ip_get_clockgating_state(adev, &flags);
+seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
+amdgpu_parse_cg_state(m, flags);
+seq_printf(m, "\n");
 
+out:
 pm_runtime_mark_last_busy(dev->dev);
 pm_runtime_put_autosuspend(dev->dev);
 

--
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#2 lore raw
Quoted 4 lines · Evan

[AMD Official Use Only - Internal Distribution Only]

Ping..

Whoops, missed this one.

Quoted 57 lines

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, July 14, 2020 3:27 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: revise the outputs layout of amdgpu_pm_info debugfs

The current outputs of amdgpu_pm_info debugfs come with clock gating status and followed by current clock/power information. However the clock gating status retrieving may pull GFX out of CG status. That will make the succeeding clock/power information retrieving inaccurate.

To overcome this and be with minimum impact, the outputs are updated to show current clock/power information first.

Change-Id Iff762d47ef0cc9ed309e805b1709ec8cb293d21f
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +8 -6
index 20f39aa04fb9..2d379c00c138 100644
@@ -3879,11 +3879,6 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 return r;
 }
 
-amdgpu_device_ip_get_clockgating_state(adev, &flags);
-seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
-amdgpu_parse_cg_state(m, flags);
-seq_printf(m, "\n");
-
 if (!adev->pm.dpm_enabled) {
 seq_printf(m, "dpm not enabled\n");
 pm_runtime_mark_last_busy(dev->dev);
@@ -3903,7 +3898,15 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
 } else {
 r = amdgpu_debugfs_pm_info_pp(m, adev);
 }
+if (r)
+goto out;
+
+amdgpu_device_ip_get_clockgating_state(adev, &flags);
+seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
+amdgpu_parse_cg_state(m, flags);
+seq_printf(m, "\n");
 
+out:
 pm_runtime_mark_last_busy(dev->dev);
 pm_runtime_put_autosuspend(dev->dev);
 
--

2.27.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx