Skip to contentSkip to conversation

drm/amd: Decrease message level for legacy-pm prints

PATCH Superseded Mario Limonciello 2 participants 2 messages Jun 18, 2025 – Jun 24, 2025

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: Decrease message level for legacy-pm prints

From: Mario Limonciello <[email protected]>

legacy-pm has prints while changing power states that don't have a level and thus are printed by default. These are not useful at runtime for most people, so decrease them to debug.

---
 drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c +6 -10
index c7518b13e7879..5b09c5fd9dc13 100644
@@ -123,14 +123,10 @@ void amdgpu_dpm_print_cap_info(u32 caps)
 void amdgpu_dpm_print_ps_status(struct amdgpu_device *adev,
 				struct amdgpu_ps *rps)
 {
-	printk("\tstatus:");
-	if (rps == adev->pm.dpm.current_ps)
-		pr_cont(" c");
-	if (rps == adev->pm.dpm.requested_ps)
-		pr_cont(" r");
-	if (rps == adev->pm.dpm.boot_ps)
-		pr_cont(" b");
-	pr_cont("\n");
+	drm_dbg(adev_to_drm(adev), "\tstatus:%s%s%s\n",
+		rps == adev->pm.dpm.current_ps ? " c" : "",
+		rps == adev->pm.dpm.requested_ps ? " r" : "",
+		rps == adev->pm.dpm.boot_ps ? " b" : "");
 }
 
 void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
@@ -943,9 +939,9 @@ static int amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
 		return -EINVAL;
 
 	if (amdgpu_dpm == 1 && pp_funcs->print_power_state) {
-		printk("switching from power state:\n");
+		drm_dbg(adev_to_drm(adev), "switching from power state\n");
 		amdgpu_dpm_print_power_state(adev, adev->pm.dpm.current_ps);
-		printk("switching to power state:\n");
+		drm_dbg(adev_to_drm(adev), "switching to power state\n");
 		amdgpu_dpm_print_power_state(adev, adev->pm.dpm.requested_ps);
 	}
 
Signature · 1 line
2.43.0
#1 lore raw

I think we need to also modify kv_dpm_print_power_state() and si_dpm_print_power_state(). Both send power state info through DRM_INFO, which should be decreased in the same way.

Quoted 52 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

legacy-pm has prints while changing power states that don't have a level and thus are printed by default. These are not useful at runtime for most people, so decrease them to debug.

---
 drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c +6 -11
index c7518b13e7879..5b09c5fd9dc13 100644
@@ -123,14 +123,10 @@ void amdgpu_dpm_print_cap_info(u32 caps)
 void amdgpu_dpm_print_ps_status(struct amdgpu_device *adev,
                                struct amdgpu_ps *rps)
 {
-       printk("\tstatus:");
-       if (rps == adev->pm.dpm.current_ps)
-               pr_cont(" c");
-       if (rps == adev->pm.dpm.requested_ps)
-               pr_cont(" r");
-       if (rps == adev->pm.dpm.boot_ps)
-               pr_cont(" b");
-       pr_cont("\n");
+       drm_dbg(adev_to_drm(adev), "\tstatus:%s%s%s\n",
+               rps == adev->pm.dpm.current_ps ? " c" : "",
+               rps == adev->pm.dpm.requested_ps ? " r" : "",
+               rps == adev->pm.dpm.boot_ps ? " b" : "");
 }
 
 void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
@@ -943,9 +939,9 @@ static int amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
                return -EINVAL;
 
        if (amdgpu_dpm == 1 && pp_funcs->print_power_state) {
-               printk("switching from power state:\n");
+               drm_dbg(adev_to_drm(adev), "switching from power state\n");
                amdgpu_dpm_print_power_state(adev, adev->pm.dpm.current_ps);
-               printk("switching to power state:\n");
+               drm_dbg(adev_to_drm(adev), "switching to power state\n");
                amdgpu_dpm_print_power_state(adev, adev->pm.dpm.requested_ps);
        }
 
--

2.43.0