diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2018-04-01 23:20:44 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-04-11 14:08:01 -0400 |
commit | 552825b28ddac200b6080d9e79f4121b68e1517d (patch) | |
tree | a274b24b9c9c11789520e585265eb939fe11d83b /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 5a8c102ac471c53da38b2c3c35417e9355d21215 (diff) |
drm/amdgpu: add new bo flag that indicates BOs don't need fallback (v2)
user cases:
1. KFD wraps amdgpu_bo_create, they have no fallback case which is different
with amdgpu_gem_object_create.
since upstream branch has no amdgpu_amdkfd_gpuvm.c, which need KFD
guys add this flag to __alloc_memory_of_gpu:
+ flags |= AMDGPU_GEM_CREATE_NO_FALLBACK;
2. UMD can specify this flag for their allocation as well if they like.
v2: squash in merge conflict fix (Chunming)
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: felix.kuehling@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 04d6830347ec..9e23d6f6f3f3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -388,6 +388,8 @@ retry: | |||
388 | drm_gem_private_object_init(adev->ddev, &bo->gem_base, size); | 388 | drm_gem_private_object_init(adev->ddev, &bo->gem_base, size); |
389 | INIT_LIST_HEAD(&bo->shadow_list); | 389 | INIT_LIST_HEAD(&bo->shadow_list); |
390 | INIT_LIST_HEAD(&bo->va); | 390 | INIT_LIST_HEAD(&bo->va); |
391 | bo->preferred_domains = preferred_domains; | ||
392 | bo->allowed_domains = allowed_domains; | ||
391 | 393 | ||
392 | bo->flags = flags; | 394 | bo->flags = flags; |
393 | 395 | ||
@@ -424,7 +426,8 @@ retry: | |||
424 | r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type, | 426 | r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type, |
425 | &bo->placement, page_align, &ctx, acc_size, | 427 | &bo->placement, page_align, &ctx, acc_size, |
426 | NULL, resv, &amdgpu_ttm_bo_destroy); | 428 | NULL, resv, &amdgpu_ttm_bo_destroy); |
427 | if (unlikely(r && r != -ERESTARTSYS) && type == ttm_bo_type_device) { | 429 | if (unlikely(r && r != -ERESTARTSYS) && type == ttm_bo_type_device && |
430 | !(flags & AMDGPU_GEM_CREATE_NO_FALLBACK)) { | ||
428 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) { | 431 | if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) { |
429 | flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; | 432 | flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; |
430 | goto retry; | 433 | goto retry; |