Lines Matching refs:mem

54 int intel_region_to_ttm_type(const struct intel_memory_region *mem)  in intel_region_to_ttm_type()  argument
58 GEM_BUG_ON(mem->type != INTEL_MEMORY_LOCAL && in intel_region_to_ttm_type()
59 mem->type != INTEL_MEMORY_MOCK && in intel_region_to_ttm_type()
60 mem->type != INTEL_MEMORY_SYSTEM); in intel_region_to_ttm_type()
62 if (mem->type == INTEL_MEMORY_SYSTEM) in intel_region_to_ttm_type()
65 type = mem->instance + TTM_PL_PRIV; in intel_region_to_ttm_type()
82 int intel_region_ttm_init(struct intel_memory_region *mem) in intel_region_ttm_init() argument
84 struct ttm_device *bdev = &mem->i915->bdev; in intel_region_ttm_init()
85 int mem_type = intel_region_to_ttm_type(mem); in intel_region_ttm_init()
89 resource_size(&mem->region), in intel_region_ttm_init()
90 mem->min_page_size, PAGE_SIZE); in intel_region_ttm_init()
94 mem->region_private = ttm_manager_type(bdev, mem_type); in intel_region_ttm_init()
107 void intel_region_ttm_fini(struct intel_memory_region *mem) in intel_region_ttm_fini() argument
111 ret = i915_ttm_buddy_man_fini(&mem->i915->bdev, in intel_region_ttm_fini()
112 intel_region_to_ttm_type(mem)); in intel_region_ttm_fini()
114 mem->region_private = NULL; in intel_region_ttm_fini()
129 struct sg_table *intel_region_ttm_resource_to_st(struct intel_memory_region *mem, in intel_region_ttm_resource_to_st() argument
132 if (mem->is_range_manager) { in intel_region_ttm_resource_to_st()
137 mem->region.start); in intel_region_ttm_resource_to_st()
139 return i915_sg_from_buddy_resource(res, mem->region.start); in intel_region_ttm_resource_to_st()
160 intel_region_ttm_resource_alloc(struct intel_memory_region *mem, in intel_region_ttm_resource_alloc() argument
164 struct ttm_resource_manager *man = mem->region_private; in intel_region_ttm_resource_alloc()
186 void intel_region_ttm_resource_free(struct intel_memory_region *mem, in intel_region_ttm_resource_free() argument
189 struct ttm_resource_manager *man = mem->region_private; in intel_region_ttm_resource_free()