Lines Matching refs:mem
174 struct kgd_mem **mem = (struct kgd_mem **) mem_obj; in alloc_gtt_mem() local
181 *mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL); in alloc_gtt_mem()
182 if ((*mem) == NULL) in alloc_gtt_mem()
186 AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &(*mem)->bo); in alloc_gtt_mem()
194 r = amdgpu_bo_reserve((*mem)->bo, true); in alloc_gtt_mem()
200 r = amdgpu_bo_pin((*mem)->bo, AMDGPU_GEM_DOMAIN_GTT, in alloc_gtt_mem()
201 &(*mem)->gpu_addr); in alloc_gtt_mem()
206 *gpu_addr = (*mem)->gpu_addr; in alloc_gtt_mem()
208 r = amdgpu_bo_kmap((*mem)->bo, &(*mem)->cpu_ptr); in alloc_gtt_mem()
214 *cpu_ptr = (*mem)->cpu_ptr; in alloc_gtt_mem()
216 amdgpu_bo_unreserve((*mem)->bo); in alloc_gtt_mem()
221 amdgpu_bo_unpin((*mem)->bo); in alloc_gtt_mem()
223 amdgpu_bo_unreserve((*mem)->bo); in alloc_gtt_mem()
225 amdgpu_bo_unref(&(*mem)->bo); in alloc_gtt_mem()
232 struct kgd_mem *mem = (struct kgd_mem *) mem_obj; in free_gtt_mem() local
234 BUG_ON(mem == NULL); in free_gtt_mem()
236 amdgpu_bo_reserve(mem->bo, true); in free_gtt_mem()
237 amdgpu_bo_kunmap(mem->bo); in free_gtt_mem()
238 amdgpu_bo_unpin(mem->bo); in free_gtt_mem()
239 amdgpu_bo_unreserve(mem->bo); in free_gtt_mem()
240 amdgpu_bo_unref(&(mem->bo)); in free_gtt_mem()
241 kfree(mem); in free_gtt_mem()