Lines Matching refs:mem
235 struct kgd_mem **mem = (struct kgd_mem **) mem_obj; in alloc_gtt_mem() local
242 *mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL); in alloc_gtt_mem()
243 if ((*mem) == NULL) in alloc_gtt_mem()
247 RADEON_GEM_GTT_WC, NULL, NULL, &(*mem)->bo); in alloc_gtt_mem()
255 r = radeon_bo_reserve((*mem)->bo, true); in alloc_gtt_mem()
261 r = radeon_bo_pin((*mem)->bo, RADEON_GEM_DOMAIN_GTT, in alloc_gtt_mem()
262 &(*mem)->gpu_addr); in alloc_gtt_mem()
267 *gpu_addr = (*mem)->gpu_addr; in alloc_gtt_mem()
269 r = radeon_bo_kmap((*mem)->bo, &(*mem)->cpu_ptr); in alloc_gtt_mem()
275 *cpu_ptr = (*mem)->cpu_ptr; in alloc_gtt_mem()
277 radeon_bo_unreserve((*mem)->bo); in alloc_gtt_mem()
282 radeon_bo_unpin((*mem)->bo); in alloc_gtt_mem()
284 radeon_bo_unreserve((*mem)->bo); in alloc_gtt_mem()
286 radeon_bo_unref(&(*mem)->bo); in alloc_gtt_mem()
293 struct kgd_mem *mem = (struct kgd_mem *) mem_obj; in free_gtt_mem() local
295 BUG_ON(mem == NULL); in free_gtt_mem()
297 radeon_bo_reserve(mem->bo, true); in free_gtt_mem()
298 radeon_bo_kunmap(mem->bo); in free_gtt_mem()
299 radeon_bo_unpin(mem->bo); in free_gtt_mem()
300 radeon_bo_unreserve(mem->bo); in free_gtt_mem()
301 radeon_bo_unref(&(mem->bo)); in free_gtt_mem()
302 kfree(mem); in free_gtt_mem()