From 8279bb4ec78568a34c4102e723df170b49fb7c33 Mon Sep 17 00:00:00 2001 From: Prike Liang Date: Tue, 20 Oct 2020 15:58:30 +0800 Subject: drm/amd/pm: add gfx_state_change_set() for rn gfx power switch (v2) The gfx_state_change_set() funtion can support set GFX power change status to D0/D3. v2: make sure to register callback (Alex) Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c') diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c index 380dd3a1baf4..cd2c676a2797 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -828,14 +828,14 @@ int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev) void amdgpu_gfx_state_change_set(struct amdgpu_device *adev, enum gfx_change_state state) { - - mutex_lock(&adev->pm.mutex); - - if (adev->powerplay.pp_funcs && - adev->powerplay.pp_funcs->gfx_state_change_set) + if (is_support_sw_smu(adev)) { + smu_gfx_state_change_set(&adev->smu, state); + } else { + mutex_lock(&adev->pm.mutex); + if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->gfx_state_change_set) ((adev)->powerplay.pp_funcs->gfx_state_change_set( - (adev)->powerplay.pp_handle, state)); - - mutex_unlock(&adev->pm.mutex); - + (adev)->powerplay.pp_handle, state)); + mutex_unlock(&adev->pm.mutex); + } } -- cgit v1.2.3