summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorKenneth Feng <kenneth.feng@amd.com>2019-03-28 10:54:16 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-06-21 18:59:25 -0500
commitacbcc111ce1075eb00a755be2ffca1bfbe1fd549 (patch)
tree01d1a3d3f0d1221a15ab2ad7e71570ec2562ea64 /drivers/gpu
parent9e04021602e758bc42e15c9f8c87b196ecf9c6ef (diff)
drm/amd/powerplay: gfxoff-seperate the Vega20 case
seperate the Vega20 case from navi10 for gfxoff so that gfxoff won't be allowed on Vega20 Signed-off-by: Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v11_0.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index d8379e421848..3934fcb38d42 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1550,13 +1550,24 @@ smu_v11_0_set_watermarks_for_clock_ranges(struct smu_context *smu, struct
static int smu_v11_0_gfx_off_control(struct smu_context *smu, bool enable)
{
int ret = 0;
+ struct amdgpu_device *adev = smu->adev;
- mutex_lock(&smu->mutex);
- if (enable)
- ret = smu_send_smc_msg(smu, SMU_MSG_AllowGfxOff);
- else
- ret = smu_send_smc_msg(smu, SMU_MSG_DisallowGfxOff);
- mutex_unlock(&smu->mutex);
+ switch (adev->asic_type) {
+ case CHIP_VEGA20:
+ break;
+ case CHIP_NAVI10:
+ if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
+ return 0;
+ mutex_lock(&smu->mutex);
+ if (enable)
+ ret = smu_send_smc_msg(smu, SMU_MSG_AllowGfxOff);
+ else
+ ret = smu_send_smc_msg(smu, SMU_MSG_DisallowGfxOff);
+ mutex_unlock(&smu->mutex);
+ break;
+ default:
+ break;
+ }
return ret;
}