Skip to contentSkip to conversation

drm/powerplay: enable dpm under pass-through

PATCH In review Yintian Tao 3 participants 3 messages Aug 20, 2018 – Aug 21, 2018 1 message not in the archive

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

PATCH 1/1 drm/powerplay: enable dpm under pass-through

Repeat enable dpm under pass-through because there is no actually hardware-fini and real power-off when guest vm shutdown or reboot. Otherwise, under pass-through it will be failed to populate populate and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count.

Change-Id I7cbc55c650867d00e19241ceea5d98f78b5ac3f5
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -1
index 53207e7..6ef3c87 100644
@@ -75,10 +75,12 @@ int phm_set_power_state(struct pp_hwmgr *hwmgr,
 
 int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
 {
+	struct amdgpu_device *adev = NULL;
 	int ret = -EINVAL;;
 	PHM_FUNC_CHECK(hwmgr);
+	adev = hwmgr->adev;
 
-	if (smum_is_dpm_running(hwmgr)) {
+	if (smum_is_dpm_running(hwmgr) && !amdgpu_passthrough(adev)) {
 		pr_info("dpm has been enabled\n");
 		return 0;
 	}
Signature · 6 lines
2.7.4

_______________________________________________
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): 1534736393-23259-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org

#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Yintian Tao <[email protected]>
Sent: Sunday, August 19, 2018 11:39:53 PM
To: [email protected]
Cc: Tao, Yintian
Subject: [PATCH] drm/powerplay: enable dpm under pass-through

Repeat enable dpm under pass-through because there is no actually hardware-fini and real power-off when guest vm shutdown or reboot. Otherwise, under pass-through it will be failed to populate populate and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count.

Change-Id I7cbc55c650867d00e19241ceea5d98f78b5ac3f5
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +3 -1
index 53207e7..6ef3c87 100644
@@ -75,10 +75,12 @@ int phm_set_power_state(struct pp_hwmgr *hwmgr,
 
 int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
 {
+       struct amdgpu_device *adev = NULL;
         int ret = -EINVAL;;
         PHM_FUNC_CHECK(hwmgr);
+       adev = hwmgr->adev;
 
-       if (smum_is_dpm_running(hwmgr)) {
+       if (smum_is_dpm_running(hwmgr) && !amdgpu_passthrough(adev)) {
                 pr_info("dpm has been enabled\n");
                 return 0;
         }

--
2.7.4

_______________________________________________
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

Acked-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 3 lines · Yintian Tao

Repeat enable dpm under pass-through because there is no actually hardware-fini and real power-off when guest vm shutdown or reboot. Otherwise, under pass-through it will be failed to populate populate

duplicate "populate"

Quoted 13 lines

and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count.

Change-Id I7cbc55c650867d00e19241ceea5d98f78b5ac3f5
---
  drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +0 -0
index 53207e7..6ef3c87 100644

drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c int phm_set_power_state(struct pp_hwmgr *hwmgr, · line 81

Quoted 7 lines
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +2 -0
@@ -75,10 +75,12 @@ int phm_set_power_state(struct pp_hwmgr *hwmgr,
 
  int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
  {
+	struct amdgpu_device *adev = NULL;
  	int ret = -EINVAL;;
  	PHM_FUNC_CHECK(hwmgr);
+	adev = hwmgr->adev;

It could be simplified as

   struct amdgpu_device *adev = hwmgr->adev;

or use that directly

amdgpu_passthrough(hwmgr->adev)

apart from that,

drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c int phm_set_power_state(struct pp_hwmgr *hwmgr,

Quoted 7 lines
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +1 -1
-	if (smum_is_dpm_running(hwmgr)) {
+	if (smum_is_dpm_running(hwmgr) && !amdgpu_passthrough(adev)) {
  		pr_info("dpm has been enabled\n");
  		return 0;
  	}
 

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