diff options
author | Yong Zhao <Yong.Zhao@amd.com> | 2019-11-07 23:18:04 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-11-19 09:47:02 -0500 |
commit | 84ce6c48675b55e937814e7c688c46ab15242b8a (patch) | |
tree | fc1096f861666edad661deee5d5fea41d6868980 /drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c | |
parent | drm/amd/powerplay: remove set but not used variable 'us_mvdd' (diff) | |
download | linux-dev-84ce6c48675b55e937814e7c688c46ab15242b8a.tar.xz linux-dev-84ce6c48675b55e937814e7c688c46ab15242b8a.zip |
drm/amdkfd: Merge CIK kernel queue functions into VI
The only difference that CIK kernel queue functions are different from
VI is avoid allocating eop_mem. We can achieve that by using a if
condition.
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c index 2adaf40027eb..5f5c8d73570d 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c @@ -43,6 +43,10 @@ static bool initialize_vi(struct kernel_queue *kq, struct kfd_dev *dev, { int retval; + /*For CIK family asics, kq->eop_mem is not needed */ + if (dev->device_info->asic_family <= CHIP_MULLINS) + return true; + retval = kfd_gtt_sa_allocate(dev, PAGE_SIZE, &kq->eop_mem); if (retval != 0) return false; @@ -57,6 +61,9 @@ static bool initialize_vi(struct kernel_queue *kq, struct kfd_dev *dev, static void uninitialize_vi(struct kernel_queue *kq) { + /* For CIK family asics, kq->eop_mem is Null, kfd_gtt_sa_free() + * is able to handle NULL properly. + */ kfd_gtt_sa_free(kq->dev, kq->eop_mem); } |