diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-10-18 22:46:53 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-10-24 21:04:03 -0400 |
commit | 7179d24040d66de22e4710e943256be9e1045feb (patch) | |
tree | 057355430d6663577ad36f1b8bca8a037c45a099 /drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |
parent | 6f059c641b31076248ba89d0f7e0e753946a8099 (diff) |
drm/amdgpu: Fix null point error
need to check adev->powerplay.pp_funcs first, becasue from
AI, the smu ip can be disabled by user, and the pp_handle
is null in this case.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index 297a5490ad8c..0a4fba196b84 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |||
@@ -135,7 +135,8 @@ static int acp_poweroff(struct generic_pm_domain *genpd) | |||
135 | * 2. power off the acp tiles | 135 | * 2. power off the acp tiles |
136 | * 3. check and enter ulv state | 136 | * 3. check and enter ulv state |
137 | */ | 137 | */ |
138 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) | 138 | if (adev->powerplay.pp_funcs && |
139 | adev->powerplay.pp_funcs->set_powergating_by_smu) | ||
139 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); | 140 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); |
140 | } | 141 | } |
141 | return 0; | 142 | return 0; |
@@ -517,7 +518,8 @@ static int acp_set_powergating_state(void *handle, | |||
517 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 518 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
518 | bool enable = state == AMD_PG_STATE_GATE ? true : false; | 519 | bool enable = state == AMD_PG_STATE_GATE ? true : false; |
519 | 520 | ||
520 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) | 521 | if (adev->powerplay.pp_funcs && |
522 | adev->powerplay.pp_funcs->set_powergating_by_smu) | ||
521 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable); | 523 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable); |
522 | 524 | ||
523 | return 0; | 525 | return 0; |