drm/amd/powerplay: create pp_od_clk_voltage device file under OD support
Since pp_od_clk_voltage device file is for OD related sysfs operations. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
8139d493da
commit
0624e145fb
|
@ -2008,6 +2008,7 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
|
||||||
|
|
||||||
int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
|
int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
|
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (adev->pm.sysfs_initialized)
|
if (adev->pm.sysfs_initialized)
|
||||||
|
@ -2091,12 +2092,14 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
|
||||||
"pp_power_profile_mode\n");
|
"pp_power_profile_mode\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = device_create_file(adev->dev,
|
if (hwmgr->od_enabled) {
|
||||||
&dev_attr_pp_od_clk_voltage);
|
ret = device_create_file(adev->dev,
|
||||||
if (ret) {
|
&dev_attr_pp_od_clk_voltage);
|
||||||
DRM_ERROR("failed to create device file "
|
if (ret) {
|
||||||
"pp_od_clk_voltage\n");
|
DRM_ERROR("failed to create device file "
|
||||||
return ret;
|
"pp_od_clk_voltage\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ret = device_create_file(adev->dev,
|
ret = device_create_file(adev->dev,
|
||||||
&dev_attr_gpu_busy_percent);
|
&dev_attr_gpu_busy_percent);
|
||||||
|
@ -2118,6 +2121,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
|
||||||
|
|
||||||
void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
|
void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
|
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
|
||||||
|
|
||||||
if (adev->pm.dpm_enabled == 0)
|
if (adev->pm.dpm_enabled == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2138,8 +2143,9 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
|
||||||
device_remove_file(adev->dev, &dev_attr_pp_mclk_od);
|
device_remove_file(adev->dev, &dev_attr_pp_mclk_od);
|
||||||
device_remove_file(adev->dev,
|
device_remove_file(adev->dev,
|
||||||
&dev_attr_pp_power_profile_mode);
|
&dev_attr_pp_power_profile_mode);
|
||||||
device_remove_file(adev->dev,
|
if (hwmgr->od_enabled)
|
||||||
&dev_attr_pp_od_clk_voltage);
|
device_remove_file(adev->dev,
|
||||||
|
&dev_attr_pp_od_clk_voltage);
|
||||||
device_remove_file(adev->dev, &dev_attr_gpu_busy_percent);
|
device_remove_file(adev->dev, &dev_attr_gpu_busy_percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue