diff options
author | Christian König <christian.koenig@amd.com> | 2018-09-19 10:25:08 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-07 17:53:44 -0500 |
commit | a9f34c70fd168b164aadffd46bb757ded52e25b9 (patch) | |
tree | fd7c5109dc72f884f21d6562481bd24073402770 /drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | |
parent | c50fe0c5b174153669fd437c1c5fde724b3bc7f4 (diff) |
drm/ttm: allow reserving more than one shared slot v3
Let's support simultaneous submissions to multiple engines.
v2: rename the field to num_shared and fix up all users
v3: rebased
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index f3129b912714..b29ef088fa14 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | |||
@@ -535,7 +535,7 @@ static void add_kgd_mem_to_kfd_bo_list(struct kgd_mem *mem, | |||
535 | struct amdgpu_bo *bo = mem->bo; | 535 | struct amdgpu_bo *bo = mem->bo; |
536 | 536 | ||
537 | INIT_LIST_HEAD(&entry->head); | 537 | INIT_LIST_HEAD(&entry->head); |
538 | entry->shared = true; | 538 | entry->num_shared = 1; |
539 | entry->bo = &bo->tbo; | 539 | entry->bo = &bo->tbo; |
540 | mutex_lock(&process_info->lock); | 540 | mutex_lock(&process_info->lock); |
541 | if (userptr) | 541 | if (userptr) |
@@ -676,7 +676,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem, | |||
676 | 676 | ||
677 | ctx->kfd_bo.priority = 0; | 677 | ctx->kfd_bo.priority = 0; |
678 | ctx->kfd_bo.tv.bo = &bo->tbo; | 678 | ctx->kfd_bo.tv.bo = &bo->tbo; |
679 | ctx->kfd_bo.tv.shared = true; | 679 | ctx->kfd_bo.tv.num_shared = 1; |
680 | ctx->kfd_bo.user_pages = NULL; | 680 | ctx->kfd_bo.user_pages = NULL; |
681 | list_add(&ctx->kfd_bo.tv.head, &ctx->list); | 681 | list_add(&ctx->kfd_bo.tv.head, &ctx->list); |
682 | 682 | ||
@@ -740,7 +740,7 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem, | |||
740 | 740 | ||
741 | ctx->kfd_bo.priority = 0; | 741 | ctx->kfd_bo.priority = 0; |
742 | ctx->kfd_bo.tv.bo = &bo->tbo; | 742 | ctx->kfd_bo.tv.bo = &bo->tbo; |
743 | ctx->kfd_bo.tv.shared = true; | 743 | ctx->kfd_bo.tv.num_shared = 1; |
744 | ctx->kfd_bo.user_pages = NULL; | 744 | ctx->kfd_bo.user_pages = NULL; |
745 | list_add(&ctx->kfd_bo.tv.head, &ctx->list); | 745 | list_add(&ctx->kfd_bo.tv.head, &ctx->list); |
746 | 746 | ||
@@ -1830,7 +1830,7 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info) | |||
1830 | validate_list.head) { | 1830 | validate_list.head) { |
1831 | list_add_tail(&mem->resv_list.head, &resv_list); | 1831 | list_add_tail(&mem->resv_list.head, &resv_list); |
1832 | mem->resv_list.bo = mem->validate_list.bo; | 1832 | mem->resv_list.bo = mem->validate_list.bo; |
1833 | mem->resv_list.shared = mem->validate_list.shared; | 1833 | mem->resv_list.num_shared = mem->validate_list.num_shared; |
1834 | } | 1834 | } |
1835 | 1835 | ||
1836 | /* Reserve all BOs and page tables for validation */ | 1836 | /* Reserve all BOs and page tables for validation */ |
@@ -2049,7 +2049,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef) | |||
2049 | 2049 | ||
2050 | list_add_tail(&mem->resv_list.head, &ctx.list); | 2050 | list_add_tail(&mem->resv_list.head, &ctx.list); |
2051 | mem->resv_list.bo = mem->validate_list.bo; | 2051 | mem->resv_list.bo = mem->validate_list.bo; |
2052 | mem->resv_list.shared = mem->validate_list.shared; | 2052 | mem->resv_list.num_shared = mem->validate_list.num_shared; |
2053 | } | 2053 | } |
2054 | 2054 | ||
2055 | ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list, | 2055 | ret = ttm_eu_reserve_buffers(&ctx.ticket, &ctx.list, |