diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-06-23 11:53:12 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 15:02:04 -0400 |
commit | 9ecbe7f506d36f7dfb7ce06b2c35b252fa6d6ed8 (patch) | |
tree | a7e83dbee3b6728dbe34645ea6e5cb2182f8a71c /drivers | |
parent | a225bf1c9ce91bb4284e37773ddf6fab54f66fba (diff) |
drm/amdgpu: skip invalid ip blocks in ip helpers
Skip IP blocks that are not enabled.
Reviewed-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index e3cfee18fa68..a1364778bd3b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1075,6 +1075,8 @@ int amdgpu_set_clockgating_state(struct amdgpu_device *adev, | |||
1075 | int i, r = 0; | 1075 | int i, r = 0; |
1076 | 1076 | ||
1077 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1077 | for (i = 0; i < adev->num_ip_blocks; i++) { |
1078 | if (!adev->ip_block_status[i].valid) | ||
1079 | continue; | ||
1078 | if (adev->ip_blocks[i].type == block_type) { | 1080 | if (adev->ip_blocks[i].type == block_type) { |
1079 | r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, | 1081 | r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, |
1080 | state); | 1082 | state); |
@@ -1093,6 +1095,8 @@ int amdgpu_set_powergating_state(struct amdgpu_device *adev, | |||
1093 | int i, r = 0; | 1095 | int i, r = 0; |
1094 | 1096 | ||
1095 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1097 | for (i = 0; i < adev->num_ip_blocks; i++) { |
1098 | if (!adev->ip_block_status[i].valid) | ||
1099 | continue; | ||
1096 | if (adev->ip_blocks[i].type == block_type) { | 1100 | if (adev->ip_blocks[i].type == block_type) { |
1097 | r = adev->ip_blocks[i].funcs->set_powergating_state((void *)adev, | 1101 | r = adev->ip_blocks[i].funcs->set_powergating_state((void *)adev, |
1098 | state); | 1102 | state); |
@@ -1110,6 +1114,8 @@ int amdgpu_wait_for_idle(struct amdgpu_device *adev, | |||
1110 | int i, r; | 1114 | int i, r; |
1111 | 1115 | ||
1112 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1116 | for (i = 0; i < adev->num_ip_blocks; i++) { |
1117 | if (!adev->ip_block_status[i].valid) | ||
1118 | continue; | ||
1113 | if (adev->ip_blocks[i].type == block_type) { | 1119 | if (adev->ip_blocks[i].type == block_type) { |
1114 | r = adev->ip_blocks[i].funcs->wait_for_idle((void *)adev); | 1120 | r = adev->ip_blocks[i].funcs->wait_for_idle((void *)adev); |
1115 | if (r) | 1121 | if (r) |
@@ -1127,6 +1133,8 @@ bool amdgpu_is_idle(struct amdgpu_device *adev, | |||
1127 | int i; | 1133 | int i; |
1128 | 1134 | ||
1129 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1135 | for (i = 0; i < adev->num_ip_blocks; i++) { |
1136 | if (!adev->ip_block_status[i].valid) | ||
1137 | continue; | ||
1130 | if (adev->ip_blocks[i].type == block_type) | 1138 | if (adev->ip_blocks[i].type == block_type) |
1131 | return adev->ip_blocks[i].funcs->is_idle((void *)adev); | 1139 | return adev->ip_blocks[i].funcs->is_idle((void *)adev); |
1132 | } | 1140 | } |