aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
diff options
context:
space:
mode:
authorKenneth Feng <[email protected]>2019-03-27 03:46:31 +0000
committerAlex Deucher <[email protected]>2019-06-21 23:59:25 +0000
commitbca325280d1f17a84a8af70cb840ab5fcdb8d062 (patch)
tree21771fda35cd62058f14843025654407045a3871 /drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
parentdrm/amd/powerplay: add allowed feature mask for navi10 (diff)
downloadkernel-bca325280d1f17a84a8af70cb840ab5fcdb8d062.tar.gz
kernel-bca325280d1f17a84a8af70cb840ab5fcdb8d062.zip
drm/amd: add gfxoff support on navi10
add the gfxoff interface to navi10,it's disabled by default. Signed-off-by: Kenneth Feng <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
index 523b8ab6b04e..b5397135c417 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
@@ -920,3 +920,23 @@ int amdgpu_dpm_get_mclk(struct amdgpu_device *adev, bool low)
else
return (adev)->powerplay.pp_funcs->get_mclk((adev)->powerplay.pp_handle, (low));
}
+
+int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block_type, bool gate)
+{
+ int ret = 0;
+ bool swsmu = is_support_sw_smu(adev);
+
+ switch (block_type) {
+ case AMD_IP_BLOCK_TYPE_GFX:
+ if (swsmu)
+ ret = smu_gfx_off_control(&adev->smu, gate);
+ else
+ ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu(
+ (adev)->powerplay.pp_handle, block_type, gate));
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}