void ttm_mem_io_free_vm(struct ttm_buffer_object *bo) { struct ttm_mem_reg *mem = &bo->mem; if (mem->bus.io_reserved_vm) { mem->bus.io_reserved_vm = false; list_del_init(&bo->io_reserve_lru); ttm_mem_io_free(bo->bdev, mem); } }
void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo) { struct ttm_bo_device *bdev = bo->bdev; loff_t offset = (loff_t) bo->addr_space_offset; loff_t holelen = ((loff_t) bo->mem.num_pages) << PAGE_SHIFT; if (!bdev->dev_mapping) return; unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1); ttm_mem_io_free(bdev, &bo->mem); }