diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-03-12 07:50:38 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-15 10:57:32 -0400 |
commit | 5771632723aea8a7c994846b084bdb44000f82e6 (patch) | |
tree | 128ea55615d94b84b596f61925653702b57b4414 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 8e68627958f2fe9cf2f106656e007b8d3cd7cc47 (diff) |
drm/amdgpu: Plus NULL function pointer check
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Evan Quan <evan.quan@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_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7d7d30b8a719..a3e81e36a7ee 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1417,7 +1417,8 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev) | |||
1417 | continue; | 1417 | continue; |
1418 | /* skip CG for VCE/UVD, it's handled specially */ | 1418 | /* skip CG for VCE/UVD, it's handled specially */ |
1419 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && | 1419 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
1420 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { | 1420 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && |
1421 | adev->ip_blocks[i].version->funcs->set_clockgating_state) { | ||
1421 | /* enable clockgating to save power */ | 1422 | /* enable clockgating to save power */ |
1422 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, | 1423 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, |
1423 | AMD_CG_STATE_GATE); | 1424 | AMD_CG_STATE_GATE); |
@@ -1466,7 +1467,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) | |||
1466 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1467 | for (i = 0; i < adev->num_ip_blocks; i++) { |
1467 | if (!adev->ip_blocks[i].status.hw) | 1468 | if (!adev->ip_blocks[i].status.hw) |
1468 | continue; | 1469 | continue; |
1469 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) { | 1470 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC && |
1471 | adev->ip_blocks[i].version->funcs->set_clockgating_state) { | ||
1470 | /* ungate blocks before hw fini so that we can shutdown the blocks safely */ | 1472 | /* ungate blocks before hw fini so that we can shutdown the blocks safely */ |
1471 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, | 1473 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, |
1472 | AMD_CG_STATE_UNGATE); | 1474 | AMD_CG_STATE_UNGATE); |
@@ -1578,7 +1580,8 @@ int amdgpu_device_ip_suspend(struct amdgpu_device *adev) | |||
1578 | if (!adev->ip_blocks[i].status.valid) | 1580 | if (!adev->ip_blocks[i].status.valid) |
1579 | continue; | 1581 | continue; |
1580 | /* ungate blocks so that suspend can properly shut them down */ | 1582 | /* ungate blocks so that suspend can properly shut them down */ |
1581 | if (i != AMD_IP_BLOCK_TYPE_SMC) { | 1583 | if (i != AMD_IP_BLOCK_TYPE_SMC && |
1584 | adev->ip_blocks[i].version->funcs->set_clockgating_state) { | ||
1582 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, | 1585 | r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, |
1583 | AMD_CG_STATE_UNGATE); | 1586 | AMD_CG_STATE_UNGATE); |
1584 | if (r) { | 1587 | if (r) { |