mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 03:59:01 +07:00
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>
This commit is contained in:
parent
a225bf1c9c
commit
9ecbe7f506
@ -1075,6 +1075,8 @@ int amdgpu_set_clockgating_state(struct amdgpu_device *adev,
|
||||
int i, r = 0;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if (adev->ip_blocks[i].type == block_type) {
|
||||
r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev,
|
||||
state);
|
||||
@ -1093,6 +1095,8 @@ int amdgpu_set_powergating_state(struct amdgpu_device *adev,
|
||||
int i, r = 0;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if (adev->ip_blocks[i].type == block_type) {
|
||||
r = adev->ip_blocks[i].funcs->set_powergating_state((void *)adev,
|
||||
state);
|
||||
@ -1110,6 +1114,8 @@ int amdgpu_wait_for_idle(struct amdgpu_device *adev,
|
||||
int i, r;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if (adev->ip_blocks[i].type == block_type) {
|
||||
r = adev->ip_blocks[i].funcs->wait_for_idle((void *)adev);
|
||||
if (r)
|
||||
@ -1127,6 +1133,8 @@ bool amdgpu_is_idle(struct amdgpu_device *adev,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_block_status[i].valid)
|
||||
continue;
|
||||
if (adev->ip_blocks[i].type == block_type)
|
||||
return adev->ip_blocks[i].funcs->is_idle((void *)adev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user