Lines Matching refs:mem
50 ttm_bo_mem_put(bo, &bo->mem); in ttm_bo_free_old_node()
58 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_ttm()
134 struct ttm_mem_reg *mem) in ttm_mem_io_reserve() argument
136 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; in ttm_mem_io_reserve()
142 return bdev->driver->io_mem_reserve(bdev, mem); in ttm_mem_io_reserve()
145 mem->bus.io_reserved_count++ == 0) { in ttm_mem_io_reserve()
147 ret = bdev->driver->io_mem_reserve(bdev, mem); in ttm_mem_io_reserve()
159 struct ttm_mem_reg *mem) in ttm_mem_io_free() argument
161 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; in ttm_mem_io_free()
167 --mem->bus.io_reserved_count == 0 && in ttm_mem_io_free()
169 bdev->driver->io_mem_free(bdev, mem); in ttm_mem_io_free()
176 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_reserve_vm() local
179 if (!mem->bus.io_reserved_vm) { in ttm_mem_io_reserve_vm()
181 &bo->bdev->man[mem->mem_type]; in ttm_mem_io_reserve_vm()
183 ret = ttm_mem_io_reserve(bo->bdev, mem); in ttm_mem_io_reserve_vm()
186 mem->bus.io_reserved_vm = true; in ttm_mem_io_reserve_vm()
196 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_free_vm() local
198 if (mem->bus.io_reserved_vm) { in ttm_mem_io_free_vm()
199 mem->bus.io_reserved_vm = false; in ttm_mem_io_free_vm()
201 ttm_mem_io_free(bo->bdev, mem); in ttm_mem_io_free_vm()
205 static int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, in ttm_mem_reg_ioremap() argument
208 struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; in ttm_mem_reg_ioremap()
214 ret = ttm_mem_io_reserve(bdev, mem); in ttm_mem_reg_ioremap()
216 if (ret || !mem->bus.is_iomem) in ttm_mem_reg_ioremap()
219 if (mem->bus.addr) { in ttm_mem_reg_ioremap()
220 addr = mem->bus.addr; in ttm_mem_reg_ioremap()
222 if (mem->placement & TTM_PL_FLAG_WC) in ttm_mem_reg_ioremap()
223 addr = ioremap_wc(mem->bus.base + mem->bus.offset, mem->bus.size); in ttm_mem_reg_ioremap()
225 addr = ioremap_nocache(mem->bus.base + mem->bus.offset, mem->bus.size); in ttm_mem_reg_ioremap()
228 ttm_mem_io_free(bdev, mem); in ttm_mem_reg_ioremap()
237 static void ttm_mem_reg_iounmap(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem, in ttm_mem_reg_iounmap() argument
242 man = &bdev->man[mem->mem_type]; in ttm_mem_reg_iounmap()
244 if (virtual && mem->bus.addr == NULL) in ttm_mem_reg_iounmap()
247 ttm_mem_io_free(bdev, mem); in ttm_mem_reg_iounmap()
363 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_memcpy()
496 fbo->base.mem.placement |= TTM_PL_FLAG_NO_EVICT; in ttm_buffer_object_transfer()
560 struct ttm_mem_reg *mem = &bo->mem; in ttm_bo_ioremap() local
562 if (bo->mem.bus.addr) { in ttm_bo_ioremap()
564 map->virtual = (void *)(((u8 *)bo->mem.bus.addr) + offset); in ttm_bo_ioremap()
567 if (mem->placement & TTM_PL_FLAG_WC) in ttm_bo_ioremap()
568 map->virtual = ioremap_wc(bo->mem.bus.base + bo->mem.bus.offset + offset, in ttm_bo_ioremap()
571 map->virtual = ioremap_nocache(bo->mem.bus.base + bo->mem.bus.offset + offset, in ttm_bo_ioremap()
582 struct ttm_mem_reg *mem = &bo->mem; in ttm_bo_kmap_ttm() local
597 if (num_pages == 1 && (mem->placement & TTM_PL_FLAG_CACHED)) { in ttm_bo_kmap_ttm()
611 prot = ttm_io_prot(mem->placement, PAGE_KERNEL); in ttm_bo_kmap_ttm()
624 &bo->bdev->man[bo->mem.mem_type]; in ttm_bo_kmap()
636 ret = ttm_mem_io_reserve(bo->bdev, &bo->mem); in ttm_bo_kmap()
640 if (!bo->mem.bus.is_iomem) { in ttm_bo_kmap()
654 &bo->bdev->man[bo->mem.mem_type]; in ttm_bo_kunmap()
674 ttm_mem_io_free(map->bo->bdev, &map->bo->mem); in ttm_bo_kunmap()
688 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_accel_cleanup()
748 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_pipeline_move()
849 memset(&bo->mem, 0, sizeof(bo->mem)); in ttm_bo_pipeline_gutting()
850 bo->mem.mem_type = TTM_PL_SYSTEM; in ttm_bo_pipeline_gutting()