Skip to contentSkip to conversation

drm/amdgpu/powerplay: return success if set_mp1_state is not set

PATCH In review Alex Deucher 2 participants 2 messages Jul 31, 2019 1 message not in the archive

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

PATCH 1/1 drm/amdgpu/powerplay: return success if set_mp1_state is not set

Some asics (APUs) don't have this callback so we want to return success. Avoids spurious error messages on APUs.

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -5
index 88a2ef75b7e1..2e3d9ef625bf 100644
@@ -931,12 +931,10 @@ static int pp_dpm_set_mp1_state(void *handle, enum pp_mp1_state mp1_state)
 	if (!hwmgr || !hwmgr->pm_en)
 		return -EINVAL;
 
-	if (hwmgr->hwmgr_func->set_mp1_state == NULL) {
-		pr_info_ratelimited("%s was not implemented.\n", __func__);
-		return -EINVAL;
-	}
+	if (hwmgr->hwmgr_func->set_mp1_state)
+		return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
 
-	return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
+	return 0;
 }
 
 static int pp_dpm_switch_power_profile(void *handle,
Signature · 6 lines
2.20.1

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

A message that is not in the archive (sent off-list or not yet received): 20190731023044.6828-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Evan Quan
#2 lore raw
Quoted 40 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, July 31, 2019 10:31 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/powerplay: return success if set_mp1_state is not set

Some asics (APUs) don't have this callback so we want to return success. Avoids spurious error messages on APUs.

---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -5
index 88a2ef75b7e1..2e3d9ef625bf 100644
@@ -931,12 +931,10 @@ static int pp_dpm_set_mp1_state(void *handle,
 enum pp_mp1_state mp1_state)
 	if (!hwmgr || !hwmgr->pm_en)
 		return -EINVAL;
 
-	if (hwmgr->hwmgr_func->set_mp1_state == NULL) {
-		pr_info_ratelimited("%s was not implemented.\n",
 __func__);
-		return -EINVAL;
-	}
+	if (hwmgr->hwmgr_func->set_mp1_state)
+		return hwmgr->hwmgr_func->set_mp1_state(hwmgr,
 mp1_state);
 
-	return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
+	return 0;

}

Quoted 8 lines

static int pp_dpm_switch_power_profile(void *handle,
--
2.20.1

_______________________________________________
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