diff options
| author | Prike Liang <Prike.Liang@amd.com> | 2020-10-20 15:58:30 +0800 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2020-11-13 17:29:45 -0500 | 
| commit | 8279bb4ec78568a34c4102e723df170b49fb7c33 (patch) | |
| tree | 7399ac676b1c9b552dd77d4d1401bddd5c9a161f /drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | |
| parent | 628c36d7b238e2d72158e8aba229ec79c69c157e (diff) | |
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 <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 18 | 
1 files changed, 9 insertions, 9 deletions
| 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); +	}  } | 
