Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: use amdgpu_bo_create_user() for when possible

Use amdgpu_bo_create_user() for all the BO allocations for
ttm_bo_type_device type.

v2: include amdgpu_amdkfd_alloc_gws() as well it calls amdgpu_bo_create()
for ttm_bo_type_device

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nirmoy Das and committed by
Alex Deucher
22b40f7a 9ad0d033

+6 -2
+3 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
··· 318 318 { 319 319 struct amdgpu_device *adev = (struct amdgpu_device *)kgd; 320 320 struct amdgpu_bo *bo = NULL; 321 + struct amdgpu_bo_user *ubo; 321 322 struct amdgpu_bo_param bp; 322 323 int r; 323 324 ··· 331 330 bp.resv = NULL; 332 331 bp.bo_ptr_size = sizeof(struct amdgpu_bo); 333 332 334 - r = amdgpu_bo_create(adev, &bp, &bo); 333 + r = amdgpu_bo_create_user(adev, &bp, &ubo); 335 334 if (r) { 336 335 dev_err(adev->dev, 337 336 "failed to allocate gws BO for amdkfd (%d)\n", r); 338 337 return r; 339 338 } 340 339 340 + bo = &ubo->bo; 341 341 *mem_obj = bo; 342 342 return 0; 343 343 }
+3 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
··· 58 58 struct drm_gem_object **obj) 59 59 { 60 60 struct amdgpu_bo *bo; 61 + struct amdgpu_bo_user *ubo; 61 62 struct amdgpu_bo_param bp; 62 63 int r; 63 64 ··· 74 73 bp.domain = initial_domain; 75 74 bp.bo_ptr_size = sizeof(struct amdgpu_bo); 76 75 77 - r = amdgpu_bo_create(adev, &bp, &bo); 76 + r = amdgpu_bo_create_user(adev, &bp, &ubo); 78 77 if (r) 79 78 return r; 80 79 80 + bo = &ubo->bo; 81 81 *obj = &bo->tbo.base; 82 82 (*obj)->funcs = &amdgpu_gem_object_funcs; 83 83