aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorChengming Gui <Jack.Gui@amd.com>2019-01-14 01:37:31 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:03:59 -0400
commit16177fd053841dbfa8bfc3b698dcee7a0abe20cb (patch)
treee109163babf725bb77f257659ad73bfbe990dc4d /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parentc9ff9d8ee3c6832f8a203fffbc710ab4b177ceda (diff)
drm/amd/powerplay: implement pp_power_profile_mode sys inerface for SMU11
Add set/get power profile mode functions. Added dependency interfaces: 1) vega20_set_activity_monitor_coeff 2) vega20_get_activity_monitor_coeff 3) conv_power_profile_to_pplib_workload Signed-off-by: Chengming Gui <Jack.Gui@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index f36e86b11880..694d85b0f0a0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1135,7 +1135,9 @@ static ssize_t amdgpu_get_pp_power_profile_mode(struct device *dev,
1135 struct drm_device *ddev = dev_get_drvdata(dev); 1135 struct drm_device *ddev = dev_get_drvdata(dev);
1136 struct amdgpu_device *adev = ddev->dev_private; 1136 struct amdgpu_device *adev = ddev->dev_private;
1137 1137
1138 if (adev->powerplay.pp_funcs->get_power_profile_mode) 1138 if (is_support_sw_smu(adev))
1139 return smu_get_power_profile_mode(&adev->smu, buf);
1140 else if (adev->powerplay.pp_funcs->get_power_profile_mode)
1139 return amdgpu_dpm_get_power_profile_mode(adev, buf); 1141 return amdgpu_dpm_get_power_profile_mode(adev, buf);
1140 1142
1141 return snprintf(buf, PAGE_SIZE, "\n"); 1143 return snprintf(buf, PAGE_SIZE, "\n");
@@ -1185,9 +1187,10 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
1185 } 1187 }
1186 } 1188 }
1187 parameter[parameter_size] = profile_mode; 1189 parameter[parameter_size] = profile_mode;
1188 if (adev->powerplay.pp_funcs->set_power_profile_mode) 1190 if (is_support_sw_smu(adev))
1191 ret = smu_set_power_profile_mode(&adev->smu, parameter, parameter_size);
1192 else if (adev->powerplay.pp_funcs->set_power_profile_mode)
1189 ret = amdgpu_dpm_set_power_profile_mode(adev, parameter, parameter_size); 1193 ret = amdgpu_dpm_set_power_profile_mode(adev, parameter, parameter_size);
1190
1191 if (!ret) 1194 if (!ret)
1192 return count; 1195 return count;
1193fail: 1196fail: