drm/amdgpu: add param bit flag to create SVM BOs
authorAlex Sierra <alex.sierra@amd.com>
Tue, 28 Jul 2020 18:38:29 +0000 (13:38 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Apr 2021 01:49:31 +0000 (21:49 -0400)
Add CREATE_SVM_BO define bit for SVM BOs.
Another define flag was moved to concentrate these
KFD type flags in one include file.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h

index 6c4df1f1796e19c490a1e1e41a42744db049d3df..dfa025d694f87dbb6ca1e9442a3210a987c1b3aa 100644 (file)
@@ -33,9 +33,6 @@
 #include <uapi/linux/kfd_ioctl.h>
 #include "amdgpu_xgmi.h"
 
-/* BO flag to indicate a KFD userptr BO */
-#define AMDGPU_AMDKFD_USERPTR_BO (1ULL << 63)
-
 /* Userptr restore delay, just long enough to allow consecutive VM
  * changes to accumulate
  */
@@ -222,7 +219,7 @@ void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo)
        u32 domain = bo->preferred_domains;
        bool sg = (bo->preferred_domains == AMDGPU_GEM_DOMAIN_CPU);
 
-       if (bo->flags & AMDGPU_AMDKFD_USERPTR_BO) {
+       if (bo->flags & AMDGPU_AMDKFD_CREATE_USERPTR_BO) {
                domain = AMDGPU_GEM_DOMAIN_CPU;
                sg = false;
        }
@@ -1241,7 +1238,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
        bo->kfd_bo = *mem;
        (*mem)->bo = bo;
        if (user_addr)
-               bo->flags |= AMDGPU_AMDKFD_USERPTR_BO;
+               bo->flags |= AMDGPU_AMDKFD_CREATE_USERPTR_BO;
 
        (*mem)->va = va;
        (*mem)->domain = domain;
index 2d1fefbe1e99ff65216fd0eca658dbb431cea756..973c88bdf37b5c5110554cfe4bf36eb34cc0b0bc 100644 (file)
 #define AMDGPU_BO_INVALID_OFFSET       LONG_MAX
 #define AMDGPU_BO_MAX_PLACEMENTS       3
 
+/* BO flag to indicate a KFD userptr BO */
+#define AMDGPU_AMDKFD_CREATE_USERPTR_BO        (1ULL << 63)
+#define AMDGPU_AMDKFD_CREATE_SVM_BO    (1ULL << 62)
+
 #define to_amdgpu_bo_user(abo) container_of((abo), struct amdgpu_bo_user, bo)
 
 struct amdgpu_bo_param {