Lines Matching full:mem

55 int intel_region_to_ttm_type(const struct intel_memory_region *mem)  in intel_region_to_ttm_type()  argument
59 GEM_BUG_ON(mem->type != INTEL_MEMORY_LOCAL && in intel_region_to_ttm_type()
60 mem->type != INTEL_MEMORY_MOCK && in intel_region_to_ttm_type()
61 mem->type != INTEL_MEMORY_SYSTEM); in intel_region_to_ttm_type()
63 if (mem->type == INTEL_MEMORY_SYSTEM) in intel_region_to_ttm_type()
66 type = mem->instance + TTM_PL_PRIV; in intel_region_to_ttm_type()
74 * @mem: The region to initialize.
83 int intel_region_ttm_init(struct intel_memory_region *mem) in intel_region_ttm_init() argument
85 struct ttm_device *bdev = &mem->i915->bdev; in intel_region_ttm_init()
86 int mem_type = intel_region_to_ttm_type(mem); in intel_region_ttm_init()
90 resource_size(&mem->region), in intel_region_ttm_init()
91 mem->io_size, in intel_region_ttm_init()
92 mem->min_page_size, PAGE_SIZE); in intel_region_ttm_init()
96 mem->region_private = ttm_manager_type(bdev, mem_type); in intel_region_ttm_init()
103 * @mem: The memory region
109 int intel_region_ttm_fini(struct intel_memory_region *mem) in intel_region_ttm_fini() argument
111 struct ttm_resource_manager *man = mem->region_private; in intel_region_ttm_fini()
125 i915_gem_flush_free_objects(mem->i915); in intel_region_ttm_fini()
127 mutex_lock(&mem->objects.lock); in intel_region_ttm_fini()
128 if (list_empty(&mem->objects.list)) in intel_region_ttm_fini()
130 mutex_unlock(&mem->objects.lock); in intel_region_ttm_fini()
135 flush_delayed_work(&mem->i915->bdev.wq); in intel_region_ttm_fini()
142 ret = i915_ttm_buddy_man_fini(&mem->i915->bdev, in intel_region_ttm_fini()
143 intel_region_to_ttm_type(mem)); in intel_region_ttm_fini()
145 mem->region_private = NULL; in intel_region_ttm_fini()
153 * @mem: The memory region.
164 intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem, in intel_region_ttm_resource_to_rsgt() argument
168 if (mem->is_range_manager) { in intel_region_ttm_resource_to_rsgt()
173 mem->region.start, in intel_region_ttm_resource_to_rsgt()
176 return i915_rsgt_from_buddy_resource(res, mem->region.start, in intel_region_ttm_resource_to_rsgt()
184 * @mem: The memory region,
198 intel_region_ttm_resource_alloc(struct intel_memory_region *mem, in intel_region_ttm_resource_alloc() argument
203 struct ttm_resource_manager *man = mem->region_private; in intel_region_ttm_resource_alloc()
214 } else if (mem->io_size && mem->io_size < mem->total) { in intel_region_ttm_resource_alloc()
219 place.lpfn = mem->io_size >> PAGE_SHIFT; in intel_region_ttm_resource_alloc()
224 mock_bo.bdev = &mem->i915->bdev; in intel_region_ttm_resource_alloc()
238 * @mem: The region the resource was allocated from.
241 void intel_region_ttm_resource_free(struct intel_memory_region *mem, in intel_region_ttm_resource_free() argument
244 struct ttm_resource_manager *man = mem->region_private; in intel_region_ttm_resource_free()
248 mock_bo.bdev = &mem->i915->bdev; in intel_region_ttm_resource_free()